- $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(PKG_BUILD_DIR) oldconfig
- touch $(PKG_BUILD_DIR)/.configured
-
-$(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(PKG_IPK_DIR)" \
- EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR)
-
-$(PKG_IPK): $(PKG_BUILD_DIR)/$(PKG_NAME)
- $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
- $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(PKG_IPK_DIR)" \
- EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR) install
- $(STRIP) $(PKG_IPK_DIR)/bin/busybox
- -chmod a+x $(PKG_IPK_DIR)/usr/share/udhcpc/default.script
- mkdir -p $(PACKAGE_DIR)
- $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
-
-$(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
- $(IPKG) install $(PKG_IPK)
-
-source: $(DL_DIR)/$(PKG_SOURCE)
-prepare: $(PKG_BUILD_DIR)/.patched
-compile: $(PKG_IPK)
-install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
-
-clean:
- rm -rf $(PKG_BUILD_DIR)
- rm -f $(PKG_IPK)
+ 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))