Makefile.tpl 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932
  1. [+ AutoGen5 template -*- Mode: Makefile -*-
  2. in
  3. +]
  4. # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
  5. #
  6. # Makefile for directory with subdirs to build.
  7. # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
  8. # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
  9. # Free Software Foundation
  10. #
  11. # This file is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 3 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; see the file COPYING3. If not see
  23. # <http://www.gnu.org/licenses/>.
  24. #
  25. # First, test for a proper version of make, but only where one is required.
  26. @if gcc
  27. ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
  28. $(error GNU make version 3.80 or newer is required.)
  29. endif
  30. @endif gcc
  31. # -------------------------------
  32. # Standard Autoconf-set variables
  33. # -------------------------------
  34. VPATH=@srcdir@
  35. build_alias=@build_noncanonical@
  36. build_vendor=@build_vendor@
  37. build_os=@build_os@
  38. build=@build@
  39. host_alias=@host_noncanonical@
  40. host_vendor=@host_vendor@
  41. host_os=@host_os@
  42. host=@host@
  43. target_alias=@target_noncanonical@
  44. target_vendor=@target_vendor@
  45. target_os=@target_os@
  46. target=@target@
  47. program_transform_name = @program_transform_name@
  48. prefix = @prefix@
  49. exec_prefix = @exec_prefix@
  50. srcdir = @srcdir@
  51. bindir = @bindir@
  52. sbindir = @sbindir@
  53. libexecdir = @libexecdir@
  54. datadir = @datadir@
  55. sysconfdir = @sysconfdir@
  56. sharedstatedir = @sharedstatedir@
  57. localstatedir = @localstatedir@
  58. libdir = @libdir@
  59. includedir = @includedir@
  60. oldincludedir = @oldincludedir@
  61. infodir = @infodir@
  62. datarootdir = @datarootdir@
  63. docdir = @docdir@
  64. pdfdir = @pdfdir@
  65. htmldir = @htmldir@
  66. mandir = @mandir@
  67. man1dir = $(mandir)/man1
  68. man2dir = $(mandir)/man2
  69. man3dir = $(mandir)/man3
  70. man4dir = $(mandir)/man4
  71. man5dir = $(mandir)/man5
  72. man6dir = $(mandir)/man6
  73. man7dir = $(mandir)/man7
  74. man8dir = $(mandir)/man8
  75. man9dir = $(mandir)/man9
  76. INSTALL = @INSTALL@
  77. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  78. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  79. INSTALL_DATA = @INSTALL_DATA@
  80. LN = @LN@
  81. LN_S = @LN_S@
  82. MAINT = @MAINT@
  83. MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
  84. MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
  85. # -------------------------------------------------
  86. # Miscellaneous non-standard autoconf-set variables
  87. # -------------------------------------------------
  88. # The gcc driver likes to know the arguments it was configured with.
  89. TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
  90. tooldir = @tooldir@
  91. build_tooldir = @build_tooldir@
  92. # This is the name of the environment variable used for the path to
  93. # the libraries.
  94. RPATH_ENVVAR = @RPATH_ENVVAR@
  95. # On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
  96. # is used instead of the directory itself to avoid including built
  97. # executables in PATH.
  98. GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@
  99. # Build programs are put under this directory.
  100. BUILD_SUBDIR = @build_subdir@
  101. # This is set by the configure script to the arguments to use when configuring
  102. # directories built for the build system.
  103. BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
  104. # Linker flags to use on the host, for stage1 or when not
  105. # bootstrapping.
  106. STAGE1_LDFLAGS = @stage1_ldflags@
  107. # Libraries to use on the host, for stage1 or when not bootstrapping.
  108. STAGE1_LIBS = @stage1_libs@
  109. # Linker flags to use for stage2 and later.
  110. POSTSTAGE1_LDFLAGS = @poststage1_ldflags@
  111. # Libraries to use for stage2 and later.
  112. POSTSTAGE1_LIBS = @poststage1_libs@
  113. # This is the list of variables to export in the environment when
  114. # configuring any subdirectory. It must also be exported whenever
  115. # recursing into a build directory in case that directory's Makefile
  116. # re-runs configure.
  117. BASE_EXPORTS = \
  118. FLEX="$(FLEX)"; export FLEX; \
  119. LEX="$(LEX)"; export LEX; \
  120. BISON="$(BISON)"; export BISON; \
  121. YACC="$(YACC)"; export YACC; \
  122. M4="$(M4)"; export M4; \
  123. SED="$(SED)"; export SED; \
  124. AWK="$(AWK)"; export AWK; \
  125. MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
  126. # This is the list of variables to export in the environment when
  127. # configuring subdirectories for the build system.
  128. BUILD_EXPORTS = \
  129. $(BASE_EXPORTS) \
  130. AR="$(AR_FOR_BUILD)"; export AR; \
  131. AS="$(AS_FOR_BUILD)"; export AS; \
  132. CC="$(CC_FOR_BUILD)"; export CC; \
  133. CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
  134. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  135. CXX="$(CXX_FOR_BUILD)"; export CXX; \
  136. CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
  137. GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
  138. GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
  139. GOC="$(GOC_FOR_BUILD)"; export GOC; \
  140. GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
  141. DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
  142. LD="$(LD_FOR_BUILD)"; export LD; \
  143. LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
  144. NM="$(NM_FOR_BUILD)"; export NM; \
  145. RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
  146. WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
  147. WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
  148. # These variables must be set on the make command line for directories
  149. # built for the build system to override those in BASE_FLAGS_TO_PASS.
  150. EXTRA_BUILD_FLAGS = \
  151. CFLAGS="$(CFLAGS_FOR_BUILD)" \
  152. LDFLAGS="$(LDFLAGS_FOR_BUILD)"
  153. # This is the list of directories to built for the host system.
  154. SUBDIRS = @configdirs@
  155. TARGET_CONFIGDIRS = @target_configdirs@
  156. # This is set by the configure script to the arguments to use when configuring
  157. # directories built for the host system.
  158. HOST_CONFIGARGS = @host_configargs@
  159. # Host programs are put under this directory, which is . except if building
  160. # with srcdir=..
  161. HOST_SUBDIR = @host_subdir@
  162. # This is the list of variables to export in the environment when
  163. # configuring subdirectories for the host system. We need to pass
  164. # some to the GCC configure because of its hybrid host/target nature.
  165. HOST_EXPORTS = \
  166. $(BASE_EXPORTS) \
  167. CC="$(CC)"; export CC; \
  168. ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
  169. CFLAGS="$(CFLAGS)"; export CFLAGS; \
  170. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  171. CXX="$(CXX)"; export CXX; \
  172. CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
  173. GCJ="$(GCJ)"; export GCJ; \
  174. GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
  175. GOC="$(GOC)"; export GOC; \
  176. AR="$(AR)"; export AR; \
  177. AS="$(AS)"; export AS; \
  178. CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
  179. DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
  180. LD="$(LD)"; export LD; \
  181. LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
  182. NM="$(NM)"; export NM; \
  183. RANLIB="$(RANLIB)"; export RANLIB; \
  184. WINDRES="$(WINDRES)"; export WINDRES; \
  185. WINDMC="$(WINDMC)"; export WINDMC; \
  186. OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
  187. OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
  188. READELF="$(READELF)"; export READELF; \
  189. AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
  190. AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
  191. GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
  192. LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
  193. NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
  194. OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
  195. OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
  196. RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
  197. READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
  198. TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
  199. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
  200. GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
  201. GMPINC="$(HOST_GMPINC)"; export GMPINC; \
  202. ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
  203. ISLINC="$(HOST_ISLINC)"; export ISLINC; \
  204. LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \
  205. LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \
  206. @if gcc-bootstrap
  207. $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  208. @endif gcc-bootstrap
  209. $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
  210. POSTSTAGE1_CXX_EXPORT = \
  211. CXX='$(CXX)'; export CXX; \
  212. CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD;
  213. @if target-libstdc++-v3-bootstrap
  214. # Override the above if we're bootstrapping C++.
  215. POSTSTAGE1_CXX_EXPORT = \
  216. CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xg++$(exeext) \
  217. -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
  218. -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  219. -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
  220. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
  221. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
  222. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$s/libstdc++-v3/libsupc++ \
  223. -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  224. -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
  225. export CXX; \
  226. CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD;
  227. @endif target-libstdc++-v3-bootstrap
  228. # Similar, for later GCC stages.
  229. POSTSTAGE1_HOST_EXPORTS = \
  230. $(HOST_EXPORTS) \
  231. CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
  232. -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
  233. $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
  234. CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
  235. $(POSTSTAGE1_CXX_EXPORT) \
  236. $(LTO_EXPORTS) \
  237. GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
  238. LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
  239. HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
  240. # Target libraries are put under this directory:
  241. TARGET_SUBDIR = @target_subdir@
  242. # This is set by the configure script to the arguments to use when configuring
  243. # directories built for the target.
  244. TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
  245. # This is the list of variables to export in the environment when
  246. # configuring subdirectories for the target system.
  247. BASE_TARGET_EXPORTS = \
  248. $(BASE_EXPORTS) \
  249. AR="$(AR_FOR_TARGET)"; export AR; \
  250. AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
  251. CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
  252. CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
  253. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  254. CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
  255. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
  256. GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \
  257. GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
  258. GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
  259. DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
  260. LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
  261. LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
  262. LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
  263. NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
  264. OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
  265. OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
  266. RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
  267. READELF="$(READELF_FOR_TARGET)"; export READELF; \
  268. STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
  269. WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
  270. WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
  271. @if gcc-bootstrap
  272. $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  273. @endif gcc-bootstrap
  274. $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  275. TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS;
  276. RAW_CXX_TARGET_EXPORTS = \
  277. $(BASE_TARGET_EXPORTS) \
  278. CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
  279. CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
  280. NORMAL_TARGET_EXPORTS = \
  281. $(BASE_TARGET_EXPORTS) \
  282. CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
  283. # Where to find GMP
  284. HOST_GMPLIBS = @gmplibs@
  285. HOST_GMPINC = @gmpinc@
  286. # Where to find ISL
  287. HOST_ISLLIBS = @isllibs@
  288. HOST_ISLINC = @islinc@
  289. # Where to find libelf
  290. HOST_LIBELFLIBS = @libelflibs@
  291. HOST_LIBELFINC = @libelfinc@
  292. EXTRA_CONFIGARGS_LIBJAVA = @EXTRA_CONFIGARGS_LIBJAVA@
  293. # ----------------------------------------------
  294. # Programs producing files for the BUILD machine
  295. # ----------------------------------------------
  296. SHELL = @SHELL@
  297. # pwd command to use. Allow user to override default by setting PWDCMD in
  298. # the environment to account for automounters. The make variable must not
  299. # be called PWDCMD, otherwise the value set here is passed to make
  300. # subprocesses and overrides the setting from the user's environment.
  301. # Don't use PWD since it is a common shell environment variable and we
  302. # don't want to corrupt it.
  303. PWD_COMMAND = $${PWDCMD-pwd}
  304. # compilers to use to create programs which must be run in the build
  305. # environment.
  306. AR_FOR_BUILD = @AR_FOR_BUILD@
  307. AS_FOR_BUILD = @AS_FOR_BUILD@
  308. CC_FOR_BUILD = @CC_FOR_BUILD@
  309. CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
  310. CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
  311. CXX_FOR_BUILD = @CXX_FOR_BUILD@
  312. DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
  313. GCJ_FOR_BUILD = @GCJ_FOR_BUILD@
  314. GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
  315. GOC_FOR_BUILD = @GOC_FOR_BUILD@
  316. LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
  317. LD_FOR_BUILD = @LD_FOR_BUILD@
  318. NM_FOR_BUILD = @NM_FOR_BUILD@
  319. RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
  320. WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
  321. WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
  322. # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
  323. # here so that they can be overridden by Makefile fragments.
  324. BUILD_PREFIX = @BUILD_PREFIX@
  325. BUILD_PREFIX_1 = @BUILD_PREFIX_1@
  326. # Flags to pass to stage2 and later makes. They are defined
  327. # here so that they can be overridden by Makefile fragments.
  328. BOOT_CFLAGS= -g -O2
  329. BOOT_LDFLAGS=
  330. BOOT_ADAFLAGS= -gnatpg
  331. AWK = @AWK@
  332. SED = @SED@
  333. BISON = @BISON@
  334. YACC = @YACC@
  335. FLEX = @FLEX@
  336. LEX = @LEX@
  337. M4 = @M4@
  338. MAKEINFO = @MAKEINFO@
  339. EXPECT = @EXPECT@
  340. RUNTEST = @RUNTEST@
  341. # This just becomes part of the MAKEINFO definition passed down to
  342. # sub-makes. It lets flags be given on the command line while still
  343. # using the makeinfo from the object tree.
  344. # (Default to avoid splitting info files by setting the threshold high.)
  345. MAKEINFOFLAGS = --split-size=5000000
  346. # ---------------------------------------------
  347. # Programs producing files for the HOST machine
  348. # ---------------------------------------------
  349. AS = @AS@
  350. AR = @AR@
  351. AR_FLAGS = rc
  352. CC = @CC@
  353. CXX = @CXX@
  354. DLLTOOL = @DLLTOOL@
  355. LD = @LD@
  356. LIPO = @LIPO@
  357. NM = @NM@
  358. OBJDUMP = @OBJDUMP@
  359. RANLIB = @RANLIB@
  360. READELF = @READELF@
  361. STRIP = @STRIP@
  362. WINDRES = @WINDRES@
  363. WINDMC = @WINDMC@
  364. GNATBIND = @GNATBIND@
  365. GNATMAKE = @GNATMAKE@
  366. CFLAGS = @CFLAGS@
  367. LDFLAGS = @LDFLAGS@
  368. LIBCFLAGS = $(CFLAGS)
  369. CXXFLAGS = @CXXFLAGS@
  370. LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
  371. GOCFLAGS = $(CFLAGS)
  372. TFLAGS =
  373. # Defaults for all stages; some are overridden below.
  374. STAGE_CFLAGS = $(BOOT_CFLAGS)
  375. STAGE_TFLAGS = $(TFLAGS)
  376. STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
  377. [+ FOR bootstrap-stage +]
  378. # Defaults for stage [+id+]; some are overridden below.
  379. STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS)
  380. STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
  381. @if target-libstdc++-v3-bootstrap
  382. # Override the above if we're bootstrapping C++.
  383. STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
  384. @endif target-libstdc++-v3-bootstrap
  385. STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
  386. STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
  387. [+ ENDFOR bootstrap-stage +]
  388. # By default, C and C++ are the only stage1 languages, because they are the
  389. # only ones we require to build with the bootstrap compiler, and also the
  390. # only ones useful for building stage2.
  391. STAGE1_CFLAGS = @stage1_cflags@
  392. STAGE1_CHECKING = @stage1_checking@
  393. STAGE1_LANGUAGES = @stage1_languages@
  394. # * We force-disable intermodule optimizations, even if
  395. # --enable-intermodule was passed, since the installed compiler
  396. # probably can't handle them. Luckily, autoconf always respects
  397. # the last argument when conflicting --enable arguments are passed.
  398. # * Likewise, we force-disable coverage flags, since the installed
  399. # compiler probably has never heard of them.
  400. # * We also disable -Wformat, since older GCCs don't understand newer %s.
  401. STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
  402. --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
  403. --disable-build-format-warnings
  404. STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
  405. STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
  406. STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
  407. STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
  408. do-compare = @do_compare@
  409. do-compare3 = $(do-compare)
  410. # -----------------------------------------------
  411. # Programs producing files for the TARGET machine
  412. # -----------------------------------------------
  413. AR_FOR_TARGET=@AR_FOR_TARGET@
  414. AS_FOR_TARGET=@AS_FOR_TARGET@
  415. CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@
  416. # If GCC_FOR_TARGET is not overriden on the command line, then this
  417. # variable is passed down to the gcc Makefile, where it is used to
  418. # build libgcc2.a. We define it here so that it can itself be
  419. # overridden on the command line.
  420. GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@
  421. CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
  422. RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
  423. GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@
  424. GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
  425. GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
  426. DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
  427. LD_FOR_TARGET=@LD_FOR_TARGET@
  428. LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
  429. NM_FOR_TARGET=@NM_FOR_TARGET@
  430. OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
  431. OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
  432. RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
  433. READELF_FOR_TARGET=@READELF_FOR_TARGET@
  434. STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
  435. WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
  436. WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
  437. COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
  438. COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
  439. COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
  440. CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
  441. CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
  442. LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  443. LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  444. LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
  445. GOCFLAGS_FOR_TARGET = -O2 -g
  446. FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
  447. SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  448. DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
  449. XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
  450. # ------------------------------------
  451. # Miscellaneous targets and flag lists
  452. # ------------------------------------
  453. # The first rule in the file had better be this one. Don't put any above it.
  454. # This lives here to allow makefile fragments to contain dependencies.
  455. all:
  456. #### host and target specific makefile fragments come in here.
  457. @target_makefile_frag@
  458. @alphaieee_frag@
  459. @ospace_frag@
  460. @host_makefile_frag@
  461. ###
  462. # This is the list of directories that may be needed in RPATH_ENVVAR
  463. # so that programs built for the target machine work.
  464. TARGET_LIB_PATH = [+ FOR target_modules +][+
  465. IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
  466. ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
  467. [+ FOR target_modules +][+ IF lib_path +]
  468. @if target-[+module+]
  469. TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
  470. @endif target-[+module+]
  471. [+ ENDIF lib_path +][+ ENDFOR target_modules +]
  472. # This is the list of directories that may be needed in RPATH_ENVVAR
  473. # so that programs built for the host machine work.
  474. HOST_LIB_PATH = [+ FOR host_modules +][+
  475. IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
  476. ENDFOR host_modules +]
  477. # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
  478. @if gcc
  479. HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
  480. @endif gcc
  481. [+ FOR host_modules +][+ IF lib_path +]
  482. @if [+module+]
  483. HOST_LIB_PATH_[+module+] = \
  484. $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
  485. +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
  486. @endif [+module+]
  487. [+ ENDIF lib_path +][+ ENDFOR host_modules +]
  488. CXX_FOR_TARGET_FLAG_TO_PASS = \
  489. "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
  490. @if target-libstdc++-v3
  491. # CXX_FOR_TARGET is tricky to get right for target libs that require a
  492. # functional C++ compiler. When we recurse, if we expand
  493. # CXX_FOR_TARGET before configuring libstdc++-v3, we won't get
  494. # libstdc++ include flags from the script. Instead, we get an
  495. # -funconfigured-* word, so that we'll get errors if this invalid C++
  496. # command line is used for anything, but also so that we can use the
  497. # word to decide whether or not to pass on this CXX_FOR_TARGET. If we
  498. # don't pass it on, sub-make will use the default definition, that
  499. # re-expands it at the time of use, so we'll get it right when we need
  500. # it. One potential exception is the expansion of CXX_FOR_TARGET
  501. # passed down as part of CXX within TARGET_FLAGS, but this wouldn't
  502. # really work, for C++ host programs can't depend on the current-stage
  503. # C++ target library.
  504. CXX_FOR_TARGET_FLAG_TO_PASS = \
  505. $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi)
  506. @endif target-libstdc++-v3
  507. # Flags to pass down to all sub-makes. STAGE*FLAGS,
  508. # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
  509. # overrideable (for a bootstrap build stage1 also builds gcc.info).
  510. BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
  511. "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
  512. "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
  513. "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
  514. "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
  515. "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
  516. $(CXX_FOR_TARGET_FLAG_TO_PASS) \
  517. "TFLAGS=$(TFLAGS)" \
  518. "CONFIG_SHELL=$(SHELL)" \
  519. "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
  520. # We leave this in just in case, but it is not needed anymore.
  521. RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
  522. # Flags to pass down to most sub-makes, in which we're building with
  523. # the host environment.
  524. EXTRA_HOST_FLAGS = \
  525. 'AR=$(AR)' \
  526. 'AS=$(AS)' \
  527. 'CC=$(CC)' \
  528. 'CXX=$(CXX)' \
  529. 'DLLTOOL=$(DLLTOOL)' \
  530. 'GCJ=$(GCJ)' \
  531. 'GFORTRAN=$(GFORTRAN)' \
  532. 'GOC=$(GOC)' \
  533. 'LD=$(LD)' \
  534. 'LIPO=$(LIPO)' \
  535. 'NM=$(NM)' \
  536. 'OBJDUMP=$(OBJDUMP)' \
  537. 'RANLIB=$(RANLIB)' \
  538. 'READELF=$(READELF)' \
  539. 'STRIP=$(STRIP)' \
  540. 'WINDRES=$(WINDRES)' \
  541. 'WINDMC=$(WINDMC)'
  542. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  543. # Flags to pass to stage1 or when not bootstrapping.
  544. STAGE1_FLAGS_TO_PASS = \
  545. LDFLAGS="$${LDFLAGS}" \
  546. HOST_LIBS="$${HOST_LIBS}"
  547. # Flags to pass to stage2 and later makes.
  548. POSTSTAGE1_FLAGS_TO_PASS = \
  549. CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
  550. CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
  551. GNATBIND="$${GNATBIND}" \
  552. LDFLAGS="$${LDFLAGS}" \
  553. HOST_LIBS="$${HOST_LIBS}" \
  554. $(LTO_FLAGS_TO_PASS) \
  555. "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
  556. @if gcc-bootstrap
  557. EXTRA_HOST_EXPORTS = if [ $(current_stage) != stage1 ]; then \
  558. $(POSTSTAGE1_HOST_EXPORTS) \
  559. fi;
  560. EXTRA_BOOTSTRAP_FLAGS = CC="$$CC" CXX="$$CXX" LDFLAGS="$$LDFLAGS"
  561. @endif gcc-bootstrap
  562. # Flags to pass down to makes which are built with the target environment.
  563. # The double $ decreases the length of the command line; those variables
  564. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
  565. # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
  566. # so we expand them here.
  567. EXTRA_TARGET_FLAGS = \
  568. 'AR=$$(AR_FOR_TARGET)' \
  569. 'AS=$(COMPILER_AS_FOR_TARGET)' \
  570. 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  571. 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
  572. 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  573. -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
  574. $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  575. 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
  576. 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
  577. 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  578. 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  579. 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  580. 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
  581. 'LD=$(COMPILER_LD_FOR_TARGET)' \
  582. 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
  583. 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
  584. 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
  585. 'NM=$(COMPILER_NM_FOR_TARGET)' \
  586. 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
  587. 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
  588. 'RANLIB=$$(RANLIB_FOR_TARGET)' \
  589. 'READELF=$$(READELF_FOR_TARGET)' \
  590. 'WINDRES=$$(WINDRES_FOR_TARGET)' \
  591. 'WINDMC=$$(WINDMC_FOR_TARGET)' \
  592. 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
  593. 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
  594. 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
  595. "TFLAGS=$$TFLAGS"
  596. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  597. # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
  598. # unfortunately needs the native compiler and the target ar and
  599. # ranlib.
  600. # If any variables are added here, they must be added to do-*, below.
  601. # The BUILD_* variables are a special case, which are used for the gcc
  602. # cross-building scheme.
  603. EXTRA_GCC_FLAGS = \
  604. "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
  605. "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
  606. "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
  607. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
  608. @if gcc
  609. BUILD_CONFIG = @BUILD_CONFIG@
  610. ifneq ($(BUILD_CONFIG),)
  611. include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
  612. endif
  613. @endif gcc
  614. .PHONY: configure-host
  615. configure-host: [+
  616. FOR host_modules +] \
  617. maybe-configure-[+module+][+
  618. ENDFOR host_modules +]
  619. .PHONY: configure-target
  620. configure-target: [+
  621. FOR target_modules +] \
  622. maybe-configure-target-[+module+][+
  623. ENDFOR target_modules +]
  624. # The target built for a native non-bootstrap build.
  625. .PHONY: all
  626. all:
  627. @if gcc-bootstrap
  628. [ -f stage_final ] || echo stage3 > stage_final
  629. @r=`${PWD_COMMAND}`; export r; \
  630. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  631. $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
  632. @endif gcc-bootstrap
  633. @: $(MAKE); $(unstage)
  634. @r=`${PWD_COMMAND}`; export r; \
  635. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  636. @if gcc-bootstrap
  637. if [ -f stage_last ]; then \
  638. TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \
  639. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
  640. else \
  641. @endif gcc-bootstrap
  642. $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
  643. @if gcc-bootstrap
  644. ; \
  645. fi \
  646. @endif gcc-bootstrap
  647. && :
  648. .PHONY: all-build
  649. [+ FOR build_modules +]
  650. all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
  651. .PHONY: all-host
  652. [+ FOR host_modules +][+ IF bootstrap +]
  653. @if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
  654. all-host: maybe-all-[+module+][+ IF bootstrap +]
  655. @endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  656. .PHONY: all-target
  657. [+ FOR target_modules +][+ IF bootstrap +]
  658. @if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
  659. all-target: maybe-all-target-[+module+][+ IF bootstrap +]
  660. @endif target-[+module+]-no-bootstrap[+
  661. ENDIF bootstrap +][+ ENDFOR target_modules +]
  662. # Do a target for all the subdirectories. A ``make do-X'' will do a
  663. # ``make X'' in all subdirectories (because, in general, there is a
  664. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  665. # but it may do additional work as well).
  666. [+ FOR recursive_targets +]
  667. .PHONY: do-[+make_target+]
  668. do-[+make_target+]:
  669. @: $(MAKE); $(unstage)
  670. @r=`${PWD_COMMAND}`; export r; \
  671. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  672. $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
  673. [+make_target+]-target
  674. .PHONY: [+make_target+]-host
  675. [+ FOR host_modules +]
  676. [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
  677. .PHONY: [+make_target+]-target
  678. [+ FOR target_modules +]
  679. [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
  680. [+ ENDFOR recursive_targets +]
  681. # Here are the targets which correspond to the do-X targets.
  682. .PHONY: info installcheck dvi pdf html
  683. .PHONY: install-info install-pdf install-html
  684. .PHONY: clean distclean mostlyclean maintainer-clean realclean
  685. .PHONY: local-clean local-distclean local-maintainer-clean
  686. info: do-info
  687. installcheck: do-installcheck
  688. dvi: do-dvi
  689. pdf: do-pdf
  690. html: do-html
  691. # Make sure makeinfo is built before we do a `make info', if we're
  692. # in fact building texinfo.
  693. do-info: maybe-all-texinfo
  694. install-info: do-install-info dir.info
  695. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  696. if [ -f dir.info ]; then \
  697. $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
  698. else true; fi
  699. install-pdf: do-install-pdf
  700. install-html: do-install-html
  701. local-clean:
  702. -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
  703. local-distclean:
  704. -rm -f Makefile config.status config.cache mh-frag mt-frag
  705. -rm -f maybedep.tmp serdep.tmp
  706. -if [ "$(TARGET_SUBDIR)" != "." ]; then \
  707. rm -rf $(TARGET_SUBDIR); \
  708. else true; fi
  709. -rm -rf $(BUILD_SUBDIR)
  710. -if [ "$(HOST_SUBDIR)" != "." ]; then \
  711. rm -rf $(HOST_SUBDIR); \
  712. else true; fi
  713. -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
  714. -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
  715. -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
  716. -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
  717. -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
  718. -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null
  719. local-maintainer-clean:
  720. @echo "This command is intended for maintainers to use;"
  721. @echo "it deletes files that may require special tools to rebuild."
  722. clean: do-clean local-clean
  723. mostlyclean: do-mostlyclean local-clean
  724. distclean: do-distclean local-clean local-distclean
  725. maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
  726. maintainer-clean: local-distclean
  727. realclean: maintainer-clean
  728. # Check target.
  729. .PHONY: check do-check
  730. check: do-check
  731. # Only include modules actually being configured and built.
  732. .PHONY: check-host
  733. check-host: [+
  734. FOR host_modules +] \
  735. maybe-check-[+module+][+
  736. ENDFOR host_modules +]
  737. .PHONY: check-target
  738. check-target: [+
  739. FOR target_modules +] \
  740. maybe-check-target-[+module+][+
  741. ENDFOR target_modules +]
  742. do-check:
  743. @: $(MAKE); $(unstage)
  744. @r=`${PWD_COMMAND}`; export r; \
  745. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  746. $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
  747. # Automated reporting of test results.
  748. warning.log: build.log
  749. $(srcdir)/contrib/warn_summary build.log > $@
  750. mail-report.log:
  751. if test x'$(BOOT_CFLAGS)' != x''; then \
  752. BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
  753. fi; \
  754. $(srcdir)/contrib/test_summary -t >$@
  755. chmod +x $@
  756. echo If you really want to send e-mail, run ./$@ now
  757. mail-report-with-warnings.log: warning.log
  758. if test x'$(BOOT_CFLAGS)' != x''; then \
  759. BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
  760. fi; \
  761. $(srcdir)/contrib/test_summary -t -i warning.log >$@
  762. chmod +x $@
  763. echo If you really want to send e-mail, run ./$@ now
  764. # Local Vim config
  765. $(srcdir)/.local.vimrc:
  766. $(LN_S) contrib/vimrc $@
  767. $(srcdir)/.lvimrc:
  768. $(LN_S) contrib/vimrc $@
  769. vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
  770. .PHONY: vimrc
  771. # Installation targets.
  772. .PHONY: install uninstall
  773. install:
  774. @: $(MAKE); $(unstage)
  775. @r=`${PWD_COMMAND}`; export r; \
  776. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  777. $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
  778. .PHONY: install-host-nogcc
  779. install-host-nogcc: [+
  780. FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
  781. maybe-install-[+module+][+ ENDIF +][+
  782. ENDFOR host_modules +]
  783. .PHONY: install-host
  784. install-host: [+
  785. FOR host_modules +] \
  786. maybe-install-[+module+][+
  787. ENDFOR host_modules +]
  788. .PHONY: install-target
  789. install-target: [+
  790. FOR target_modules +] \
  791. maybe-install-target-[+module+][+
  792. ENDFOR target_modules +]
  793. uninstall:
  794. @echo "the uninstall target is not supported in this tree"
  795. .PHONY: install.all
  796. install.all: install-no-fixedincludes
  797. @if [ -f ./gcc/Makefile ]; then \
  798. r=`${PWD_COMMAND}`; export r; \
  799. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  800. $(HOST_EXPORTS) \
  801. (cd ./gcc && \
  802. $(MAKE) $(FLAGS_TO_PASS) install-headers); \
  803. else \
  804. true; \
  805. fi
  806. # install-no-fixedincludes is used to allow the elaboration of binary packages
  807. # suitable for distribution, where we cannot include the fixed system header
  808. # files.
  809. .PHONY: install-no-fixedincludes
  810. install-no-fixedincludes: installdirs install-host-nogcc \
  811. install-target gcc-install-no-fixedincludes
  812. .PHONY: install-strip
  813. install-strip:
  814. @: $(MAKE); $(unstage)
  815. @r=`${PWD_COMMAND}`; export r; \
  816. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  817. $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target
  818. .PHONY: install-strip-host
  819. install-strip-host: [+
  820. FOR host_modules +] \
  821. maybe-install-strip-[+module+][+
  822. ENDFOR host_modules +]
  823. .PHONY: install-strip-target
  824. install-strip-target: [+
  825. FOR target_modules +] \
  826. maybe-install-strip-target-[+module+][+
  827. ENDFOR target_modules +]
  828. ### other supporting targets
  829. MAKEDIRS= \
  830. $(DESTDIR)$(prefix) \
  831. $(DESTDIR)$(exec_prefix)
  832. .PHONY: installdirs
  833. installdirs: mkinstalldirs
  834. $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
  835. dir.info: do-install-info
  836. if [ -f $(srcdir)/texinfo/gen-info-dir ]; then \
  837. $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new; \
  838. mv -f dir.info.new dir.info; \
  839. else true; \
  840. fi
  841. dist:
  842. @echo "Building a full distribution of this tree isn't done"
  843. @echo "via 'make dist'. Check out the etc/ subdirectory"
  844. etags tags: TAGS
  845. # Right now this just builds TAGS in each subdirectory. emacs19 has the
  846. # ability to use several tags files at once, so there is probably no need
  847. # to combine them into one big TAGS file (like CVS 1.3 does). We could
  848. # (if we felt like it) have this Makefile write a piece of elisp which
  849. # the user could load to tell emacs19 where all the TAGS files we just
  850. # built are.
  851. TAGS: do-TAGS
  852. # ------------------------------------
  853. # Macros for configure and all targets
  854. # ------------------------------------
  855. [+ DEFINE configure +]
  856. .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
  857. maybe-configure-[+prefix+][+module+]:
  858. @if gcc-bootstrap
  859. configure-[+prefix+][+module+]: stage_current
  860. @endif gcc-bootstrap
  861. @if [+prefix+][+module+]
  862. maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
  863. configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
  864. @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
  865. @r=`${PWD_COMMAND}`; export r; \
  866. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  867. [+ IF check_multilibs
  868. +]echo "Checking multilib configuration for [+module+]..."; \
  869. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  870. $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
  871. if test -r [+subdir+]/[+module+]/multilib.out; then \
  872. if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
  873. rm -f [+subdir+]/[+module+]/multilib.tmp; \
  874. else \
  875. rm -f [+subdir+]/[+module+]/Makefile; \
  876. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  877. fi; \
  878. else \
  879. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  880. fi; \
  881. [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
  882. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  883. [+exports+] [+extra_exports+] \
  884. echo Configuring in [+subdir+]/[+module+]; \
  885. cd "[+subdir+]/[+module+]" || exit 1; \
  886. case $(srcdir) in \
  887. /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
  888. *) topdir=`echo [+subdir+]/[+module+]/ | \
  889. sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
  890. esac; \
  891. module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
  892. [+ IF no-config-site +]rm -f no-such-file || : ; \
  893. CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) \
  894. $$s/$$module_srcdir/configure \
  895. --srcdir=$${topdir}/$$module_srcdir \
  896. [+args+] --build=${build_alias} --host=[+host_alias+] \
  897. --target=[+target_alias+] [+extra_configure_flags+] \
  898. || exit 1
  899. @endif [+prefix+][+module+]
  900. [+ IF bootstrap +]
  901. [+ FOR bootstrap_stage +]
  902. .PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
  903. maybe-configure-stage[+id+]-[+prefix+][+module+]:
  904. @if [+prefix+][+module+]-bootstrap
  905. maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
  906. configure-stage[+id+]-[+prefix+][+module+]:
  907. @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
  908. @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
  909. @r=`${PWD_COMMAND}`; export r; \
  910. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  911. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  912. [+ IF check_multilibs
  913. +]echo "Checking multilib configuration for [+module+]..."; \
  914. $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
  915. if test -r [+subdir+]/[+module+]/multilib.out; then \
  916. if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
  917. rm -f [+subdir+]/[+module+]/multilib.tmp; \
  918. else \
  919. rm -f [+subdir+]/[+module+]/Makefile; \
  920. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  921. fi; \
  922. else \
  923. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  924. fi; \
  925. [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
  926. [+exports+][+ IF prev +] \
  927. [+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \
  928. CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
  929. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
  930. LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \
  931. CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \
  932. CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"; export CXXFLAGS;[+ IF prev +] \
  933. LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
  934. LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+
  935. ENDIF prefix +] [+extra_exports+] \
  936. echo Configuring stage [+id+] in [+subdir+]/[+module+]; \
  937. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  938. cd [+subdir+]/[+module+] || exit 1; \
  939. case $(srcdir) in \
  940. /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
  941. *) topdir=`echo [+subdir+]/[+module+]/ | \
  942. sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
  943. esac; \
  944. module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
  945. $(SHELL) $$s/$$module_srcdir/configure \
  946. --srcdir=$${topdir}/$$module_srcdir \
  947. [+args+] --build=${build_alias} --host=[+host_alias+] \
  948. --target=[+target_alias+] \
  949. [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
  950. $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \
  951. [+extra_configure_flags+][+ ENDIF extra_configure_flags +]
  952. @endif [+prefix+][+module+]-bootstrap
  953. [+ ENDFOR bootstrap_stage +]
  954. [+ ENDIF bootstrap +]
  955. [+ ENDDEF +]
  956. [+ DEFINE all +]
  957. .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
  958. maybe-all-[+prefix+][+module+]:
  959. @if gcc-bootstrap
  960. all-[+prefix+][+module+]: stage_current
  961. @endif gcc-bootstrap
  962. @if [+prefix+][+module+]
  963. TARGET-[+prefix+][+module+]=[+
  964. IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
  965. maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
  966. all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
  967. @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
  968. @r=`${PWD_COMMAND}`; export r; \
  969. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  970. [+exports+] [+extra_exports+] \
  971. (cd [+subdir+]/[+module+] && \
  972. $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
  973. $(TARGET-[+prefix+][+module+]))
  974. @endif [+prefix+][+module+]
  975. [+ IF bootstrap +]
  976. [+ FOR bootstrap_stage +]
  977. .PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
  978. .PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
  979. maybe-all-stage[+id+]-[+prefix+][+module+]:
  980. maybe-clean-stage[+id+]-[+prefix+][+module+]:
  981. @if [+prefix+][+module+]-bootstrap
  982. maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
  983. all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
  984. TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
  985. all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
  986. @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
  987. @r=`${PWD_COMMAND}`; export r; \
  988. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  989. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  990. [+exports+][+ IF prev +] \
  991. [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \
  992. cd [+subdir+]/[+module+] && \
  993. $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \
  994. CFLAGS="$(CFLAGS_FOR_TARGET)" \
  995. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
  996. LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
  997. CFLAGS="$(STAGE[+id+]_CFLAGS)" \
  998. CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \
  999. LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
  1000. LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
  1001. CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
  1002. CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
  1003. LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
  1004. [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
  1005. [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
  1006. TFLAGS="$(STAGE[+id+]_TFLAGS)" \
  1007. $(TARGET-stage[+id+]-[+prefix+][+module+])
  1008. maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
  1009. clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
  1010. clean-stage[+id+]-[+prefix+][+module+]:
  1011. @if [ $(current_stage) = stage[+id+] ]; then \
  1012. [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
  1013. else \
  1014. [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
  1015. $(MAKE) stage[+id+]-start; \
  1016. fi; \
  1017. cd [+subdir+]/[+module+] && \
  1018. $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
  1019. [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
  1020. @endif [+prefix+][+module+]-bootstrap
  1021. [+ ENDFOR bootstrap_stage +]
  1022. [+ ENDIF bootstrap +]
  1023. [+ ENDDEF +]
  1024. # --------------------------------------
  1025. # Modules which run on the build machine
  1026. # --------------------------------------
  1027. [+ FOR build_modules +]
  1028. [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
  1029. host_alias=(get "host" "${build_alias}")
  1030. target_alias=(get "target" "${target_alias}")
  1031. args="$(BUILD_CONFIGARGS)" no-config-site=true +]
  1032. [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
  1033. args="$(EXTRA_BUILD_FLAGS)" +]
  1034. [+ ENDFOR build_module +]
  1035. # --------------------------------------
  1036. # Modules which run on the host machine
  1037. # --------------------------------------
  1038. [+ FOR host_modules +]
  1039. [+ configure prefix="" subdir="$(HOST_SUBDIR)"
  1040. exports="$(HOST_EXPORTS)"
  1041. poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
  1042. host_alias=(get "host" "${host_alias}")
  1043. target_alias=(get "target" "${target_alias}")
  1044. args="$(HOST_CONFIGARGS)" +]
  1045. [+ all prefix="" subdir="$(HOST_SUBDIR)"
  1046. exports="$(HOST_EXPORTS)"
  1047. poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
  1048. args="$(EXTRA_HOST_FLAGS)"
  1049. stage1_args="$(STAGE1_FLAGS_TO_PASS)"
  1050. poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
  1051. .PHONY: check-[+module+] maybe-check-[+module+]
  1052. maybe-check-[+module+]:
  1053. @if [+module+]
  1054. maybe-check-[+module+]: check-[+module+]
  1055. [+ IF no_check +]
  1056. check-[+module+]:
  1057. [+ ELIF no_check_cross +]
  1058. # This module is only tested in a native toolchain.
  1059. check-[+module+]:
  1060. @: $(MAKE); $(unstage)
  1061. @if [ '$(host)' = '$(target)' ]; then \
  1062. r=`${PWD_COMMAND}`; export r; \
  1063. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1064. $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
  1065. ENDIF bootstrap +] \
  1066. (cd $(HOST_SUBDIR)/[+module+] && \
  1067. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
  1068. IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
  1069. fi
  1070. [+ ELSE check +]
  1071. check-[+module+]:
  1072. @: $(MAKE); $(unstage)
  1073. @r=`${PWD_COMMAND}`; export r; \
  1074. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1075. $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
  1076. ENDIF bootstrap +] \
  1077. (cd $(HOST_SUBDIR)/[+module+] && \
  1078. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
  1079. IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
  1080. [+ ENDIF no_check +]
  1081. @endif [+module+]
  1082. .PHONY: install-[+module+] maybe-install-[+module+]
  1083. maybe-install-[+module+]:
  1084. @if [+module+]
  1085. maybe-install-[+module+]: install-[+module+]
  1086. [+ IF no_install +]
  1087. install-[+module+]:
  1088. [+ ELSE install +]
  1089. install-[+module+]: installdirs
  1090. @: $(MAKE); $(unstage)
  1091. @r=`${PWD_COMMAND}`; export r; \
  1092. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1093. $(HOST_EXPORTS) \
  1094. (cd $(HOST_SUBDIR)/[+module+] && \
  1095. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
  1096. [+ ENDIF no_install +]
  1097. @endif [+module+]
  1098. .PHONY: install-strip-[+module+] maybe-install-strip-[+module+]
  1099. maybe-install-strip-[+module+]:
  1100. @if [+module+]
  1101. maybe-install-strip-[+module+]: install-strip-[+module+]
  1102. [+ IF no_install +]
  1103. install-strip-[+module+]:
  1104. [+ ELSE install +]
  1105. install-strip-[+module+]: installdirs
  1106. @: $(MAKE); $(unstage)
  1107. @r=`${PWD_COMMAND}`; export r; \
  1108. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1109. $(HOST_EXPORTS) \
  1110. (cd $(HOST_SUBDIR)/[+module+] && \
  1111. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
  1112. [+ ENDIF no_install +]
  1113. @endif [+module+]
  1114. # Other targets (info, dvi, pdf, etc.)
  1115. [+ FOR recursive_targets +]
  1116. .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
  1117. maybe-[+make_target+]-[+module+]:
  1118. @if [+module+]
  1119. maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
  1120. [+ IF (match-value? = "missing" (get "make_target") ) +]
  1121. # [+module+] doesn't support [+make_target+].
  1122. [+make_target+]-[+module+]:
  1123. [+ ELSE +]
  1124. [+make_target+]-[+module+]: [+
  1125. FOR depend +]\
  1126. [+depend+]-[+module+] [+
  1127. ENDFOR depend +]
  1128. @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
  1129. @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
  1130. r=`${PWD_COMMAND}`; export r; \
  1131. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1132. $(HOST_EXPORTS) \
  1133. for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
  1134. eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
  1135. done; \
  1136. echo "Doing [+make_target+] in [+module+]"; \
  1137. (cd $(HOST_SUBDIR)/[+module+] && \
  1138. $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  1139. "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
  1140. "RANLIB=$${RANLIB}" \
  1141. "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
  1142. [+make_target+]) \
  1143. || exit 1
  1144. [+ ENDIF +]
  1145. @endif [+module+]
  1146. [+ ENDFOR recursive_targets +]
  1147. [+ ENDFOR host_modules +]
  1148. # ---------------------------------------
  1149. # Modules which run on the target machine
  1150. # ---------------------------------------
  1151. [+ FOR target_modules +]
  1152. [+ IF raw_cxx +]
  1153. [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
  1154. check_multilibs=true
  1155. exports="$(RAW_CXX_TARGET_EXPORTS)"
  1156. host_alias=(get "host" "${target_alias}")
  1157. target_alias=(get "target" "${target_alias}")
  1158. args="$(TARGET_CONFIGARGS)" no-config-site=true +]
  1159. [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
  1160. exports="$(RAW_CXX_TARGET_EXPORTS)"
  1161. args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
  1162. [+ ELSE +]
  1163. [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
  1164. check_multilibs=true
  1165. exports="$(NORMAL_TARGET_EXPORTS)"
  1166. host_alias=(get "host" "${target_alias}")
  1167. target_alias=(get "target" "${target_alias}")
  1168. args="$(TARGET_CONFIGARGS)" no-config-site=true +]
  1169. [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
  1170. exports="$(NORMAL_TARGET_EXPORTS)"
  1171. args="$(EXTRA_TARGET_FLAGS)" +]
  1172. [+ ENDIF +]
  1173. .PHONY: check-target-[+module+] maybe-check-target-[+module+]
  1174. maybe-check-target-[+module+]:
  1175. @if target-[+module+]
  1176. maybe-check-target-[+module+]: check-target-[+module+]
  1177. [+ IF no_check +]
  1178. # Dummy target for uncheckable module.
  1179. check-target-[+module+]:
  1180. [+ ELSE check +]
  1181. check-target-[+module+]:
  1182. @: $(MAKE); $(unstage)
  1183. @r=`${PWD_COMMAND}`; export r; \
  1184. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1185. IF raw_cxx +]
  1186. $(RAW_CXX_TARGET_EXPORTS) \[+
  1187. ELSE normal_cxx +]
  1188. $(NORMAL_TARGET_EXPORTS) \[+
  1189. ENDIF raw_cxx +]
  1190. (cd $(TARGET_SUBDIR)/[+module+] && \
  1191. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
  1192. IF raw_cxx
  1193. +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
  1194. ENDIF raw_cxx
  1195. +] [+extra_make_flags+] check)
  1196. [+ ENDIF no_check +]
  1197. @endif target-[+module+]
  1198. .PHONY: install-target-[+module+] maybe-install-target-[+module+]
  1199. maybe-install-target-[+module+]:
  1200. @if target-[+module+]
  1201. maybe-install-target-[+module+]: install-target-[+module+]
  1202. [+ IF no_install +]
  1203. # Dummy target for uninstallable.
  1204. install-target-[+module+]:
  1205. [+ ELSE install +]
  1206. install-target-[+module+]: installdirs
  1207. @: $(MAKE); $(unstage)
  1208. @r=`${PWD_COMMAND}`; export r; \
  1209. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1210. IF raw_cxx +]
  1211. $(RAW_CXX_TARGET_EXPORTS) \[+
  1212. ELSE normal_cxx +]
  1213. $(NORMAL_TARGET_EXPORTS) \[+
  1214. ENDIF raw_cxx +]
  1215. (cd $(TARGET_SUBDIR)/[+module+] && \
  1216. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
  1217. [+ ENDIF no_install +]
  1218. @endif target-[+module+]
  1219. .PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+]
  1220. maybe-install-strip-target-[+module+]:
  1221. @if target-[+module+]
  1222. maybe-install-strip-target-[+module+]: install-strip-target-[+module+]
  1223. [+ IF no_install +]
  1224. # Dummy target for uninstallable.
  1225. install-strip-target-[+module+]:
  1226. [+ ELSE install +]
  1227. install-strip-target-[+module+]: installdirs
  1228. @: $(MAKE); $(unstage)
  1229. @r=`${PWD_COMMAND}`; export r; \
  1230. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1231. IF raw_cxx +]
  1232. $(RAW_CXX_TARGET_EXPORTS) \[+
  1233. ELSE normal_cxx +]
  1234. $(NORMAL_TARGET_EXPORTS) \[+
  1235. ENDIF raw_cxx +]
  1236. (cd $(TARGET_SUBDIR)/[+module+] && \
  1237. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
  1238. [+ ENDIF no_install +]
  1239. @endif target-[+module+]
  1240. # Other targets (info, dvi, pdf, etc.)
  1241. [+ FOR recursive_targets +]
  1242. .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
  1243. maybe-[+make_target+]-target-[+module+]:
  1244. @if target-[+module+]
  1245. maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
  1246. [+ IF (match-value? = "missing" (get "make_target") ) +]
  1247. # [+module+] doesn't support [+make_target+].
  1248. [+make_target+]-target-[+module+]:
  1249. [+ ELSE +]
  1250. [+make_target+]-target-[+module+]: [+
  1251. FOR depend +]\
  1252. [+depend+]-target-[+module+] [+
  1253. ENDFOR depend +]
  1254. @: $(MAKE); $(unstage)
  1255. @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0; \
  1256. r=`${PWD_COMMAND}`; export r; \
  1257. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1258. IF raw_cxx +]
  1259. $(RAW_CXX_TARGET_EXPORTS) \[+
  1260. ELSE normal_cxx +]
  1261. $(NORMAL_TARGET_EXPORTS) \[+
  1262. ENDIF raw_cxx +]
  1263. echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]"; \
  1264. for flag in $(EXTRA_TARGET_FLAGS); do \
  1265. eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
  1266. done; \
  1267. (cd $(TARGET_SUBDIR)/[+module+] && \
  1268. $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  1269. "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
  1270. "RANLIB=$${RANLIB}" \
  1271. "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
  1272. [+extra_make_flags+] [+make_target+]) \
  1273. || exit 1
  1274. [+ ENDIF +]
  1275. @endif target-[+module+]
  1276. [+ ENDFOR recursive_targets +]
  1277. [+ ENDFOR target_modules +]
  1278. @if target-libgomp
  1279. .PHONY: check-target-libgomp-c++
  1280. check-target-libgomp-c++:
  1281. $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp
  1282. @endif target-libgomp
  1283. @if target-libitm
  1284. .PHONY: check-target-libitm-c++
  1285. check-target-libitm-c++:
  1286. $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm
  1287. @endif target-libitm
  1288. # ----------
  1289. # GCC module
  1290. # ----------
  1291. @if gcc-no-bootstrap
  1292. .PHONY: cross
  1293. cross: all-build all-gas all-ld
  1294. @r=`${PWD_COMMAND}`; export r; \
  1295. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1296. $(HOST_EXPORTS) \
  1297. echo "Building the C and C++ compiler"; \
  1298. cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
  1299. @r=`${PWD_COMMAND}`; export r; \
  1300. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1301. echo "Building runtime libraries"; \
  1302. $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
  1303. @endif gcc-no-bootstrap
  1304. @if gcc
  1305. [+ FOR languages +]
  1306. .PHONY: check-gcc-[+language+] check-[+language+]
  1307. check-gcc-[+language+]:
  1308. r=`${PWD_COMMAND}`; export r; \
  1309. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1310. $(HOST_EXPORTS) \
  1311. (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
  1312. check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +]
  1313. [+ ENDFOR languages +]
  1314. # The gcc part of install-no-fixedincludes, which relies on an intimate
  1315. # knowledge of how a number of gcc internal targets (inter)operate. Delegate.
  1316. .PHONY: gcc-install-no-fixedincludes
  1317. gcc-install-no-fixedincludes:
  1318. @if [ -f ./gcc/Makefile ]; then \
  1319. r=`${PWD_COMMAND}`; export r; \
  1320. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1321. $(HOST_EXPORTS) \
  1322. (cd ./gcc \
  1323. && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
  1324. else true; fi
  1325. @endif gcc
  1326. # ---------------------
  1327. # GCC bootstrap support
  1328. # ---------------------
  1329. # We track the current stage (the one in 'gcc') in the stage_current file.
  1330. # stage_last instead tracks the stage that was built last. These targets
  1331. # are dummy when toplevel bootstrap is not active.
  1332. # While making host and target tools, symlinks to the final stage must be
  1333. # there, so $(unstage) should be run at various points. To avoid excessive
  1334. # recursive invocations of make, we "inline" them using a variable. These
  1335. # must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
  1336. # to avoid warnings from the GNU Make job server.
  1337. unstage = :
  1338. stage = :
  1339. current_stage = ""
  1340. @if gcc-bootstrap
  1341. unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
  1342. stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
  1343. current_stage = "`cat stage_current 2> /dev/null`"
  1344. @endif gcc-bootstrap
  1345. .PHONY: unstage stage
  1346. unstage:
  1347. @: $(MAKE); $(unstage)
  1348. stage:
  1349. @: $(MAKE); $(stage)
  1350. # Disable commands for lean bootstrap.
  1351. LEAN = false
  1352. # We name the build directories for the various stages "stage1-gcc",
  1353. # "stage2-gcc","stage3-gcc", etc.
  1354. # Since the 'compare' process will fail (on debugging information) if any
  1355. # directory names are different, we need to link the gcc directory for
  1356. # the previous stage to a constant name ('prev-gcc'), and to make the name of
  1357. # the build directories constant as well. For the latter, we use naked names
  1358. # like 'gcc', because the scripts in that directory assume it. We use
  1359. # mv on platforms where symlinks to directories do not work or are not
  1360. # reliable.
  1361. # 'touch' doesn't work right on some platforms.
  1362. STAMP = echo timestamp >
  1363. # We only want to compare .o files, so set this!
  1364. objext = .o
  1365. [+ FOR bootstrap-stage +]
  1366. .PHONY: stage[+id+]-start stage[+id+]-end
  1367. stage[+id+]-start::
  1368. @: $(MAKE); $(stage); \
  1369. echo stage[+id+] > stage_current; \
  1370. echo stage[+id+] > stage_last; \
  1371. $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
  1372. FOR host_modules +][+ IF bootstrap +]
  1373. @if [+ module +]
  1374. @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
  1375. mkdir stage[+id+]-[+module+]; \
  1376. mv stage[+id+]-[+module+] [+module+][+ IF prev +]; \
  1377. mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
  1378. @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  1379. @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
  1380. mkdir stage[+id+]-$(TARGET_SUBDIR); \
  1381. mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR)[+ IF prev +]; \
  1382. mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
  1383. stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
  1384. @if [+ module +]
  1385. @if test -d $(HOST_SUBDIR)/[+module+]; then \
  1386. cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+][+ IF prev +]; \
  1387. mv prev-[+module+] stage[+prev+]-[+module+]; : [+ ENDIF prev +]; \
  1388. fi
  1389. @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  1390. @if test -d $(TARGET_SUBDIR); then \
  1391. mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR)[+ IF prev +]; \
  1392. mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR); : [+ ENDIF prev +]; \
  1393. fi
  1394. rm -f stage_current
  1395. # Bubble a bug fix through all the stages up to stage [+id+]. They are
  1396. # remade, but not reconfigured. The next stage (if any) will not be
  1397. # reconfigured either.
  1398. .PHONY: stage[+id+]-bubble
  1399. stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
  1400. @r=`${PWD_COMMAND}`; export r; \
  1401. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1402. if test -f stage[+id+]-lean [+
  1403. IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +]; then \
  1404. echo Skipping rebuild of stage[+id+]; \
  1405. else \
  1406. $(MAKE) stage[+id+]-start; \[+IF lean +]
  1407. if $(LEAN); then \
  1408. rm -rf stage[+lean+]-*; \
  1409. $(STAMP) stage[+lean+]-lean; \
  1410. fi; \[+ ENDIF lean +]
  1411. $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
  1412. fi[+ IF compare-target +]
  1413. $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
  1414. .PHONY: all-stage[+id+] clean-stage[+id+]
  1415. do-clean: clean-stage[+id+]
  1416. # FIXME: Will not need to be conditional when toplevel bootstrap is the
  1417. # only possibility, but now it conflicts with no-bootstrap rules
  1418. @if gcc-bootstrap
  1419. [+ IF compare-target +]
  1420. [+compare-target+]:
  1421. @r=`${PWD_COMMAND}`; export r; \
  1422. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1423. if test -f stage[+prev+]-lean; then \
  1424. echo Cannot compare object files as stage [+prev+] was deleted.; \
  1425. exit 0; \
  1426. fi; \
  1427. : $(MAKE); $(stage); \
  1428. rm -f .bad_compare; \
  1429. echo Comparing stages [+prev+] and [+id+]; \
  1430. sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
  1431. files=`find stage[+id+]-* -name "*$(objext)" -print | \
  1432. sed -n s,^stage$$sed-,,p`; \
  1433. for file in $${files}; do \
  1434. f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
  1435. if test ! -f $$f1; then continue; fi; \
  1436. $(do-[+compare-target+]) > /dev/null 2>&1; \
  1437. if test $$? -eq 1; then \
  1438. case $$file in \
  1439. @compare_exclusions@) \
  1440. echo warning: $$file differs ;; \
  1441. *) \
  1442. echo $$file differs >> .bad_compare ;; \
  1443. esac; \
  1444. fi; \
  1445. done; \
  1446. if [ -f .bad_compare ]; then \
  1447. echo "Bootstrap comparison failure!"; \
  1448. cat .bad_compare; \
  1449. exit 1; \
  1450. else \
  1451. echo Comparison successful.; \
  1452. fi; \
  1453. $(STAMP) [+compare-target+][+ IF prev +]
  1454. if $(LEAN); then \
  1455. rm -rf stage[+prev+]-*; \
  1456. $(STAMP) stage[+prev+]-lean; \
  1457. fi[+ ENDIF prev +]
  1458. [+ ENDIF compare-target +]
  1459. [+ IF bootstrap-target +]
  1460. .PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
  1461. [+bootstrap-target+]:
  1462. echo stage[+id+] > stage_final
  1463. @r=`${PWD_COMMAND}`; export r; \
  1464. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1465. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
  1466. @: $(MAKE); $(unstage)
  1467. @r=`${PWD_COMMAND}`; export r; \
  1468. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1469. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1470. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1471. [+bootstrap-target+]-lean:
  1472. echo stage[+id+] > stage_final
  1473. @r=`${PWD_COMMAND}`; export r; \
  1474. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1475. $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble
  1476. @: $(MAKE); $(unstage)
  1477. @r=`${PWD_COMMAND}`; export r; \
  1478. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1479. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1480. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1481. [+ ENDIF bootstrap-target +]
  1482. # Rules to wipe a stage and all the following ones, also used for cleanstrap
  1483. [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
  1484. .PHONY: distclean-stage[+id+]
  1485. distclean-stage[+id+]::
  1486. @: $(MAKE); $(stage)
  1487. @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
  1488. rm -rf stage[+id+]-* [+
  1489. IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
  1490. [+ IF cleanstrap-target +]
  1491. .PHONY: [+cleanstrap-target+]
  1492. [+cleanstrap-target+]: do-distclean local-clean
  1493. echo stage[+id+] > stage_final
  1494. @r=`${PWD_COMMAND}`; export r; \
  1495. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1496. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
  1497. @: $(MAKE); $(unstage)
  1498. @r=`${PWD_COMMAND}`; export r; \
  1499. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1500. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1501. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1502. [+ ENDIF cleanstrap-target +]
  1503. @endif gcc-bootstrap
  1504. [+ ENDFOR bootstrap-stage +]
  1505. stageprofile-end::
  1506. $(MAKE) distclean-stagefeedback
  1507. stagefeedback-start::
  1508. @r=`${PWD_COMMAND}`; export r; \
  1509. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1510. for i in prev-*; do \
  1511. j=`echo $$i | sed s/^prev-//`; \
  1512. cd $$r/$$i && \
  1513. { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
  1514. { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
  1515. done
  1516. @if gcc-bootstrap
  1517. do-distclean: distclean-stage1
  1518. # Provide a GCC build when we're building target libraries. This does
  1519. # not work as a dependency, just as the minimum necessary to avoid errors.
  1520. stage_last:
  1521. @r=`${PWD_COMMAND}`; export r; \
  1522. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1523. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
  1524. # Same as unstage, but not phony and defaulting to stage1-start. We place
  1525. # it in the dependency so that for example `make -j3 all-gcc' works.
  1526. stage_current:
  1527. @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
  1528. .PHONY: restrap
  1529. restrap::
  1530. @: $(MAKE); $(stage)
  1531. rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev
  1532. +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
  1533. restrap:: all
  1534. @endif gcc-bootstrap
  1535. # --------------------------------------
  1536. # Dependencies between different modules
  1537. # --------------------------------------
  1538. # Generic dependencies for target modules on host stuff, especially gcc
  1539. @if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap
  1540. +][+ FOR bootstrap_stage +]
  1541. configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+
  1542. ENDFOR +][+ ELSE bootstrap +]
  1543. configure-target-[+module+]: stage_last[+
  1544. ENDIF bootstrap +][+ ENDFOR target_modules +]
  1545. @endif gcc-bootstrap
  1546. @if gcc-no-bootstrap[+ FOR target_modules +]
  1547. configure-target-[+module+]: maybe-all-gcc[+
  1548. ENDFOR target_modules +]
  1549. @endif gcc-no-bootstrap
  1550. # There are two types of dependencies here: 'hard' dependencies, where one
  1551. # module simply won't build without the other; and 'soft' dependencies, where
  1552. # if the depended-on module is missing, the depending module will do without
  1553. # or find a substitute somewhere (perhaps installed). Soft dependencies
  1554. # are made here to depend on a 'maybe-' target. If you're not sure,
  1555. # it's safer to use a soft dependency.
  1556. [+ ;; These Scheme functions build the bulk of the dependencies.
  1557. ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
  1558. ;; where "maybe-" is only included if HARD is not true, and all-gcc
  1559. ;; is taken from VAR-NAME.
  1560. (define dep-target (lambda (module-kind var-name hard)
  1561. (string-append
  1562. (if hard "" "maybe-")
  1563. (dep-subtarget var-name)
  1564. module-kind
  1565. (dep-module var-name)
  1566. )))
  1567. ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
  1568. (define make-dep (lambda (module-kind on-kind)
  1569. (string-append
  1570. (dep-target module-kind "module" #t) ": "
  1571. (dep-target on-kind "on" (exist? "hard")))))
  1572. ;; dep-subtarget extracts everything up to the first dash in the given
  1573. ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
  1574. (define dep-subtarget (lambda (var-name)
  1575. (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
  1576. ;; dep-module extracts everything up to the first dash in the given
  1577. ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
  1578. (define dep-module (lambda (var-name)
  1579. (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
  1580. ;; dep-stage builds a string for the prefix of a bootstrap stage.
  1581. (define dep-stage (lambda ()
  1582. (string-append
  1583. "stage"
  1584. (get "id")
  1585. "-")))
  1586. ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
  1587. ;; but is written in Scheme.
  1588. (define dep-maybe (lambda ()
  1589. (if (exist? "hard") "" "maybe-")))
  1590. ;; dep-kind returns "normal" if the dependency is on an "install" target,
  1591. ;; or if either module is not bootstrapped. It returns "bootstrap" for
  1592. ;; configure or build dependencies between bootstrapped modules; it returns
  1593. ;; "prebootstrap" for configure or build dependencies of bootstrapped
  1594. ;; modules on a build module (e.g. all-gcc on all-build-bison). All this
  1595. ;; is only necessary for host modules.
  1596. (define dep-kind (lambda ()
  1597. (if (and (hash-ref boot-modules (dep-module "module"))
  1598. (=* (dep-module "on") "build-"))
  1599. "prebootstrap"
  1600. (if (or (= (dep-subtarget "on") "install-")
  1601. (not (hash-ref boot-modules (dep-module "module")))
  1602. (not (hash-ref boot-modules (dep-module "on"))))
  1603. "normal"
  1604. "bootstrap"))))
  1605. ;; We now build the hash table that is used by dep-kind.
  1606. (define boot-modules (make-hash-table 113))
  1607. +]
  1608. [+ FOR host_modules +][+
  1609. (if (exist? "bootstrap")
  1610. (hash-create-handle! boot-modules (get "module") #t))
  1611. "" +][+ ENDFOR host_modules +]
  1612. [+ FOR target_modules +][+
  1613. (if (exist? "bootstrap")
  1614. (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
  1615. "" +][+ ENDFOR target_modules +]
  1616. # With all the machinery above in place, it is pretty easy to generate
  1617. # dependencies. Host dependencies are a bit more complex because we have
  1618. # to check for bootstrap/prebootstrap dependencies. To resolve
  1619. # prebootstrap dependencies, prebootstrap modules are gathered in
  1620. # a hash table.
  1621. [+ FOR dependencies +][+ (make-dep "" "") +]
  1622. [+ CASE (dep-kind) +]
  1623. [+ == "prebootstrap"
  1624. +][+ FOR bootstrap_stage +]
  1625. [+ (make-dep (dep-stage) "") +][+
  1626. ENDFOR bootstrap_stage +]
  1627. [+ == "bootstrap"
  1628. +][+ FOR bootstrap_stage +]
  1629. [+ (make-dep (dep-stage) (dep-stage)) +][+
  1630. ENDFOR bootstrap_stage +]
  1631. [+ ESAC +][+
  1632. ENDFOR dependencies +]
  1633. # Dependencies for target modules on other target modules are
  1634. # described by lang_env_dependencies; the defaults apply to anything
  1635. # not mentioned there.
  1636. [+
  1637. ;; Predicate for whether LANG was specified in lang_env_dependencies.
  1638. (define lang-dep (lambda (lang)
  1639. (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
  1640. ;; Build the hash table we will need.
  1641. (define lang-env-deps (make-hash-table 7))
  1642. +][+ FOR lang_env_dependencies +][+
  1643. (if (exist? "cxx")
  1644. (hash-create-handle! lang-env-deps
  1645. (string-append (get "module") "-" "cxx") #t))
  1646. (if (exist? "no_c")
  1647. (hash-create-handle! lang-env-deps
  1648. (string-append (get "module") "-" "no_c") #t))
  1649. (if (exist? "no_gcc")
  1650. (hash-create-handle! lang-env-deps
  1651. (string-append (get "module") "-" "no_gcc") #t))
  1652. "" +][+ ENDFOR lang_env_dependencies +]
  1653. @if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
  1654. +][+ IF bootstrap +][+ FOR bootstrap_stage +]
  1655. configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
  1656. ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
  1657. @endif gcc-bootstrap
  1658. @if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
  1659. configure-target-[+module+]: maybe-all-target-libgcc[+
  1660. ENDIF +][+ ENDFOR target_modules +]
  1661. @endif gcc-no-bootstrap
  1662. [+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
  1663. configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
  1664. ENDIF +][+ IF (lang-dep "cxx") +]
  1665. configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
  1666. ENDIF +]
  1667. [+ ENDFOR target_modules +]
  1668. CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
  1669. GDB_TK = @GDB_TK@
  1670. INSTALL_GDB_TK = @INSTALL_GDB_TK@
  1671. configure-gdb: $(CONFIGURE_GDB_TK)
  1672. all-gdb: $(gdbnlmrequirements) $(GDB_TK)
  1673. install-gdb: $(INSTALL_GDB_TK)
  1674. # Serialization dependencies. Host configures don't work well in parallel to
  1675. # each other, due to contention over config.cache. Target configures and
  1676. # build configures are similar.
  1677. @serialization_dependencies@
  1678. # --------------------------------
  1679. # Regenerating top level configury
  1680. # --------------------------------
  1681. # Rebuilding Makefile.in, using autogen.
  1682. AUTOGEN = autogen
  1683. $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
  1684. cd $(srcdir) && $(AUTOGEN) Makefile.def
  1685. # Rebuilding Makefile.
  1686. Makefile: $(srcdir)/Makefile.in config.status
  1687. CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
  1688. config.status: configure
  1689. CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
  1690. # Rebuilding configure.
  1691. AUTOCONF = autoconf
  1692. $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
  1693. $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4
  1694. cd $(srcdir) && $(AUTOCONF)
  1695. # ------------------------------
  1696. # Special directives to GNU Make
  1697. # ------------------------------
  1698. # Don't pass command-line variables to submakes.
  1699. .NOEXPORT:
  1700. MAKEOVERRIDES=
  1701. # end of Makefile.in