kernel: update kernel 4.4 to version 4.4.22
[openwrt/openwrt.git] / package / Makefile
index f5a73956438b0212b4d41ac9172a2bdd67a3db6d..8726e2eae9c741ca073a56bfd279e8cd8661ee75 100644 (file)
@@ -44,9 +44,17 @@ PACKAGE_INSTALL_FILES:= \
 $(curdir)/cleanup: $(TMP_DIR)/.build
        rm -rf $(STAGING_DIR_ROOT)
 
-$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
+$(curdir)/merge:
+       rm -rf $(PACKAGE_DIR_ALL)
+       mkdir -p $(PACKAGE_DIR_ALL)
+       -$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.ipk),ln -s $(pdir)/*.ipk $(PACKAGE_DIR_ALL);))
+
+$(curdir)/merge-index: $(curdir)/merge
+       (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
+
+$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
        - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
-       rm -rf $(TARGET_DIR)
+       rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
        [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
        $(call opkg,$(TARGET_DIR)) install \
                $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
@@ -57,6 +65,9 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
                done; \
        done || true
        @-$(MAKE) package/preconfig
+
+       $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
+
        $(call prepare_rootfs,$(TARGET_DIR))
 
 PASSOPT=""