Makefile.in 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. # Makefile for gnattools
  2. # Copyright 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; see the file COPYING3. If not see
  16. # <http://www.gnu.org/licenses/>.
  17. # Default target; must be first.
  18. all: gnattools
  19. # Standard autoconf-set variables.
  20. SHELL = @SHELL@
  21. srcdir = @srcdir@
  22. libdir = @libdir@
  23. build = @build@
  24. target = @target@
  25. host = @host@
  26. host_alias = @host_alias@
  27. prefix = @prefix@
  28. INSTALL = @INSTALL@
  29. INSTALL_DATA = @INSTALL_DATA@
  30. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  31. # Nonstandard autoconf-set variables.
  32. LN_S=@LN_S@
  33. target_noncanonical=@target_noncanonical@
  34. # Variables for the user (or the top level) to override.
  35. exeext = @EXEEXT@
  36. objext=.o
  37. TRACE=no
  38. ADA_FOR_BUILD=
  39. ADA_FOR_TARGET=
  40. LDFLAGS=
  41. PWD_COMMAND = $${PWDCMD-pwd}
  42. # The tedious process of getting CFLAGS right.
  43. CFLAGS=-g
  44. GCC_WARN_CFLAGS = -W -Wall
  45. WARN_CFLAGS = @warn_cflags@
  46. ADA_CFLAGS=@ADA_CFLAGS@
  47. # Variables for gnattools.
  48. ADAFLAGS= -gnatpg -gnata
  49. # For finding the GCC build dir, which is used far too much
  50. GCC_DIR=../gcc
  51. # Absolute srcdir for gcc (why do we want absolute? I dunno)
  52. fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
  53. # Useful "subroutines" for the excess includes
  54. INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir)/ada -I$(fsrcdir)/config \
  55. -I$(fsrcdir)/../include -I$(fsrcdir)
  56. ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
  57. CXX_LFLAGS = \
  58. -B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
  59. -B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \
  60. -L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
  61. -L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
  62. # Variables for gnattools, native
  63. TOOLS_FLAGS_TO_PASS_NATIVE= \
  64. "CC=../../xgcc -B../../" \
  65. "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
  66. "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
  67. "LDFLAGS=$(LDFLAGS)" \
  68. "ADAFLAGS=$(ADAFLAGS)" \
  69. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  70. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  71. "ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
  72. "exeext=$(exeext)" \
  73. "fsrcdir=$(fsrcdir)" \
  74. "srcdir=$(fsrcdir)" \
  75. "GNATMAKE=../../gnatmake" \
  76. "GNATLINK=../../gnatlink" \
  77. "GNATBIND=../../gnatbind" \
  78. "TOOLSCASE=native"
  79. # Variables for regnattools
  80. TOOLS_FLAGS_TO_PASS_RE= \
  81. "CC=../../xgcc -B../../" \
  82. "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
  83. "CFLAGS=$(CFLAGS)" \
  84. "LDFLAGS=$(LDFLAGS)" \
  85. "ADAFLAGS=$(ADAFLAGS)" \
  86. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  87. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  88. "ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
  89. "exeext=$(exeext)" \
  90. "fsrcdir=$(fsrcdir)" \
  91. "srcdir=$(fsrcdir)" \
  92. "GNATMAKE=../../gnatmake" \
  93. "GNATLINK=../../gnatlink" \
  94. "GNATBIND=../../gnatbind" \
  95. "TOOLSCASE=cross"
  96. # Variables for gnattools, cross
  97. ifeq ($(build), $(host))
  98. GNATMAKE_FOR_HOST=gnatmake
  99. GNATLINK_FOR_HOST=gnatlink
  100. GNATBIND_FOR_HOST=gnatbind
  101. GNATLS_FOR_HOST=gnatls
  102. else
  103. GNATMAKE_FOR_HOST=$(host_alias)-gnatmake
  104. GNATLINK_FOR_HOST=$(host_alias)-gnatlink
  105. GNATBIND_FOR_HOST=$(host_alias)-gnatbind
  106. GNATLS_FOR_HOST=$(host_alias)-gnatls
  107. endif
  108. # Put the host RTS dir first in the PATH to hide the default runtime
  109. # files that are among the sources
  110. RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
  111. TOOLS_FLAGS_TO_PASS_CROSS= \
  112. "CC=$(CC)" \
  113. "CXX=$(CXX)" \
  114. "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
  115. "LDFLAGS=$(LDFLAGS)" \
  116. "ADAFLAGS=$(ADAFLAGS)" \
  117. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  118. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  119. "ADA_INCLUDES=-I$(RTS_DIR)/../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
  120. "exeext=$(exeext)" \
  121. "fsrcdir=$(fsrcdir)" \
  122. "srcdir=$(fsrcdir)" \
  123. "GNATMAKE=$(GNATMAKE_FOR_HOST)" \
  124. "GNATLINK=$(GNATLINK_FOR_HOST)" \
  125. "GNATBIND=$(GNATBIND_FOR_HOST)" \
  126. "TOOLSCASE=cross" \
  127. "LIBGNAT="
  128. # File lists
  129. # ----------
  130. # File associations set by configure
  131. EXTRA_GNATTOOLS = @EXTRA_GNATTOOLS@
  132. TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
  133. # Makefile targets
  134. # ----------------
  135. .PHONY: gnattools gnattools-native gnattools-cross regnattools
  136. gnattools: @default_gnattools_target@
  137. # Sanity check
  138. $(GCC_DIR)/stamp-gnatlib-rts:
  139. @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
  140. then \
  141. echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
  142. false; \
  143. else \
  144. true; \
  145. fi
  146. # Build directory for the tools. Let's copy the target-dependent
  147. # sources using the same mechanism as for gnatlib. The other sources are
  148. # accessed using the vpath directive in ada/Makefile.in
  149. $(GCC_DIR)/stamp-tools:
  150. -rm -rf $(GCC_DIR)/ada/tools
  151. -mkdir -p $(GCC_DIR)/ada/tools
  152. -(cd $(GCC_DIR)/ada/tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .)
  153. -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
  154. rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
  155. $(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
  156. $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
  157. touch $(GCC_DIR)/stamp-tools
  158. # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
  159. # reasons: gnatmake should be built with a recent compiler, a recent compiler
  160. # may not generate ALI files compatible with an old gnatmake so it is important
  161. # to be able to build gnatmake without a version of gnatmake around. Once
  162. # everything has been compiled once, gnatmake can be recompiled with itself
  163. # (see target regnattools)
  164. gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
  165. # gnattools1
  166. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  167. $(TOOLS_FLAGS_TO_PASS_NATIVE) \
  168. ../../gnatmake$(exeext) ../../gnatlink$(exeext)
  169. # gnattools2
  170. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  171. $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
  172. # gnatmake/link can be built with recent gnatmake/link if they are available.
  173. # This is especially convenient for building cross tools or for rebuilding
  174. # the tools when the original bootstrap has already be done.
  175. regnattools: $(GCC_DIR)/stamp-gnatlib-rts
  176. # gnattools1-re
  177. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  178. $(TOOLS_FLAGS_TO_PASS_RE) INCLUDES="" \
  179. gnatmake-re gnatlink-re
  180. # gnattools2
  181. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  182. $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
  183. gnattools-cross: $(GCC_DIR)/stamp-tools
  184. # gnattools1-re
  185. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  186. $(TOOLS_FLAGS_TO_PASS_CROSS) INCLUDES="" \
  187. gnatmake-re gnatlink-re
  188. # gnattools2
  189. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  190. $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
  191. # Rename cross tools to where the GCC makefile wants them when
  192. # installing. FIXME: installation should be done elsewhere.
  193. if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \
  194. mv $(GCC_DIR)/gnatbind$(exeext) $(GCC_DIR)/gnatbind-cross$(exeext); \
  195. fi
  196. if [ -f $(GCC_DIR)/gnatchop$(exeext) ] ; then \
  197. mv $(GCC_DIR)/gnatchop$(exeext) $(GCC_DIR)/gnatchop-cross$(exeext); \
  198. fi
  199. if [ -f $(GCC_DIR)/gnat$(exeext) ] ; then \
  200. mv $(GCC_DIR)/gnat$(exeext) $(GCC_DIR)/gnat-cross$(exeext); \
  201. fi
  202. if [ -f $(GCC_DIR)/gnatkr$(exeext) ] ; then \
  203. mv $(GCC_DIR)/gnatkr$(exeext) $(GCC_DIR)/gnatkr-cross$(exeext); \
  204. fi
  205. if [ -f $(GCC_DIR)/gnatlink$(exeext) ] ; then \
  206. mv $(GCC_DIR)/gnatlink$(exeext) $(GCC_DIR)/gnatlink-cross$(exeext); \
  207. fi
  208. if [ -f $(GCC_DIR)/gnatls$(exeext) ] ; then \
  209. mv $(GCC_DIR)/gnatls$(exeext) $(GCC_DIR)/gnatls-cross$(exeext); \
  210. fi
  211. if [ -f $(GCC_DIR)/gnatmake$(exeext) ] ; then \
  212. mv $(GCC_DIR)/gnatmake$(exeext) $(GCC_DIR)/gnatmake-cross$(exeext); \
  213. fi
  214. if [ -f $(GCC_DIR)/gnatmem$(exeext) ] ; then \
  215. mv $(GCC_DIR)/gnatmem$(exeext) $(GCC_DIR)/gnatmem-cross$(exeext); \
  216. fi
  217. if [ -f $(GCC_DIR)/gnatname$(exeext) ] ; then \
  218. mv $(GCC_DIR)/gnatname$(exeext) $(GCC_DIR)/gnatname-cross$(exeext); \
  219. fi
  220. if [ -f $(GCC_DIR)/gnatprep$(exeext) ] ; then \
  221. mv $(GCC_DIR)/gnatprep$(exeext) $(GCC_DIR)/gnatprep-cross$(exeext); \
  222. fi
  223. if [ -f $(GCC_DIR)/gnatxref$(exeext) ] ; then \
  224. mv $(GCC_DIR)/gnatxref$(exeext) $(GCC_DIR)/gnatxref-cross$(exeext); \
  225. fi
  226. if [ -f $(GCC_DIR)/gnatfind$(exeext) ] ; then \
  227. mv $(GCC_DIR)/gnatfind$(exeext) $(GCC_DIR)/gnatfind-cross$(exeext); \
  228. fi
  229. if [ -f $(GCC_DIR)/gnatclean$(exeext) ] ; then \
  230. mv $(GCC_DIR)/gnatclean$(exeext) $(GCC_DIR)/gnatclean-cross$(exeext); \
  231. fi
  232. if [ -f $(GCC_DIR)/gnatsym$(exeext) ] ; then \
  233. mv $(GCC_DIR)/gnatsym$(exeext) $(GCC_DIR)/gnatsym-cross$(exeext); \
  234. fi
  235. # Other
  236. # -----
  237. # Check uninstalled version.
  238. check:
  239. # Check installed version.
  240. installcheck:
  241. # Build info (none here).
  242. info:
  243. # Build DVI (none here).
  244. dvi:
  245. # Build PDF (none here).
  246. pdf:
  247. # Build HTML (none here).
  248. html:
  249. .PHONY: check installcheck info dvi pdf html
  250. # Build TAGS (none here).
  251. TAGS:
  252. # Installation rules.
  253. install:
  254. install-strip: install
  255. install-info:
  256. install-pdf:
  257. install-html:
  258. .PHONY: install install-strip install-info install-pdf install-html
  259. # Cleaning rules.
  260. mostlyclean:
  261. clean:
  262. distclean:
  263. $(RM) Makefile config.status config.log
  264. maintainer-clean:
  265. .PHONY: mostlyclean clean distclean maintainer-clean
  266. # Rules for rebuilding this Makefile.
  267. Makefile: $(srcdir)/Makefile.in config.status
  268. CONFIG_FILES=$@ ; \
  269. CONFIG_HEADERS= ; \
  270. $(SHELL) ./config.status
  271. config.status: $(srcdir)/configure
  272. $(SHELL) ./config.status --recheck
  273. AUTOCONF = autoconf
  274. configure_deps = \
  275. $(srcdir)/configure.ac \
  276. $(srcdir)/../config/acx.m4 \
  277. $(srcdir)/../config/override.m4
  278. $(srcdir)/configure: @MAINT@ $(configure_deps)
  279. cd $(srcdir) && $(AUTOCONF)
  280. # Don't export variables to the environment, in order to not confuse
  281. # configure.
  282. .NOEXPORT: