Makefile.in 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. prefix = @prefix@
  27. INSTALL = @INSTALL@
  28. INSTALL_DATA = @INSTALL_DATA@
  29. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  30. # Nonstandard autoconf-set variables.
  31. LN_S=@LN_S@
  32. target_noncanonical=@target_noncanonical@
  33. host_noncanonical=@host_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. # Full path to top source directory
  52. ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
  53. # Absolute srcdir for gcc (why do we want absolute? I dunno)
  54. fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
  55. # Useful "subroutines" for the excess includes
  56. INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
  57. -iquote $(fsrcdir)/ada -iquote $(fsrcdir)/config \
  58. -iquote $(fsrcdir) -I$(ftop_srcdir)/include
  59. ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
  60. CXX_LFLAGS = \
  61. -B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
  62. -B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \
  63. -L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
  64. -L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
  65. # Variables for gnattools, native
  66. TOOLS_FLAGS_TO_PASS_NATIVE= \
  67. "CC=../../xgcc -B../../" \
  68. "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
  69. "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
  70. "LDFLAGS=$(LDFLAGS)" \
  71. "ADAFLAGS=$(ADAFLAGS)" \
  72. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  73. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  74. "ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
  75. "exeext=$(exeext)" \
  76. "fsrcdir=$(fsrcdir)" \
  77. "srcdir=$(fsrcdir)" \
  78. "GNATMAKE=../../gnatmake" \
  79. "GNATLINK=../../gnatlink" \
  80. "GNATBIND=../../gnatbind" \
  81. "TOOLSCASE=native"
  82. # Variables for regnattools
  83. TOOLS_FLAGS_TO_PASS_RE= \
  84. "CC=../../xgcc -B../../" \
  85. "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
  86. "CFLAGS=$(CFLAGS)" \
  87. "LDFLAGS=$(LDFLAGS)" \
  88. "ADAFLAGS=$(ADAFLAGS)" \
  89. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  90. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  91. "ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
  92. "exeext=$(exeext)" \
  93. "fsrcdir=$(fsrcdir)" \
  94. "srcdir=$(fsrcdir)" \
  95. "GNATMAKE=../../gnatmake" \
  96. "GNATLINK=../../gnatlink" \
  97. "GNATBIND=../../gnatbind" \
  98. "TOOLSCASE=cross"
  99. # Variables for gnattools, cross
  100. ifeq ($(build), $(host))
  101. GNATMAKE_FOR_HOST=gnatmake
  102. GNATLINK_FOR_HOST=gnatlink
  103. GNATBIND_FOR_HOST=gnatbind
  104. GNATLS_FOR_HOST=gnatls
  105. else
  106. GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake
  107. GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
  108. GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
  109. GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
  110. endif
  111. # Put the host RTS dir first in the PATH to hide the default runtime
  112. # files that are among the sources
  113. RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
  114. TOOLS_FLAGS_TO_PASS_CROSS= \
  115. "CC=$(CC)" \
  116. "CXX=$(CXX)" \
  117. "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
  118. "LDFLAGS=$(LDFLAGS)" \
  119. "ADAFLAGS=$(ADAFLAGS)" \
  120. "ADA_CFLAGS=$(ADA_CFLAGS)" \
  121. "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
  122. "ADA_INCLUDES=-I$(RTS_DIR)/../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
  123. "exeext=$(exeext)" \
  124. "fsrcdir=$(fsrcdir)" \
  125. "srcdir=$(fsrcdir)" \
  126. "GNATMAKE=$(GNATMAKE_FOR_HOST)" \
  127. "GNATLINK=$(GNATLINK_FOR_HOST)" \
  128. "GNATBIND=$(GNATBIND_FOR_HOST)" \
  129. "TOOLSCASE=cross" \
  130. "LIBGNAT="
  131. # File lists
  132. # ----------
  133. # File associations set by configure
  134. EXTRA_GNATTOOLS = @EXTRA_GNATTOOLS@
  135. TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
  136. # Makefile targets
  137. # ----------------
  138. .PHONY: gnattools gnattools-native gnattools-cross regnattools
  139. gnattools: @default_gnattools_target@
  140. # Sanity check
  141. $(GCC_DIR)/stamp-gnatlib-rts:
  142. @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
  143. then \
  144. echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
  145. false; \
  146. else \
  147. true; \
  148. fi
  149. # Build directory for the tools. We first need to copy the generated files,
  150. # then the target-dependent sources using the same mechanism as for gnatlib.
  151. GENERATED_FILES_FOR_TOOLS = \
  152. einfo-entities.ads einfo-entities.adb sdefault.adb seinfo.ads \
  153. sinfo-nodes.ads sinfo-nodes.adb snames.ads snames.adb
  154. $(GCC_DIR)/stamp-tools:
  155. -rm -rf $(GCC_DIR)/ada/tools
  156. -mkdir -p $(GCC_DIR)/ada/tools
  157. -(cd $(GCC_DIR)/ada/tools; $(foreach FILE,$(GENERATED_FILES_FOR_TOOLS), \
  158. $(LN_S) ../$(FILE) $(FILE);))
  159. -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
  160. rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
  161. $(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
  162. $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
  163. touch $(GCC_DIR)/stamp-tools
  164. # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
  165. # reasons: gnatmake should be built with a recent compiler, a recent compiler
  166. # may not generate ALI files compatible with an old gnatmake so it is important
  167. # to be able to build gnatmake without a version of gnatmake around. Once
  168. # everything has been compiled once, gnatmake can be recompiled with itself
  169. # (see target regnattools)
  170. gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
  171. # gnattools1
  172. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  173. $(TOOLS_FLAGS_TO_PASS_NATIVE) \
  174. ../../gnatmake$(exeext) ../../gnatlink$(exeext)
  175. # gnattools2
  176. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  177. $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
  178. # gnatmake/link can be built with recent gnatmake/link if they are available.
  179. # This is especially convenient for building cross tools or for rebuilding
  180. # the tools when the original bootstrap has already be done.
  181. regnattools: $(GCC_DIR)/stamp-gnatlib-rts
  182. # gnattools1-re
  183. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  184. $(TOOLS_FLAGS_TO_PASS_RE) INCLUDES="" \
  185. gnatmake-re gnatlink-re
  186. # gnattools2
  187. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  188. $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
  189. gnattools-cross: $(GCC_DIR)/stamp-tools
  190. # gnattools1-re
  191. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  192. $(TOOLS_FLAGS_TO_PASS_CROSS) INCLUDES="" \
  193. gnatmake-re gnatlink-re
  194. # gnattools2
  195. $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
  196. $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
  197. # Other
  198. # -----
  199. # Check uninstalled version.
  200. check:
  201. # Check installed version.
  202. installcheck:
  203. # Build info (none here).
  204. info:
  205. # Build DVI (none here).
  206. dvi:
  207. # Build PDF (none here).
  208. pdf:
  209. # Build HTML (none here).
  210. html:
  211. .PHONY: check installcheck info dvi pdf html
  212. # Build TAGS (none here).
  213. TAGS:
  214. # Installation rules.
  215. install:
  216. install-strip: install
  217. install-info:
  218. install-pdf:
  219. install-dvi:
  220. install-html:
  221. .PHONY: install install-strip install-info install-pdf install-dvi install-html
  222. # Cleaning rules.
  223. mostlyclean:
  224. clean:
  225. distclean:
  226. $(RM) Makefile config.status config.log config.cache
  227. maintainer-clean:
  228. .PHONY: mostlyclean clean distclean maintainer-clean
  229. # Rules for rebuilding this Makefile.
  230. Makefile: $(srcdir)/Makefile.in config.status
  231. CONFIG_FILES=$@ ; \
  232. CONFIG_HEADERS= ; \
  233. $(SHELL) ./config.status
  234. config.status: $(srcdir)/configure
  235. $(SHELL) ./config.status --recheck
  236. AUTOCONF = autoconf
  237. configure_deps = \
  238. $(srcdir)/configure.ac \
  239. $(srcdir)/../config/acx.m4 \
  240. $(srcdir)/../config/override.m4
  241. $(srcdir)/configure: @MAINT@ $(configure_deps)
  242. cd $(srcdir) && $(AUTOCONF)
  243. # Don't export variables to the environment, in order to not confuse
  244. # configure.
  245. .NOEXPORT: