speed up package prereq check (only run make on those directories that actually conta...
authorFelix Fietkau <nbd@openwrt.org>
Thu, 5 Oct 2006 12:39:52 +0000 (12:39 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 5 Oct 2006 12:39:52 +0000 (12:39 +0000)
SVN-Revision: 4927

openwrt/include/package.mk
openwrt/include/prereq.mk
openwrt/package/Makefile
openwrt/scripts/gen_deps.pl

index 709bb4415550e2c14981eacc42027d740caf8163..3f2f7d41befb463cebee392d61c3fdb957addc93 100644 (file)
@@ -163,13 +163,14 @@ define BuildPackage
     endif
 
     DUMPINFO += \
+       if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \
        echo "Version: $(VERSION)"; \
        echo "Depends: $$(IDEPEND_$(1))"; \
        echo "Build-Depends: $(PKG_BUILDDEP)"; \
        echo "Category: $(CATEGORY)"; \
        echo "Title: $(TITLE)"; \
        echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g';
-
+       
     ifneq ($(URL),)
       DUMPINFO += \
        echo; \
index c9b82d29477f1da3f4fedd678741fe5da7e750f9..eda7ca35a6977dfae118b0247bf932fc53ded404 100644 (file)
@@ -22,6 +22,7 @@ prereq:
 .SILENT: $(TMP_DIR) prereq
 
 define Require
+  export PREREQ_CHECK=1
   ifeq ($$(CHECK_$(1)),)
     prereq: prereq-$(1)
 
index b9392c049034b3384760427c5458cbb38d9c3fd1..b6165b856727ee87fba129470404d6ba5601d69b 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 include $(TOPDIR)/.config
 include $(TOPDIR)/.pkgdeps
 
-PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(package-y) $(package-m))
+PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(package-prereq))
 DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
index 70c07b70a8123ad1971ddd003016fbe9c7d45d35..e7daf18866be50384a5b8cbf516eabdf3d627349 100755 (executable)
@@ -13,6 +13,8 @@ my $src;
 my $makefile;
 my %conf;
 my %pkg;
+my %prereq;
+my $prereq;
 my %dep;
 my %options;
 my $opt;
@@ -33,6 +35,10 @@ while ($line = <>) {
                defined $pkg{$name} or $pkg{$name} = {};
                $pkg{$name}->{src} = $src;
        };
+       $line =~ /^Prereq-Check:/ and !defined $prereq{$src} and do {
+               $prereq{$src} = 1;
+               $prereq .= "package-prereq += $src\n";
+       };
        $line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do {
                $pkg{$name}->{depends} ||= [];
                foreach my $v (split /\s+/, $2) {
@@ -75,5 +81,5 @@ foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
 }
 
 if ($line ne "") {
-       print "\n$line";
+       print "\n$line\n$prereq";
 }