- yes '' | $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(PKG_BUILD_DIR) oldconfig
- touch $@
-
-$(PKG_BUILD_DIR)/.built:
- $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(IDIR_BUSYBOX)" \
- EXTRA_CFLAGS="$(TARGET_CFLAGS)" ARCH="$(ARCH)" -C $(PKG_BUILD_DIR)
- touch $@
-
-$(IPKG_BUSYBOX):
- $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(IDIR_BUSYBOX)" \
- EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR) install
- $(STRIP) $(IDIR_BUSYBOX)/bin/busybox
- -chmod a+x $(IDIR_BUSYBOX)/usr/share/udhcpc/default.script
- $(IPKG_BUILD) $(IDIR_BUSYBOX) $(PACKAGE_DIR)
+ yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC="$(TARGET_CC)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ ARCH="$(ARCH)" \
+ oldconfig
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC="$(TARGET_CC)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ ARCH="$(ARCH)" \
+ IPKG_ARCH="$(ARCH)" \
+ all
+endef
+
+define Package/busybox/install
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC="$(TARGET_CC)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ ARCH="$(ARCH)" \
+ IPKG_ARCH="$(ARCH)" \
+ CONFIG_PREFIX="$(1)" \
+ install
+ $(INSTALL_DIR) $(1)/etc/init.d
+ for tmp in $(init-y); do \
+ $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
+ done
+ -rm -rf $(1)/lib64
+endef
+
+$(eval $(call BuildPackage,busybox))