diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-01-26 22:43:08 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-01-26 22:43:08 +0000 |
commit | 6912bc6a2c942da602796bd4dfe45cbe60907ef9 (patch) | |
tree | 1eaa90554ac5685c748049abd16c8b9b25fdb0f3 /Makefile.in | |
parent | c7a1e6a4da2d341cae16d86db1db3bbf4334ffe2 (diff) | |
download | crosstool-ng-6912bc6a2c942da602796bd4dfe45cbe60907ef9.tar.gz crosstool-ng-6912bc6a2c942da602796bd4dfe45cbe60907ef9.tar.bz2 crosstool-ng-6912bc6a2c942da602796bd4dfe45cbe60907ef9.zip |
Finally used the discovered paths from ./configure in scripts/crosstool-NG.sh:
- fix Makefile to really, really not used built-in rules and variables
- have scripts/crosstool-NG.sh generated from scripts/crosstool-NG.sh.in
- create a bin-overide directory ( in ${CT_WORK_DIR}/bin ) that contains shell wrappers to the actual discovered tools
/trunk/scripts/crosstool-NG.sh.in | 27 23 4 0 +++++++++++++++++++++---
/trunk/Makefile.in | 50 48 2 0 +++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 71 insertions(+), 6 deletions(-)
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index ea7775e0..30e97a0f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,37 @@ # Makefile.in for building crosstool-NG # This file serves as source for the ./configure operation -MAKEFLAGS += --no-print-directory --no-builtin-rules +# This series of test is here because GNU make 3.81 will *not* use MAKEFLAGS +# to set additional flags in the current Makfile ( see: +# http://savannah.gnu.org/bugs/?20501 ), although the make manual says it +# should ( see: http://www.gnu.org/software/make/manual/make.html#Options_002fRecursion ) +# so we have to work it around by calling ourselves back if needed + +# So why do we need not to use the built rules and variables? Because we +# need to generate scripts/crosstool-NG.sh from scripts/crosstool-NG.sh.in +# and there is a built-in implicit rule '%.sh:' that has neither a pre-requisite +# nor a command associated, and that built-in implicit rule takes precedence +# over our non-built-in implicit rule '%: %.in', below. + +# CT_MAKEFLAGS will be used later, below... + +# Do not print directories as we descend into them +ifeq ($(filter --no-print-directory,$(MAKEFLAGS)),) +CT_MAKEFLAGS += --no-print-directory +endif + +# Use neither builtin rules, nor builtin variables +# Note: dual test, because if -R and -r are given on the command line +# (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding +# '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' ) +ifeq ($(filter Rr,$(MAKEFLAGS)),) +ifeq ($(filter -Rr,$(MAKEFLAGS)),) +CT_MAKEFLAGS += -Rr +endif # No -Rr +endif # No Rr + +# Remove any suffix rules +.SUFFIXES: all: Makefile build @@ -42,6 +72,17 @@ endif ############################################################################### # Global make rules +# If any extra MAKEFLAGS were added, re-run ourselves +# See top of file for an explanation of why this is needed... +ifneq ($(strip $(CT_MAKEFLAGS)),) + +MAKEFLAGS += $(CT_MAKEFLAGS) +build install clean distclean uninstall: + @$(MAKE) $@ + +else +# There were no additional MAKEFLAGS to add, do the job + TARGETS := bin lib doc man build: $(patsubst %,build-%,$(TARGETS)) @@ -62,7 +103,7 @@ uninstall: real-uninstall #-------------------------------------- # Build rules -build-bin: ct-ng +build-bin: ct-ng scripts/crosstool-NG.sh build-lib: paths.mk @@ -83,6 +124,7 @@ docs/ct-ng.1.gz: docs/ct-ng.1 -e 's,@@CT_VERSION@@,$(VERSION),g;' \ -e 's,@@CT_DATE@@,$(DATE),g;' \ -e 's,@@CT_make@@,$(make),g;' \ + -e 's,@@CT_bash@@,$(bash),g;' \ $@.in >$@ # We create a script fragment that is parseable from inside a Makefile, @@ -127,6 +169,8 @@ ifeq ($(strip $(LOCAL)),1) real-install: @echo " CHMOD 'ct-ng'" @chmod a+x ct-ng + @echo " CHMOD 'scripts/crosstool-NG.sh'" + @chmod a+x scripts/crosstool-NG.sh real-uninstall: @true @@ -206,3 +250,5 @@ uninstall-man: @rm -f "$(DESTDIR)$(MANDIR)/ct-ng.1"{,.gz} endif # Not --local + +endif # No extra MAKEFLAGS were added |