Makefile.tpl 75 KB

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