X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=Makefile.tpl;h=de5291f54de37058b732b8cb05af5977e6acbf1e;hb=b9e5d8e53056fba59743669373483e71271a49cd;hp=6ccb817f2ec92979e6f373f253d5af7d8a15ae19;hpb=3866be5d4e427b4d114ad3b145496b8125c0fb0c;p=deliverable%2Fbinutils-gdb.git diff --git a/Makefile.tpl b/Makefile.tpl index 6ccb817f2e..de5291f54d 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -1,4 +1,4 @@ -[+ AutoGen5 template +[+ AutoGen5 template -*- Mode: Makefile -*- in +] @@ -72,7 +72,8 @@ includedir = @includedir@ oldincludedir = @oldincludedir@ infodir = @infodir@ mandir = @mandir@ -gxx_include_dir=@gxx_include_dir@ +gxx_include_dir = @gxx_include_dir@ +libstdcxx_incdir = @libstdcxx_incdir@ tooldir = @tooldir@ build_tooldir = @build_tooldir@ @@ -112,7 +113,7 @@ INSTALL_DATA = $(INSTALL) -m 644 AS = @AS@ AR = @AR@ AR_FLAGS = rc -CC = cc +CC = @CC@ # Special variables passed down in EXTRA_GCC_FLAGS. They are defined # here so that they can be overridden by Makefile fragments. @@ -120,9 +121,8 @@ BUILD_CC = $(CC_FOR_BUILD) BUILD_PREFIX = @BUILD_PREFIX@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ -# These flag values are normally overridden by the configure script. -CFLAGS = -g -CXXFLAGS = -g -O2 +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ LDFLAGS = LIBCFLAGS = $(CFLAGS) @@ -137,7 +137,7 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) PICFLAG = PICFLAG_FOR_TARGET = -CXX = c++ +CXX = @CXX@ # Use -O2 to stress test the compiler. LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates @@ -222,14 +222,18 @@ TARGET_SUBDIR = @target_subdir@ BUILD_CONFIGDIRS = libiberty BUILD_SUBDIR = @build_subdir@ -# This is set by the configure script to the arguments to use when configuring -# directories built for the target. -TARGET_CONFIGARGS = @target_configargs@ - # This is set by the configure script to the arguments to use when configuring # directories built for the build system. BUILD_CONFIGARGS = @build_configargs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ + +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ + # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared # was used. SET_LIB_PATH = @SET_LIB_PATH@ @@ -256,7 +260,9 @@ REALLY_SET_LIB_PATH = \ FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ CC_FOR_TARGET = @CC_FOR_TARGET@ CXX_FOR_TARGET = @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ # If GCC_FOR_TARGET is not overriden on the command line, then this @@ -439,7 +445,8 @@ BASE_FLAGS_TO_PASS = \ # so we pass these variables down unchanged. They must not contain # single nor double quotes. RECURSE_FLAGS = \ - CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' + CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ + RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ # Flags to pass down to most sub-makes, in which we're building with # the host environment. @@ -522,32 +529,24 @@ EXTRA_GCC_FLAGS = \ GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) -# This is a list of the targets for all of the modules which are compiled -# using the build machine's native compiler. Configure edits the second -# macro for build!=host builds. -ALL_BUILD_MODULES_LIST = \ - all-build-libiberty -ALL_BUILD_MODULES = @all_build_modules@ - -# This is a list of the configure targets for all of the modules which -# are compiled using the native tools. -CONFIGURE_BUILD_MODULES = \ - configure-build-libiberty - -# This is a list of the configure targets for all of the modules which -# are compiled using the target tools. -CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\ - configure-target-[+module+] [+ ENDFOR target_modules +] - -configure-target: $(CONFIGURE_TARGET_MODULES) +configure-host: @configure_host_modules@ +configure-target: @configure_target_modules@ # This is a list of the targets for which we can do a clean-{target}. -CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELIF with_x +][+ ELSE clean +]\ - clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +] +CLEAN_MODULES =[+ + FOR host_modules +][+ + IF (not (or (exist? "no_clean") (exist? "with_x"))) +] \ + clean-[+module+][+ + ENDIF no_clean +][+ + ENDFOR host_modules +] # All of the target modules that can be cleaned -CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\ - clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +] +CLEAN_TARGET_MODULES =[+ + FOR target_modules +][+ + IF (not (exist? "no_clean")) +] \ + clean-target-[+module+][+ + ENDIF no_clean +][+ + ENDFOR target_modules +] # All of the x11 modules that can be cleaned CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\ @@ -560,6 +559,7 @@ all.normal: @all_build_modules@ \ @all_host_modules@ \ @all_target_modules@ +all-host: @all_host_modules@ all-target: @all_target_modules@ # Do a target for all the subdirectories. A ``make do-X'' will do a @@ -628,8 +628,9 @@ info: do-info installcheck: do-installcheck dvi: do-dvi -# Make sure makeinfo is built before we do a `make info'. -do-info: all-texinfo +# Make sure makeinfo is built before we do a `make info', if we're +# in fact building texinfo. +do-info: maybe-all-texinfo install-info: do-install-info dir.info s=`cd $(srcdir); ${PWD}`; export s; \ @@ -728,7 +729,7 @@ mail-report-with-warnings.log: warning.log # Installation targets. -.PHONY: install uninstall source-vault binary-vault vault-install +.PHONY: install uninstall install: installdirs @install_host_modules@ @install_target_modules@ install-target: @install_target_modules@ @@ -736,21 +737,6 @@ install-target: @install_target_modules@ uninstall: @echo "the uninstall target is not supported in this tree" -source-vault: - $(MAKE) -f ./release/Build-A-Release \ - host=$(host_alias) source-vault - -binary-vault: - $(MAKE) -f ./release/Build-A-Release \ - host=$(host_alias) target=$(target_alias) - -vault-install: - @if [ -f ./release/vault-install ] ; then \ - ./release/vault-install $(host_alias) $(target_alias) ; \ - else \ - true ; \ - fi - .PHONY: install.all install.all: install-no-fixedincludes @if [ -f ./gcc/Makefile ] ; then \ @@ -768,49 +754,46 @@ install.all: install-no-fixedincludes install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \ @install_target_modules@ gcc-no-fixedincludes -# Install the gcc headers files, but not the fixed include files, -# which Cygnus is not allowed to distribute. This rule is very -# dependent on the workings of the gcc Makefile.in. -.PHONY: gcc-no-fixedincludes -gcc-no-fixedincludes: - @if [ -f ./gcc/Makefile ]; then \ - rm -rf gcc/tmp-include; \ - mv gcc/include gcc/tmp-include 2>/dev/null; \ - mkdir gcc/include; \ - cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ - touch gcc/stmp-fixinc gcc/include/fixed; \ - rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}` ; export s; \ - $(SET_LIB_PATH) \ - (cd ./gcc; \ - $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ - rm -rf gcc/include; \ - mv gcc/tmp-include gcc/include 2>/dev/null; \ - else true; fi +### other supporting targets -# These rules are used to build the modules which are built with the -# build machine's native compiler. -[+ FOR build_modules +] -.PHONY: all-build-[+module+] -all-build-[+module+]: - @if [ -f ./[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all); \ - else \ - true; \ +MAKEDIRS= \ + $(DESTDIR)$(prefix) \ + $(DESTDIR)$(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) + +dir.info: do-install-info + if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ + $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ + mv -f dir.info.new dir.info ; \ + else true ; \ fi -.PHONY: configure-build-[+module+] -configure-build-[+module+]: - @if [ ! -d $(BUILD_SUBDIR) ]; then \ - true; \ - elif [ -f $(BUILD_SUBDIR)/[+module+]/Makefile ] ; then \ - true; \ - elif echo " $(BUILD_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \ - if [ -d $(srcdir)/[+module+] ]; then \ - [ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\ +dist: + @echo "Building a full distribution of this tree isn't done" + @echo "via 'make dist'. Check out the etc/ subdirectory" + +etags tags: TAGS + +# Right now this just builds TAGS in each subdirectory. emacs19 has the +# ability to use several tags files at once, so there is probably no need +# to combine them into one big TAGS file (like CVS 1.3 does). We could +# (if we felt like it) have this Makefile write a piece of elisp which +# the user could load to tell emacs19 where all the TAGS files we just +# built are. +TAGS: do-TAGS + + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- +[+ FOR build_modules +] +.PHONY: configure-build-[+module+] maybe-configure-build-[+module+] +maybe-configure-build-[+module+]: +configure-build-[+module+]: $(BUILD_SUBDIR)/[+module+]/Makefile +@build_prefix@$(BUILD_SUBDIR)/[+module+]/Makefile: config.status + @[ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ AR="$(AR_FOR_BUILD)"; export AR; \ @@ -861,49 +844,75 @@ configure-build-[+module+]: srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ fi; \ - if [ -f $${libsrcdir}/configure ] ; then \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)"; \ - else \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)"; \ - fi || exit 1; \ - if [ -f skip-this-dir ] ; then \ - sh skip-this-dir; \ - rm -f skip-this-dir; \ - cd ..; rmdir [+module+] || true; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 + +.PHONY: all-build-[+module+] maybe-all-build-[+module+] +maybe-all-build-[+module+]: +all-build-[+module+]: configure-build-[+module+] + @r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) [+ ENDFOR build_modules +] -# These rules are used to build the modules which use FLAGS_TO_PASS. To -# build a target all-X means to cd to X and make all. +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- [+ FOR host_modules +] -.PHONY: all-[+module+] -all-[+module+]: - @dir=[+module+]; \ - if [ -f ./[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ +.PHONY: configure-[+module+] maybe-configure-[+module+] +maybe-configure-[+module+]: +configure-[+module+]: [+module+]/Makefile + +[+module+]/Makefile: config.status + @[ -d [+module+] ] || mkdir [+module+]; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + fi; \ + echo Configuring in [+module+]; \ + cd [+module+] || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-[+module+] maybe-all-[+module+] +maybe-all-[+module+]: +all-[+module+]: configure-[+module+] + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ IF with_x +] $(X11_FLAGS_TO_PASS)[+ - ENDIF with_x +] all); \ - else \ - true; \ - fi + ENDIF with_x +] all) [+ IF no_check +] .PHONY: check-[+module+] @@ -913,8 +922,6 @@ check-[+module+]: # This module is only tested in a native toolchain. check-[+module+]: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - dir=[+module+]; \ - if [ -f ./[+module+]/Makefile ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -922,86 +929,68 @@ check-[+module+]: IF with_x +] $(X11_FLAGS_TO_PASS)[+ ENDIF with_x +] check); \ - else \ - true; \ - fi; \ fi [+ ELSE check +] .PHONY: check-[+module+] check-[+module+]: - @dir=[+module+]; \ - if [ -f ./[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ IF with_x +] $(X11_FLAGS_TO_PASS)[+ - ENDIF with_x +] check); \ - else \ - true; \ - fi + ENDIF with_x +] check) [+ ENDIF no_check +] [+ IF no_install +] -.PHONY: install-[+module+] +.PHONY: install-[+module+] maybe-install-[+module+] +maybe-install-[+module+]: install-[+module+]: [+ ELSE install +] -.PHONY: install-[+module+] +.PHONY: install-[+module+] maybe-install-[+module+] +maybe-install-[+module+]: install-[+module+]: installdirs - @dir=[+module+]; \ - if [ -f ./[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ IF with_x +] $(X11_FLAGS_TO_PASS)[+ - ENDIF with_x +] install); \ - else \ - true; \ - fi + ENDIF with_x +] install) [+ ENDIF no_install +] [+ ENDFOR host_modules +] -# These rules are used to build the modules which are built with the target -# tools. To make foo-X means to cd to X and make foo. +# --------------------------------------- +# Modules which run on the target machine +# --------------------------------------- [+ FOR target_modules +] -.PHONY: configure-target-[+module+] -configure-target-[+module+]: - @if [ -d $(TARGET_SUBDIR)/[+module+] ]; then \ - r=`${PWD}`; export r; \ - $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/tmpmulti.out 2> /dev/null; \ - if [ -s $(TARGET_SUBDIR)/[+module+]/tmpmulti.out ]; then \ - if [ -f $(TARGET_SUBDIR)/[+module+]/multilib.out ]; then \ - if cmp $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/tmpmulti.out > /dev/null; then \ - rm -f $(TARGET_SUBDIR)/[+module+]/tmpmulti.out; \ - else \ - echo "Multilibs changed for [+module+], reconfiguring"; \ - rm -f $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/Makefile; \ - mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \ - fi; \ - else \ - mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \ - fi; \ - fi; \ - fi; exit 0 # break command into two pieces - @dir=[+module+] ; \ - if [ ! -d $(TARGET_SUBDIR) ]; then \ - true; \ - elif [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \ - true; \ - elif echo " $(TARGET_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \ - if [ -d $(srcdir)/[+module+] ]; then \ - [ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\ +.PHONY: configure-target-[+module+] maybe-configure-target-[+module+] +maybe-configure-target-[+module+]: +configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/Makefile + +# Don't manually override CC_FOR_TARGET at make time; get it set right +# at configure time. Otherwise multilibs may be wrong. +$(TARGET_SUBDIR)/[+module+]/multilib.out: maybe-all-gcc + @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\ + r=`${PWD}`; export r; \ + echo "Configuring multilibs for [+module+]"; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/multilib.out 2> /dev/null + +$(TARGET_SUBDIR)/[+module+]/Makefile: config.status $(TARGET_SUBDIR)/[+module+]/multilib.out + @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ AR="$(AR_FOR_TARGET)"; export AR; \ AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \[+ + IF raw_cxx +] + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ + ELSE normal_cxx +] + CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ + ENDIF raw_cxx +] CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ @@ -1045,43 +1034,24 @@ configure-target-[+module+]: srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ fi; \ - if [ -f $${libsrcdir}/configure ] ; then \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)"; \ - else \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)"; \ - fi || exit 1; \ - if [ -f skip-this-dir ] ; then \ - sh skip-this-dir; \ - rm -f skip-this-dir; \ - cd ..; rmdir [+module+] || true; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi - -.PHONY: all-target-[+module+] -all-target-[+module+]: - @dir=[+module+] ; \ - if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-[+module+] maybe-all-target-[+module+] +maybe-all-target-[+module+]: +all-target-[+module+]: configure-target-[+module+] + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/[+module+]; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ - else \ - true; \ - fi + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ + IF raw_cxx + +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ + ENDIF raw_cxx + +] all) [+ IF no_check +] # Dummy target for uncheckable module. .PHONY: check-target-[+module+] @@ -1089,43 +1059,99 @@ check-target-[+module+]: [+ ELSE check +] .PHONY: check-target-[+module+] check-target-[+module+]: - @dir=[+module+] ; \ - if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/[+module+]; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ - else \ - true; \ - fi + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ + IF raw_cxx + +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ + ENDIF raw_cxx + +] check) [+ ENDIF no_check +] -[+ IF no_install +][+ ELSE install +]\ -.PHONY: install-target-[+module+] +[+ IF no_install +] +.PHONY: install-target-[+module+] maybe-install-target-[+module+] +maybe-install-target-[+module+]: +# Dummy target for uninstallable. +install-target-[+module+]: +[+ ELSE install +] +.PHONY: install-target-[+module+] maybe-install-target-[+module+] +maybe-install-target-[+module+]: install-target-[+module+]: installdirs - @dir=[+module+] ; \ - if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \ - r=`${PWD}`; export r; \ + @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/[+module+]; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ - else \ - true; \ - fi + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) [+ ENDIF no_install +] [+ ENDFOR target_modules +] +# ---------- +# GCC module +# ---------- + +# Unfortunately, while gcc _should_ be a host module, +# libgcc is a target module, and gen* programs are +# build modules. So GCC is a sort of hybrid. + # gcc is the only module which uses GCC_FLAGS_TO_PASS. -.PHONY: all-gcc -all-gcc: - @if [ -f ./gcc/Makefile ] ; then \ +.PHONY: configure-gcc maybe-configure-gcc +maybe-configure-gcc: +configure-gcc: gcc/Makefile + +gcc/Makefile: config.status + @[ -d gcc ] || mkdir gcc; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + fi; \ + echo Configuring in gcc; \ + cd gcc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that +# causes trouble. This wart will be fixed eventually by moving +# the bootstrap behavior to this file. +.PHONY: all-gcc maybe-all-gcc +maybe-all-gcc: +all-gcc: configure-gcc + @if [ -f gcc/stage_last ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ + (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ else \ - true; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ fi # Building GCC uses some tools for rebuilding "source" files @@ -1139,7 +1165,7 @@ all-gcc: # in parallel. # .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap -bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap +bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc @r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ @@ -1192,19 +1218,22 @@ check-gcc: true; \ fi -.PHONY: check-c++ -check-c++: +.PHONY: check-gcc-c++ +check-gcc-c++: @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD}`; export r; \ s=`cd $(srcdir); ${PWD}`; export s; \ $(SET_LIB_PATH) \ (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ - $(MAKE) check-target-libstdc++-v3; \ else \ true; \ - fi + fi + +.PHONY: check-c++ +check-c++: check-target-libstdc++-v3 check-gcc-c++ -.PHONY: install-gcc +.PHONY: install-gcc maybe-install-gcc +maybe-install-gcc: install-gcc: @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD}`; export r; \ @@ -1215,127 +1244,156 @@ install-gcc: true; \ fi -ALL_GCC = all-gcc -ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss -ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3 - -# This is a list of inter-dependencies among modules. -all-autoconf: all-m4 all-texinfo -all-automake: all-m4 all-texinfo -all-bfd: all-libiberty all-intl -all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl -all-bison: all-texinfo -configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads -all-dejagnu: all-tcl all-expect all-tk -all-diff: all-libiberty -configure-target-examples: $(ALL_GCC_C) -all-expect: all-tcl all-tk -all-fileutils: all-libiberty -all-flex: all-libiberty all-bison all-byacc -all-gas: all-libiberty all-opcodes all-bfd all-intl -all-gcc: all-libiberty all-bison all-byacc all-binutils all-gas all-ld all-zlib -all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib -GDB_TK = @GDB_TK@ -all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK) -configure-target-gperf: $(ALL_GCC_CXX) -all-target-gperf: all-target-libiberty all-target-libstdc++-v3 -all-gprof: all-libiberty all-bfd all-opcodes all-intl -all-grep: all-libiberty -all-gzip: all-libiberty -all-hello: all-libiberty -all-itcl: all-tcl all-tk -all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl -configure-target-libgloss: $(ALL_GCC) -all-target-libgloss: configure-target-newlib -all-libgui: all-tcl all-tk all-itcl -configure-target-libffi: $(ALL_GCC_C) -configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi -all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi -configure-target-libstdc++-v3: $(ALL_GCC_C) -all-target-libstdc++-v3: all-target-libiberty -configure-target-libf2c: $(ALL_GCC_C) -all-target-libf2c: all-target-libiberty -configure-target-libobjc: $(ALL_GCC_C) -all-target-libobjc: all-target-libiberty -all-m4: all-libiberty all-texinfo -all-make: all-libiberty -configure-target-newlib: $(ALL_GCC) -configure-target-libtermcap: $(ALL_GCC_C) -all-opcodes: all-bfd all-libiberty -all-patch: all-libiberty -all-prms: all-libiberty -configure-target-qthreads: $(ALL_GCC_C) -all-recode: all-libiberty -all-sed: all-libiberty -all-send-pr: all-prms -all-sid: all-tcl all-tk -all-sim: all-libiberty all-bfd all-opcodes all-readline -all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui -all-tar: all-libiberty -all-tclX: all-tcl all-tk -all-tk: all-tcl -all-texinfo: all-libiberty -all-tix: all-tcl all-tk -configure-target-winsup: $(ALL_GCC_C) -all-target-winsup: all-target-libiberty all-target-libtermcap -all-uudecode: all-libiberty -configure-target-zlib: $(ALL_GCC_C) -all-fastjar: all-zlib all-libiberty -configure-target-fastjar: configure-target-zlib -all-target-fastjar: all-target-zlib all-target-libiberty -configure-target-libiberty: $(ALL_GCC_C) -install-gdb: install-tcl install-tk install-itcl install-tix install-libgui -install-sid: install-tcl install-tk +# Install the gcc headers files, but not the fixed include files, +# which Cygnus is not allowed to distribute. This rule is very +# dependent on the workings of the gcc Makefile.in. +.PHONY: gcc-no-fixedincludes +gcc-no-fixedincludes: + @if [ -f ./gcc/Makefile ]; then \ + rm -rf gcc/tmp-include; \ + mv gcc/include gcc/tmp-include 2>/dev/null; \ + mkdir gcc/include; \ + cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ + touch gcc/stmp-fixinc gcc/include/fixed; \ + rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}` ; export s; \ + $(SET_LIB_PATH) \ + (cd ./gcc; \ + $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + rm -rf gcc/include; \ + mv gcc/tmp-include gcc/include 2>/dev/null; \ + else true; fi +# -------------------------------------- +# Dependencies between different modules +# -------------------------------------- + +# There are two types of dependencies here: 'hard' dependencies, where one +# module simply won't build without the other; and 'soft' dependencies, where +# if the depended-on module is missing, the depending module will do without +# or find a substitute somewhere (perhaps installed). Soft dependencies +# are specified by depending on a 'maybe-' target. If you're not sure, +# it's safer to use a soft dependency. + +# Host modules specific to gcc. +# GCC needs to identify certain tools. +configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex +all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib +# This is a slightly kludgy method of getting dependencies on +# all-build-libiberty correct; it would be better to build it every time. +all-gcc: maybe-all-build-libiberty +all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib + +# Host modules specific to gdb. +# GDB needs to know that the simulator is being built. +configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim +GDB_TK = @GDB_TK@ +all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) +install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui +configure-libgui: maybe-configure-tcl maybe-configure-tk +all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl + +# Host modules specific to binutils. +configure-bfd: configure-libiberty +all-bfd: maybe-all-libiberty maybe-all-intl +all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl # We put install-opcodes before install-binutils because the installed # binutils might be on PATH, and they might need the shared opcodes # library. -install-binutils: install-opcodes - +install-binutils: maybe-install-opcodes +all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl +all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl +all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl +all-opcodes: maybe-all-bfd maybe-all-libiberty + +# Other host modules in the 'src' repository. +all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk +configure-expect: maybe-configure-tcl maybe-configure-tk +all-expect: maybe-all-tcl maybe-all-tk +configure-itcl: maybe-configure-tcl maybe-configure-tk +all-itcl: maybe-all-tcl maybe-all-tk # We put install-tcl before install-itcl because itcl wants to run a # program on installation which uses the Tcl libraries. -install-itcl: install-tcl - -# This is a slightly kludgy method of getting dependencies on -# all-build-libiberty correct; it would be better to build it every time. -all-gcc: @all_build_modules@ - -# Dependencies of all-build-foo on configure-build-foo. -all-build-libiberty: configure-build-libiberty - -# Dependencies of all-target-foo on configure-target-foo. -[+ FOR target_modules +]all-target-[+module+]: configure-target-[+module+] -[+ ENDFOR target_modules +] - -### other supporting targets +install-itcl: maybe-install-tcl +all-sid: maybe-all-tcl maybe-all-tk +install-sid: maybe-install-tcl maybe-install-tk +all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb +configure-tk: maybe-configure-tcl +all-tk: maybe-all-tcl +configure-tix: maybe-configure-tcl maybe-configure-tk +all-tix: maybe-all-tcl maybe-all-tk +all-texinfo: maybe-all-libiberty + +# Other host modules. Warning, these are not well tested. +all-autoconf: maybe-all-m4 maybe-all-texinfo +all-automake: maybe-all-m4 maybe-all-texinfo +all-bison: maybe-all-texinfo +all-diff: maybe-all-libiberty +all-fastjar: maybe-all-zlib maybe-all-libiberty +all-fileutils: maybe-all-libiberty +all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc +all-grep: maybe-all-libiberty +all-gzip: maybe-all-libiberty +all-hello: maybe-all-libiberty +all-m4: maybe-all-libiberty maybe-all-texinfo +all-make: maybe-all-libiberty +all-patch: maybe-all-libiberty +all-prms: maybe-all-libiberty +all-recode: maybe-all-libiberty +all-sed: maybe-all-libiberty +all-send-pr: maybe-all-prms +all-snavigator: maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-db maybe-all-grep maybe-all-libgui +all-tar: maybe-all-libiberty +all-uudecode: maybe-all-libiberty + +ALL_GCC = maybe-all-gcc +ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss +ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 + +# Target modules specific to gcc. +configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads +configure-target-fastjar: maybe-configure-target-zlib +all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty +configure-target-libf2c: $(ALL_GCC_C) +all-target-libf2c: maybe-all-target-libiberty +configure-target-libffi: $(ALL_GCC_C) +configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi +all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi +configure-target-libobjc: $(ALL_GCC_C) +all-target-libobjc: maybe-all-target-libiberty +configure-target-libstdc++-v3: $(ALL_GCC_C) +all-target-libstdc++-v3: maybe-all-target-libiberty +configure-target-zlib: $(ALL_GCC_C) -MAKEDIRS= \ - $(DESTDIR)$(prefix) \ - $(DESTDIR)$(exec_prefix) -.PHONY: installdirs -installdirs: mkinstalldirs - $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) +# Target modules in the 'src' repository. +configure-target-examples: $(ALL_GCC_C) +configure-target-libgloss: $(ALL_GCC) +all-target-libgloss: maybe-configure-target-newlib +configure-target-libiberty: $(ALL_GCC_C) +configure-target-libtermcap: $(ALL_GCC_C) +configure-target-newlib: $(ALL_GCC) +configure-target-rda: $(ALL_GCC_C) +configure-target-winsup: $(ALL_GCC_C) +all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap -dir.info: do-install-info - if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ - $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ - mv -f dir.info.new dir.info ; \ - else true ; \ - fi +# Other target modules. Warning, these are not well tested. +configure-target-gperf: $(ALL_GCC_CXX) +all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 +configure-target-qthreads: $(ALL_GCC_C) -dist: - @echo "Building a full distribution of this tree isn't done" - @echo "via 'make dist'. Check out the etc/ subdirectory" +# Dependencies of maybe-foo on foo. These are used because, for example, +# all-gcc only depends on all-gas if gas is present and being configured. +@maybe_dependencies@ -etags tags: TAGS +# Serialization dependencies. Host configures don't work well in parallel to +# each other, due to contention over config.cache. Target configures and +# build configures are similar. +@serialization_dependencies@ -# Right now this just builds TAGS in each subdirectory. emacs19 has the -# ability to use several tags files at once, so there is probably no need -# to combine them into one big TAGS file (like CVS 1.3 does). We could -# (if we felt like it) have this Makefile write a piece of elisp which -# the user could load to tell emacs19 where all the TAGS files we just -# built are. -TAGS: do-TAGS +# -------------------------------- +# Regenerating top level configury +# -------------------------------- # Rebuilding Makefile.in, using autogen. $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def