From c7a1e6a4da2d341cae16d86db1db3bbf4334ffe2 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 26 Jan 2009 18:36:02 +0000 Subject: Use the paths found by ./configure in the ct-ng.in makefile script and its fragments. /trunk/kconfig/kconfig.mk | 2 1 1 0 +- /trunk/samples/samples.mk | 18 9 9 0 +++++++++--------- /trunk/config/config.mk | 10 5 5 0 +++++----- /trunk/ct-ng.in | 22 13 9 0 +++++++++++++--------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/config/config.mk b/config/config.mk index 038ba72..7581234 100644 --- a/config/config.mk +++ b/config/config.mk @@ -84,11 +84,11 @@ define build_gen_choice_in echo ""; \ for entry in $(5); do \ file="$(4)/$${entry}.in"; \ - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \ + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \ echo "config $(3)_$${_entry}"; \ echo " bool"; \ printf " prompt \"$${entry}"; \ - if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \ + if $(grep) -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \ echo " (EXPERIMENTAL)\""; \ echo " depends on EXPERIMENTAL"; \ else \ @@ -99,7 +99,7 @@ define build_gen_choice_in echo "endchoice"; \ for entry in $(5); do \ file="$(4)/$${entry}.in"; \ - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \ + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \ echo ""; \ echo "if $(3)_$${_entry}"; \ echo "config $(3)"; \ @@ -127,11 +127,11 @@ define build_gen_menu_in echo ""; \ for entry in $(5); do \ file="$(4)/$${entry}.in"; \ - _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \ + _entry=$$(echo "$${entry}" |$(sed) -r -s -e 's/[-.+]/_/g;'); \ echo "menuconfig $(3)_$${_entry}"; \ echo " bool"; \ printf " prompt \"$${entry}"; \ - if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \ + if $(grep) -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \ echo " (EXPERIMENTAL)\""; \ echo " depends on EXPERIMENTAL"; \ else \ diff --git a/ct-ng.in b/ct-ng.in index f86be46..814d3eb 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -6,12 +6,8 @@ # Don't use built-in rules, we know what we're doing MAKEFLAGS += --no-print-directory --no-builtin-rules -# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to -# a truly POSIX-conforming shell, ash in this case. This is not so good -# as we, smart (haha!) developers (as smart we ourselves think we are), -# got used to bashisms, and are enclined to easiness... So force use of -# bash. (Note: this is ugly, but ./configure checks for it). -export SHELL=/bin/bash +# Don't go parallel +.NOTPARALLEL: # This is where ct-ng is: export CT_NG:=$(lastword $(MAKEFILE_LIST)) @@ -26,9 +22,17 @@ export CT_DOC_DIR:=@@CT_DOCDIR@@ # This is crosstool-NG version string export CT_VERSION:=@@CT_VERSION@@ -# Don't go parallel -.NOTPARALLEL: +# Paths found by ./configure +include $(CT_LIB_DIR)/paths.mk + +# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to +# a truly POSIX-conforming shell, ash in this case. This is not so good +# as we, smart (haha!) developers (as smart we ourselves think we are), +# got used to bashisms, and are enclined to easiness... So force use of +# bash. +export SHELL=$(bash) +# Make the restart/stop steps availabe to scripts/crostool-NG.sh export CT_STOP:=$(STOP) export CT_RESTART:=$(RESTART) @@ -123,7 +127,7 @@ build: .config $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh build.%: - $(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + $(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') PHONY += tarball #tarball: diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index ae507ca..e3fbd2b 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -131,7 +131,7 @@ endef %.dep: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk $(check_kconfig_dir) @$(ECHO) " DEP $@" - $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |sed -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@ + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@ # Build C files %.o: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk diff --git a/samples/samples.mk b/samples/samples.mk index 29b7dbe..c8befba 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -39,7 +39,7 @@ $(patsubst %,show-%,$(CT_SAMPLES)): # print the list of all available samples PHONY += list-samples list-samples: .FORCE - @echo $(CT_SAMPLES) |sed -r -e 's/ /\n/g;' |sort + @echo $(CT_SAMPLES) |$(sed) -r -e 's/ /\n/g;' |sort wiki-samples: $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES) @@ -76,7 +76,7 @@ $(CT_SAMPLES): echo ; \ echo '***********************************************************'; \ ) - $(SILENT)if grep -E '^CT_EXPERIMENTAL=y$$' .config >/dev/null 2>&1; then \ + $(SILENT)if $(grep) -E '^CT_EXPERIMENTAL=y$$' .config >/dev/null 2>&1; then \ echo ; \ echo 'WARNING! This sample may enable experimental features.'; \ echo ' Please be sure to review the configuration prior'; \ @@ -97,12 +97,12 @@ $(CT_SAMPLES): define build_sample @$(ECHO) ' CONF $(1)' $(SILENT)cp $(call sample_dir,$(1))/crosstool.config .config - $(SILENT)sed -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(2)":;' .config - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config - $(SILENT)sed -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config - $(SILENT)sed -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config + $(SILENT)$(sed) -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(2)":;' .config + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config + $(SILENT)$(sed) -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config + $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config $(SILENT)$(MAKE) -rf $(CT_NG) V=0 oldconfig @$(ECHO) ' BUILD $(1)' $(SILENT)$(MAKE) -rf $(CT_NG) V=0 build @@ -131,5 +131,5 @@ build-all: $(patsubst %,build-%,$(CT_SAMPLES)) # Build all samples, overiding the number of // jobs per sample build-all.%: - $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') + $(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;') -- cgit v0.10.2-6-g49f6