GCC with OpenMP stream-computing extension and BatchQueue algorithm
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.

Makefile.tpl 63KB

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