avoid rdep in the top level make process (subdir.mk) - it leaks too much memory and...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 29 Aug 2007 03:51:49 +0000 (03:51 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 29 Aug 2007 03:51:49 +0000 (03:51 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8533 3c298f89-4303-0410-b956-a3cf2f4a3e73

include/subdir.mk
scripts/timestamp.pl

index 217d6bc3768c2a2755e4dd56b8cf4e33f79e4915..0a3eff307ede504c6c931c38f7a764e211059cdb 100644 (file)
@@ -37,13 +37,9 @@ endef
 # Parameters: <subdir> <name> <target>
 define stampfile
   $(1)/stamp-$(3):=$(STAGING_DIR)/stamp/.$(2)_$(3)
-  $(if $(__rdep_$(1)),,
-    $(call rdep,$(1),$$($(1)/stamp-$(3)),)
-    __rdep_$(1):=1
-  )
-
-  $$($(1)/stamp-$(3)):
-       @+$(MAKE) $$($(1)/flags-$(3)) $(1)/$(3)
+  $$($(1)/stamp-$(3)): $(TMP_DIR)/.build
+       @+$(SCRIPT_DIR)/timestamp.pl -n $$($(1)/stamp-$(3)) $(1) || \
+               $(MAKE) $$($(1)/flags-$(3)) $(1)/$(3)
        @mkdir -p $$$$(dirname $$($(1)/stamp-$(3)))
        @touch $$($(1)/stamp-$(3))
 
index a4c5cae0150822434544dd8412d6db9b5db9ee0a..89ec4e70c310b9a81c888c0978aae1bc41456eff 100755 (executable)
@@ -39,6 +39,9 @@ while (@ARGV > 0) {
                $options{"findopts"} .= " -and -not -path \\*".$str."\\*"
        } elsif ($path =~ /^-f/) {
                $options{"findopts"} .= " -follow";
+       } elsif ($path =~ /^-n/) {
+               my $arg = $ARGV[0];
+               $options{$path} = $arg;
        } elsif ($path =~ /^-/) {
                $options{$path} = 1;
        } else {
@@ -54,7 +57,9 @@ while (@ARGV > 0) {
        }
 }
 
-if ($options{"-p"}) {
+if ($options{"-n"}) {
+       exit ($n eq $options{"-n"} ? 0 : 1);
+} elsif ($options{"-p"}) {
        print "$n\n";
 } elsif ($options{"-t"}) {
        print "$ts\n";