build: clean up redundant touching of the package install info file
authorFelix Fietkau <nbd@nbd.name>
Tue, 21 Feb 2017 17:27:22 +0000 (18:27 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 26 Feb 2017 12:31:44 +0000 (13:31 +0100)
Instead of using a separate .clean stamp file, remove the install info
file on compile, then append the install package list afterwards

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/package-ipkg.mk
include/package.mk

index 2b3ff148f5c24e7beba1e3514e2f34a12ea365d5..620be991b3e3e1ab95ae9df8d6fb25384cec66de 100644 (file)
@@ -107,22 +107,18 @@ ifeq ($(DUMP),)
       ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
         IPKGS += $(1)
         $(_pkg_target)compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
       ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
         IPKGS += $(1)
         $(_pkg_target)compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
+        prepare-package-install: $$(IPKG_$(1))
         compile: $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
       else
         $(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
       endif
 
       .PHONY: $(PKG_INSTALL_STAMP).$(1)
         compile: $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
       else
         $(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
       endif
 
       .PHONY: $(PKG_INSTALL_STAMP).$(1)
-      compile: $(PKG_INSTALL_STAMP).$(1)
-      $(PKG_INSTALL_STAMP).$(1):
-                       if [ -f $(PKG_INSTALL_STAMP).clean ]; then \
-                               rm -f \
-                                       $(PKG_INSTALL_STAMP) \
-                                       $(PKG_INSTALL_STAMP).clean; \
-                       fi
       ifeq ($(CONFIG_PACKAGE_$(1)),y)
       ifeq ($(CONFIG_PACKAGE_$(1)),y)
-                       echo "$(1)" >> $(PKG_INSTALL_STAMP)
+        compile: $(PKG_INSTALL_STAMP).$(1)
       endif
       endif
+      $(PKG_INSTALL_STAMP).$(1): prepare-package-install
+               echo "$(1)" >> $(PKG_INSTALL_STAMP)
     endif
     endif
 
     endif
     endif
 
index a3ef3029d80b79af6d8a8481f3b4374effcf0d27..bf308bb5c076aa8f01eeb8638bdd60103abb273a 100644 (file)
@@ -293,13 +293,13 @@ Build/DistCheck=$(call Build/DistCheck/Default,)
 .PHONY: prepare-package-install
 prepare-package-install:
        @mkdir -p $(PKG_INFO_DIR)
 .PHONY: prepare-package-install
 prepare-package-install:
        @mkdir -p $(PKG_INFO_DIR)
-       @touch $(PKG_INSTALL_STAMP).clean
+       @rm -f $(PKG_INSTALL_STAMP)
        @echo "$(filter-out essential nonshared,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
 
 $(PACKAGE_DIR):
        mkdir -p $@
 
        @echo "$(filter-out essential nonshared,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
 
 $(PACKAGE_DIR):
        mkdir -p $@
 
-compile: prepare-package-install
+compile:
 .install: .compile
 install: compile
 
 .install: .compile
 install: compile