Makefile.tpl 67 KB

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