A C standard library for sh3eb-elf.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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