build: allow building an individual subdir without dependencies using NO_DEPS=1
[openwrt/staging/yousong.git] / include / package.mk
index 01c0333b06934c8bcf81d3ac1e5dfe7a425eb34b..ce1aa256bdf0eaf78c298fcba0f207e6ca9047fc 100644 (file)
@@ -156,6 +156,7 @@ define Build/CoreTargets
   $(STAMP_PREPARED): $(STAMP_PREPARED_DEPENDS)
        @-rm -rf $(PKG_BUILD_DIR)
        @mkdir -p $(PKG_BUILD_DIR)
+       touch $$@_check
        $(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
        $(Build/Prepare)
        $(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
@@ -172,6 +173,8 @@ define Build/CoreTargets
 
   $(call Build/Exports,$(STAMP_BUILT))
   $(STAMP_BUILT): $(STAMP_CONFIGURED) $(STAMP_BUILT_DEPENDS)
+       rm -f $$@
+       touch $$@_check
        $(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
        $(Build/Compile)
        $(foreach hook,$(Hooks/Compile/Post),$(call $(hook))$(sep))
@@ -216,7 +219,7 @@ define Build/CoreTargets
 
   ifneq ($(CONFIG_AUTOREMOVE),)
     compile:
-               touch $(PKG_BUILD_DIR)/.autoremove
+               -touch $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null
                $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
                        $(XARGS) rm -rf
   endif