From c133c86f41a5be64876ad611debb189d5d8b479e Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 19 Jul 2006 13:25:09 +0000 Subject: add a simple prerequisite check git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4168 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 include/prereq.mk (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk new file mode 100644 index 0000000000..c51953b619 --- /dev/null +++ b/include/prereq.mk @@ -0,0 +1,118 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/verbose.mk + +$(TMP_DIR): + mkdir -p $@ + +prereq: + @echo + @if [ -f $(TMP_DIR)/.prereq-error ]; then \ + cat $(TMP_DIR)/.prereq-error; \ + echo; \ + rm -rf $(TMP_DIR); \ + false; \ + fi + @rm -rf $(TMP_DIR) + @mkdir -p $(TMP_DIR) + +define Require + ifeq ($$(CHECK_$(1)),) + prereq: prereq-$(1) + + prereq-$(1): $(TMP_DIR) FORCE + @echo -n "Checking '$(1)'... " + @if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ + echo 'ok.'; \ + else \ + echo 'failed.'; \ + echo -e "$(strip $(2))" >> $(TMP_DIR)/.prereq-error; \ + fi + + check-$(1): FORCE + $(call Require/$(1)) + CHECK_$(1):=1 + endif +endef + + +define RequireCommand + define Require/$(1) + which $(1) + endef + + $$(eval $$(call Require,$(1),$(2))) +endef + +# Required for the toolchain +define Require/working-make + echo 'all: test' > $(TMP_DIR)/check.mk + echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk + echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk + echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk + $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk +endef + +$(eval $(call Require,working-make, \ + Your make version is buggy. Please install GNU make v3.81 or later. \ +)) + +define Require/working-gcc + echo 'int main(int argc, char **argv) { return 0; }' | \ + gcc -x c -o $(TMP_DIR)/a.out - +endef + +$(eval $(call Require,working-gcc, \ + No working GNU C Compiler was found on your system. \ +)) + +define Require/working-g++ + echo 'int main(int argc, char **argv) { return 0; }' | \ + g++ -x c++ -o $(TMP_DIR)/a.out -lstdc++ - +endef + +$(eval $(call Require,working-g++, \ + No working GNU C++ Compiler was found on your system. \ +)) + +define Require/zlib + echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ + gcc -x c -o $(TMP_DIR)/a.out -lz - +endef + +$(eval $(call Require,zlib, \ + The development version of zlib was not found on your system. \ +)) + + +$(eval $(call RequireCommand,bison, \ + Please install GNU bison. \ +)) + +$(eval $(call RequireCommand,flex, \ + Please install flex. \ +)) + +$(eval $(call RequireCommand,python, \ + Please install python. \ +)) + +$(eval $(call RequireCommand,unzip, \ + Please install unzip. \ +)) + +$(eval $(call RequireCommand,bzip2, \ + Please install bzip2. \ +)) + +$(eval $(call RequireCommand,patch, \ + Please install patch. \ +)) + + -- cgit v1.2.3 From 32a794689db9de29aca836317584e2d1029df28f Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 19 Jul 2006 16:51:37 +0000 Subject: check for zlib.h as well git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4170 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index c51953b619..6b3621dbac 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -83,7 +83,7 @@ $(eval $(call Require,working-g++, \ define Require/zlib echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ - gcc -x c -o $(TMP_DIR)/a.out -lz - + gcc -include zlib.h -x c -o $(TMP_DIR)/a.out -lz - endef $(eval $(call Require,zlib, \ -- cgit v1.2.3 From 2f6c50c708b9380b7ca94a73351c3760cb38f96a Mon Sep 17 00:00:00 2001 From: mbm Date: Thu, 20 Jul 2006 23:51:25 +0000 Subject: update prereqs git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4179 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index 6b3621dbac..6642ce40e3 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -6,29 +6,30 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/verbose.mk $(TMP_DIR): mkdir -p $@ prereq: - @echo - @if [ -f $(TMP_DIR)/.prereq-error ]; then \ + echo + if [ -f $(TMP_DIR)/.prereq-error ]; then \ cat $(TMP_DIR)/.prereq-error; \ echo; \ rm -rf $(TMP_DIR); \ false; \ fi - @rm -rf $(TMP_DIR) - @mkdir -p $(TMP_DIR) + rm -rf $(TMP_DIR) + mkdir -p $(TMP_DIR) + +.SILENT: $(TMP_DIR) prereq define Require ifeq ($$(CHECK_$(1)),) prereq: prereq-$(1) prereq-$(1): $(TMP_DIR) FORCE - @echo -n "Checking '$(1)'... " - @if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ + echo -n "Checking '$(1)'... " + if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ echo 'ok.'; \ else \ echo 'failed.'; \ @@ -38,6 +39,8 @@ define Require check-$(1): FORCE $(call Require/$(1)) CHECK_$(1):=1 + + .SILENT: prereq-$(1) check-$(1) endif endef @@ -69,7 +72,7 @@ define Require/working-gcc endef $(eval $(call Require,working-gcc, \ - No working GNU C Compiler was found on your system. \ + No working GNU C Compiler (gcc) was found on your system. \ )) define Require/working-g++ @@ -78,7 +81,7 @@ define Require/working-g++ endef $(eval $(call Require,working-g++, \ - No working GNU C++ Compiler was found on your system. \ + No working GNU C++ Compiler (g++) was found on your system. \ )) define Require/zlib @@ -87,7 +90,7 @@ define Require/zlib endef $(eval $(call Require,zlib, \ - The development version of zlib was not found on your system. \ + No zlib development files were not found on your system. \ )) @@ -115,4 +118,6 @@ $(eval $(call RequireCommand,patch, \ Please install patch. \ )) - +$(eval $(call RequireCommand,perl, \ + Please install perl. \ +)) -- cgit v1.2.3 From 25307576b9e7d8c2076f820775c9f65b1b3478cc Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 22 Jul 2006 11:43:48 +0000 Subject: fix prereqs git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4203 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index 6642ce40e3..cbd26be124 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -29,7 +29,7 @@ define Require prereq-$(1): $(TMP_DIR) FORCE echo -n "Checking '$(1)'... " - if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ + if $(MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ echo 'ok.'; \ else \ echo 'failed.'; \ @@ -59,7 +59,7 @@ define Require/working-make echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk - $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk + $(MAKE) -f $(TMP_DIR)/check.mk endef $(eval $(call Require,working-make, \ -- cgit v1.2.3 From 6ebfaece496cffd64455080e24df249d38c17e94 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 22 Jul 2006 12:04:08 +0000 Subject: revert last prereq.mk - seems to be a different issue git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4204 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index cbd26be124..6642ce40e3 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -29,7 +29,7 @@ define Require prereq-$(1): $(TMP_DIR) FORCE echo -n "Checking '$(1)'... " - if $(MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ + if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ echo 'ok.'; \ else \ echo 'failed.'; \ @@ -59,7 +59,7 @@ define Require/working-make echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk - $(MAKE) -f $(TMP_DIR)/check.mk + $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk endef $(eval $(call Require,working-make, \ -- cgit v1.2.3 From 27335d91b487bca2a004f3541bbe402ba3f68faf Mon Sep 17 00:00:00 2001 From: nbd Date: Sun, 23 Jul 2006 23:02:37 +0000 Subject: add ncurses to prereq checks git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4244 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/prereq.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index 6642ce40e3..e514855a67 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -84,6 +84,16 @@ $(eval $(call Require,working-g++, \ No working GNU C++ Compiler (g++) was found on your system. \ )) +define Require/ncurses + echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \ + gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out -lncurses - +endef + +$(eval $(call Require,ncurses, \ + No ncurses development files were not found on your system. \ +)) + + define Require/zlib echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ gcc -include zlib.h -x c -o $(TMP_DIR)/a.out -lz - -- cgit v1.2.3 From 432ce85854aea17f9383519db1c2d3a8307c0760 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 29 Jul 2006 11:30:06 +0000 Subject: add support for per-package prereq checks, run global prereq checks before (menu-)config git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4318 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- Makefile | 25 +++++++++---- include/package.mk | 2 ++ include/prereq-build.mk | 88 +++++++++++++++++++++++++++++++++++++++++++++ include/prereq.mk | 84 ++----------------------------------------- package/Makefile | 9 +++-- package/base-files/Makefile | 4 +-- 6 files changed, 119 insertions(+), 93 deletions(-) create mode 100644 include/prereq-build.mk (limited to 'include/prereq.mk') diff --git a/Makefile b/Makefile index e2e467cd8c..a23f478d7c 100644 --- a/Makefile +++ b/Makefile @@ -31,14 +31,17 @@ export OPENWRTVERSION all: world -.pkginfo: FORCE ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo) +.pkginfo: FORCE +.config: FORCE +endif + +.pkginfo: @echo Collecting package info... @-for dir in package/*/; do \ echo Source-Makefile: $${dir}Makefile; \ $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $$dir 2>&- || true; \ done > $@ -endif .config.in: .pkginfo @./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@ @@ -77,18 +80,25 @@ target/%: .pkginfo FORCE toolchain/%: FORCE $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@) -.config: ./scripts/config/conf FORCE +.config: ./scripts/config/conf @[ -f .config ] || $(NO_TRACE_MAKE) menuconfig @$< -D .config Config.in &> /dev/null -.prereq: $(TOPDIR)/include/prereq.mk .pkginfo - @$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq.mk prereq 2>/dev/null || { \ +.prereq-build: $(TOPDIR)/include/prereq-build.mk + @$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \ echo "Prerequisite check failed. Use FORCE=1 to override."; \ false; \ } @touch $@ -prereq: .prereq FORCE +.prereq-packages: $(TOPDIR)/include/prereq.mk .pkginfo .config + @$(NO_TRACE_MAKE) -s -C package prereq 2>/dev/null || { \ + echo "Prerequisite check failed. Use FORCE=1 to override."; \ + false; \ + } + @touch $@ + +prereq: .prereq-build .prereq-packages FORCE download: .config FORCE $(MAKE) toolchain/download @@ -96,7 +106,8 @@ download: .config FORCE $(MAKE) target/download ifeq ($(FORCE),) -world: .prereq +.config ./scripts/config/conf ./scripts/config/mconf: .prereq-build +world: .prereq-packages endif world: .config FORCE diff --git a/include/package.mk b/include/package.mk index e0765f7bab..cd1a33c484 100644 --- a/include/package.mk +++ b/include/package.mk @@ -10,6 +10,8 @@ else all: compile endif +include $(INCLUDE_DIR)/prereq.mk + define Build/DefaultTargets ifeq ($(DUMP),) ifeq ($(CONFIG_AUTOREBUILD),y) diff --git a/include/prereq-build.mk b/include/prereq-build.mk new file mode 100644 index 0000000000..a6de9b270a --- /dev/null +++ b/include/prereq-build.mk @@ -0,0 +1,88 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/prereq.mk + +# Required for the toolchain +define Require/working-make + echo 'all: test' > $(TMP_DIR)/check.mk + echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk + echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk + echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk + $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk +endef + +$(eval $(call Require,working-make, \ + Your make version is buggy. Please install GNU make v3.81 or later. \ +)) + +define Require/working-gcc + echo 'int main(int argc, char **argv) { return 0; }' | \ + gcc -x c -o $(TMP_DIR)/a.out - +endef + +$(eval $(call Require,working-gcc, \ + No working GNU C Compiler (gcc) was found on your system. \ +)) + +define Require/working-g++ + echo 'int main(int argc, char **argv) { return 0; }' | \ + g++ -x c++ -o $(TMP_DIR)/a.out -lstdc++ - +endef + +$(eval $(call Require,working-g++, \ + No working GNU C++ Compiler (g++) was found on your system. \ +)) + +define Require/ncurses + echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \ + gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out -lncurses - +endef + +$(eval $(call Require,ncurses, \ + No ncurses development files were not found on your system. \ +)) + + +define Require/zlib + echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ + gcc -include zlib.h -x c -o $(TMP_DIR)/a.out -lz - +endef + +$(eval $(call Require,zlib, \ + No zlib development files were not found on your system. \ +)) + + +$(eval $(call RequireCommand,bison, \ + Please install GNU bison. \ +)) + +$(eval $(call RequireCommand,flex, \ + Please install flex. \ +)) + +$(eval $(call RequireCommand,python, \ + Please install python. \ +)) + +$(eval $(call RequireCommand,unzip, \ + Please install unzip. \ +)) + +$(eval $(call RequireCommand,bzip2, \ + Please install bzip2. \ +)) + +$(eval $(call RequireCommand,patch, \ + Please install patch. \ +)) + +$(eval $(call RequireCommand,perl, \ + Please install perl. \ +)) diff --git a/include/prereq.mk b/include/prereq.mk index e514855a67..c9b82d2947 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -5,14 +5,12 @@ # See /LICENSE for more information. # -include $(TOPDIR)/rules.mk - $(TMP_DIR): mkdir -p $@ prereq: - echo if [ -f $(TMP_DIR)/.prereq-error ]; then \ + echo; \ cat $(TMP_DIR)/.prereq-error; \ echo; \ rm -rf $(TMP_DIR); \ @@ -29,7 +27,7 @@ define Require prereq-$(1): $(TMP_DIR) FORCE echo -n "Checking '$(1)'... " - if $(NO_TRACE_MAKE) -f $(INCLUDE_DIR)/prereq.mk check-$(1) >/dev/null 2>/dev/null; then \ + if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \ echo 'ok.'; \ else \ echo 'failed.'; \ @@ -53,81 +51,3 @@ define RequireCommand $$(eval $$(call Require,$(1),$(2))) endef -# Required for the toolchain -define Require/working-make - echo 'all: test' > $(TMP_DIR)/check.mk - echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk - echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk - echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk - $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk -endef - -$(eval $(call Require,working-make, \ - Your make version is buggy. Please install GNU make v3.81 or later. \ -)) - -define Require/working-gcc - echo 'int main(int argc, char **argv) { return 0; }' | \ - gcc -x c -o $(TMP_DIR)/a.out - -endef - -$(eval $(call Require,working-gcc, \ - No working GNU C Compiler (gcc) was found on your system. \ -)) - -define Require/working-g++ - echo 'int main(int argc, char **argv) { return 0; }' | \ - g++ -x c++ -o $(TMP_DIR)/a.out -lstdc++ - -endef - -$(eval $(call Require,working-g++, \ - No working GNU C++ Compiler (g++) was found on your system. \ -)) - -define Require/ncurses - echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \ - gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out -lncurses - -endef - -$(eval $(call Require,ncurses, \ - No ncurses development files were not found on your system. \ -)) - - -define Require/zlib - echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ - gcc -include zlib.h -x c -o $(TMP_DIR)/a.out -lz - -endef - -$(eval $(call Require,zlib, \ - No zlib development files were not found on your system. \ -)) - - -$(eval $(call RequireCommand,bison, \ - Please install GNU bison. \ -)) - -$(eval $(call RequireCommand,flex, \ - Please install flex. \ -)) - -$(eval $(call RequireCommand,python, \ - Please install python. \ -)) - -$(eval $(call RequireCommand,unzip, \ - Please install unzip. \ -)) - -$(eval $(call RequireCommand,bzip2, \ - Please install bzip2. \ -)) - -$(eval $(call RequireCommand,patch, \ - Please install patch. \ -)) - -$(eval $(call RequireCommand,perl, \ - Please install perl. \ -)) diff --git a/package/Makefile b/package/Makefile index 7a3af2e6f7..629ce88109 100644 --- a/package/Makefile +++ b/package/Makefile @@ -10,13 +10,17 @@ include $(TOPDIR)/rules.mk include $(TOPDIR)/.config include $(TOPDIR)/.pkgdeps -SOURCE_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m)) +PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(package-y) $(package-m)) +DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m)) COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y)) $(STAMP_DIR) $(TARGET_DIR): mkdir -p $@ +%-prereq: $(STAMP_DIR) $(TARGET_DIR) + $(MAKE) -C $(patsubst %-prereq,%,$@) prereq MAKEFLAGS="$(BUILD_MAKEFLAGS)" + %-download: $(STAMP_DIR) $(TARGET_DIR) $(MAKE) -C $(patsubst %-download,%,$@) download MAKEFLAGS="$(BUILD_MAKEFLAGS)" @@ -41,7 +45,8 @@ $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo all: compile clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) -download: $(SOURCE_PACKAGES) +prereq: $(PREREQ_PACKAGES) +download: $(DOWNLOAD_PACKAGES) compile-targets: $(COMPILE_PACKAGES) compile: $(MAKE) -j$(CONFIG_JLEVEL) compile-targets diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 01ea9674c5..e41e1fd798 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -22,8 +22,8 @@ include $(INCLUDE_DIR)/package.mk ifneq ($(DUMP),1) TARGET:=-$(BOARD)-$(KERNEL) -UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version} -LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version} +UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version 2>/dev/null} +LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version 2>/dev/null} else UCLIBC_VERSION:= LIBGCC_VERSION:= -- cgit v1.2.3 From cf807efd13ca47672871d0c50d23274fe34c3114 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 5 Oct 2006 12:39:52 +0000 Subject: speed up package prereq check (only run make on those directories that actually contain prereq checks) git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4927 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/package.mk | 3 ++- include/prereq.mk | 1 + package/Makefile | 2 +- scripts/gen_deps.pl | 8 +++++++- 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'include/prereq.mk') diff --git a/include/package.mk b/include/package.mk index 709bb44155..3f2f7d41be 100644 --- a/include/package.mk +++ b/include/package.mk @@ -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; \ diff --git a/include/prereq.mk b/include/prereq.mk index c9b82d2947..eda7ca35a6 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -22,6 +22,7 @@ prereq: .SILENT: $(TMP_DIR) prereq define Require + export PREREQ_CHECK=1 ifeq ($$(CHECK_$(1)),) prereq: prereq-$(1) diff --git a/package/Makefile b/package/Makefile index b9392c0490..b6165b8567 100644 --- a/package/Makefile +++ b/package/Makefile @@ -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)) diff --git a/scripts/gen_deps.pl b/scripts/gen_deps.pl index 70c07b70a8..e7daf18866 100755 --- a/scripts/gen_deps.pl +++ b/scripts/gen_deps.pl @@ -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"; } -- cgit v1.2.3