Makefile.in
changeset 1156 b8e4a98bbdf3
parent 1154 0f15f05af399
child 1158 4e0970ec62a0
     1.1 --- a/Makefile.in	Sun Jan 25 22:59:55 2009 +0000
     1.2 +++ b/Makefile.in	Mon Jan 26 22:43:08 2009 +0000
     1.3 @@ -1,7 +1,37 @@
     1.4  # Makefile.in for building crosstool-NG
     1.5  # This file serves as source for the ./configure operation
     1.6  
     1.7 -MAKEFLAGS += --no-print-directory --no-builtin-rules
     1.8 +# This series of test is here because GNU make 3.81 will *not* use MAKEFLAGS
     1.9 +# to set additional flags in the current Makfile ( see:
    1.10 +# http://savannah.gnu.org/bugs/?20501 ), although the make manual says it
    1.11 +# should ( see: http://www.gnu.org/software/make/manual/make.html#Options_002fRecursion )
    1.12 +# so we have to work it around by calling ourselves back if needed
    1.13 +
    1.14 +# So why do we need not to use the built rules and variables? Because we
    1.15 +# need to generate scripts/crosstool-NG.sh from scripts/crosstool-NG.sh.in
    1.16 +# and there is a built-in implicit rule '%.sh:' that has neither a pre-requisite
    1.17 +# nor a command associated, and that built-in implicit rule takes precedence
    1.18 +# over our non-built-in implicit rule '%: %.in', below.
    1.19 +
    1.20 +# CT_MAKEFLAGS will be used later, below...
    1.21 +
    1.22 +# Do not print directories as we descend into them
    1.23 +ifeq ($(filter --no-print-directory,$(MAKEFLAGS)),)
    1.24 +CT_MAKEFLAGS += --no-print-directory
    1.25 +endif
    1.26 +
    1.27 +# Use neither builtin rules, nor builtin variables
    1.28 +# Note: dual test, because if -R and -r are given on the command line
    1.29 +# (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding
    1.30 +# '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' )
    1.31 +ifeq ($(filter Rr,$(MAKEFLAGS)),)
    1.32 +ifeq ($(filter -Rr,$(MAKEFLAGS)),)
    1.33 +CT_MAKEFLAGS += -Rr
    1.34 +endif # No -Rr
    1.35 +endif # No Rr
    1.36 +
    1.37 +# Remove any suffix rules
    1.38 +.SUFFIXES:
    1.39  
    1.40  all: Makefile build
    1.41  
    1.42 @@ -42,6 +72,17 @@
    1.43  ###############################################################################
    1.44  # Global make rules
    1.45  
    1.46 +# If any extra MAKEFLAGS were added, re-run ourselves
    1.47 +# See top of file for an explanation of why this is needed...
    1.48 +ifneq ($(strip $(CT_MAKEFLAGS)),)
    1.49 +
    1.50 +MAKEFLAGS += $(CT_MAKEFLAGS)
    1.51 +build install clean distclean uninstall:
    1.52 +	@$(MAKE) $@
    1.53 +
    1.54 +else
    1.55 +# There were no additional MAKEFLAGS to add, do the job
    1.56 +
    1.57  TARGETS := bin lib doc man
    1.58  
    1.59  build: $(patsubst %,build-%,$(TARGETS))
    1.60 @@ -62,7 +103,7 @@
    1.61  #--------------------------------------
    1.62  # Build rules
    1.63  
    1.64 -build-bin: ct-ng
    1.65 +build-bin: ct-ng scripts/crosstool-NG.sh
    1.66  
    1.67  build-lib: paths.mk
    1.68  
    1.69 @@ -83,6 +124,7 @@
    1.70  	           -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    1.71  	           -e 's,@@CT_DATE@@,$(DATE),g;'        \
    1.72  	           -e 's,@@CT_make@@,$(make),g;'        \
    1.73 +	           -e 's,@@CT_bash@@,$(bash),g;'        \
    1.74  	           $@.in >$@
    1.75  
    1.76  # We create a script fragment that is parseable from inside a Makefile,
    1.77 @@ -127,6 +169,8 @@
    1.78  real-install:
    1.79  	@echo "  CHMOD  'ct-ng'"
    1.80  	@chmod a+x ct-ng
    1.81 +	@echo "  CHMOD  'scripts/crosstool-NG.sh'"
    1.82 +	@chmod a+x scripts/crosstool-NG.sh
    1.83  
    1.84  real-uninstall:
    1.85  	@true
    1.86 @@ -206,3 +250,5 @@
    1.87  	@rm -f "$(DESTDIR)$(MANDIR)/ct-ng.1"{,.gz}
    1.88  
    1.89  endif # Not --local
    1.90 +
    1.91 +endif # No extra MAKEFLAGS were added