]>
Commit | Line | Data |
---|---|---|
b0b70d84 | 1 | # Makefile for libada. |
e3aa9eba | 2 | # Copyright 2003, 2004, 2009, 2010, 2011 Free Software Foundation, Inc. |
b0b70d84 AC |
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 | |
748086b7 | 6 | # the Free Software Foundation; either version 3 of the License, or |
b0b70d84 AC |
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 | |
748086b7 JJ |
15 | # along with this program; see the file COPYING3. If not see |
16 | # <http://www.gnu.org/licenses/>. | |
b0b70d84 AC |
17 | |
18 | # Default target; must be first. | |
5395b47b | 19 | all: gnatlib |
7193e639 LG |
20 | $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE) |
21 | ||
455c8f48 | 22 | .PHONY: all |
7193e639 LG |
23 | |
24 | ## Multilib support variables. | |
25 | MULTISRCTOP = | |
26 | MULTIBUILDTOP = | |
27 | MULTIDIRS = | |
28 | MULTISUBDIR = | |
29 | MULTIDO = true | |
30 | MULTICLEAN = true | |
b0b70d84 AC |
31 | |
32 | # Standard autoconf-set variables. | |
33 | SHELL = @SHELL@ | |
34 | srcdir = @srcdir@ | |
47ad7893 | 35 | libdir = @libdir@ |
7d78d5a6 | 36 | bindir = @bindir@ |
b0b70d84 AC |
37 | build = @build@ |
38 | target = @target@ | |
80dab182 | 39 | prefix = @prefix@ |
b0b70d84 AC |
40 | |
41 | # Nonstandard autoconf-set variables. | |
80dab182 | 42 | enable_shared = @enable_shared@ |
c390c361 | 43 | |
80dab182 | 44 | LN_S=@LN_S@ |
c390c361 | 45 | AWK=@AWK@ |
80dab182 NN |
46 | |
47 | # Variables for the user (or the top level) to override. | |
48 | objext=.o | |
80dab182 NN |
49 | THREAD_KIND=native |
50 | TRACE=no | |
80dab182 | 51 | LDFLAGS= |
80dab182 NN |
52 | |
53 | # The tedious process of getting CFLAGS right. | |
54 | CFLAGS=-g | |
e3aa9eba | 55 | PICFLAG = @PICFLAG@ |
0cfaf83f | 56 | GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc |
47ad7893 | 57 | GNATLIBCFLAGS= -g -O2 |
0cfaf83f EB |
58 | GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(PICFLAG) \ |
59 | -fexceptions -DIN_RTS @have_getipinfo@ | |
b0b70d84 | 60 | |
9bd6112c | 61 | host_subdir = @host_subdir@ |
7193e639 | 62 | GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc |
b0b70d84 | 63 | |
f62b28a9 LG |
64 | target_noncanonical:=@target_noncanonical@ |
65 | version := $(shell cat $(srcdir)/../gcc/BASE-VER) | |
7193e639 | 66 | libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) |
6d63ea75 | 67 | ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) |
5f41422f | 68 | ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR)) |
f62b28a9 | 69 | |
47ad7893 PB |
70 | # exeext should not be used because it's the *host* exeext. We're building |
71 | # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus | |
72 | # definitions just in case something slips through the safety net provided | |
73 | # by recursive make invocations in gcc/ada/Makefile.in | |
f62b28a9 | 74 | LIBADA_FLAGS_TO_PASS = \ |
80dab182 NN |
75 | "MAKEOVERRIDES=" \ |
76 | "LDFLAGS=$(LDFLAGS)" \ | |
77 | "LN_S=$(LN_S)" \ | |
78 | "SHELL=$(SHELL)" \ | |
7193e639 LG |
79 | "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ |
80 | "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ | |
2f18d9af | 81 | "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ |
e3aa9eba | 82 | "PICFLAG_FOR_TARGET=$(PICFLAG)" \ |
f62b28a9 LG |
83 | "THREAD_KIND=$(THREAD_KIND)" \ |
84 | "TRACE=$(TRACE)" \ | |
7193e639 | 85 | "MULTISUBDIR=$(MULTISUBDIR)" \ |
f62b28a9 | 86 | "libsubdir=$(libsubdir)" \ |
7d78d5a6 | 87 | "bindir=$(bindir)" \ |
80dab182 NN |
88 | "objext=$(objext)" \ |
89 | "prefix=$(prefix)" \ | |
47ad7893 PB |
90 | "exeext=.exeext.should.not.be.used " \ |
91 | 'CC=the.host.compiler.should.not.be.needed' \ | |
40077270 | 92 | "GCC_FOR_TARGET=$(CC)" \ |
0cfaf83f | 93 | "CFLAGS=$(CFLAGS)" |
80dab182 | 94 | |
b0b70d84 | 95 | # Rules to build gnatlib. |
5f41422f | 96 | .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool |
80dab182 NN |
97 | gnatlib: @default_gnatlib_target@ |
98 | ||
5f41422f | 99 | gnatlib-plain: osconstool $(GCC_DIR)/ada/Makefile |
5395b47b | 100 | test -f stamp-libada || \ |
f62b28a9 | 101 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \ |
5395b47b | 102 | && touch stamp-libada |
5c00e6a0 LG |
103 | -rm -rf adainclude |
104 | -rm -rf adalib | |
6d63ea75 LG |
105 | $(LN_S) $(ADA_RTS_DIR) adainclude |
106 | $(LN_S) $(ADA_RTS_DIR) adalib | |
80dab182 | 107 | |
5f41422f | 108 | gnatlib-sjlj gnatlib-zcx gnatlib-shared: osconstool $(GCC_DIR)/ada/Makefile |
5395b47b | 109 | test -f stamp-libada || \ |
f62b28a9 | 110 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \ |
5395b47b | 111 | && touch stamp-libada |
5c00e6a0 LG |
112 | -rm -rf adainclude |
113 | -rm -rf adalib | |
6d63ea75 LG |
114 | $(LN_S) $(ADA_RTS_DIR) adainclude |
115 | $(LN_S) $(ADA_RTS_DIR) adalib | |
e9f4e557 | 116 | |
5f41422f IS |
117 | osconstool: |
118 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) ./bldtools/oscons/xoscons | |
f62b28a9 LG |
119 | |
120 | install-gnatlib: $(GCC_DIR)/ada/Makefile | |
121 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib | |
c336d2c7 | 122 | |
b0b70d84 AC |
123 | # Check uninstalled version. |
124 | check: | |
125 | ||
126 | # Check installed version. | |
127 | installcheck: | |
128 | ||
129 | # Build info (none here). | |
130 | info: | |
131 | ||
132 | # Build DVI (none here). | |
133 | dvi: | |
134 | ||
a8384928 BM |
135 | # Build PDF (none here). |
136 | pdf: | |
137 | ||
01a1e85a JW |
138 | # Build html (none here). |
139 | html: | |
140 | ||
b0b70d84 AC |
141 | # Build TAGS (none here). |
142 | TAGS: | |
143 | ||
455c8f48 RW |
144 | .PHONY: check installcheck info dvi pdf html |
145 | ||
b0b70d84 | 146 | # Installation rules. |
7193e639 LG |
147 | install: install-gnatlib |
148 | $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE) | |
b0b70d84 | 149 | |
455c8f48 RW |
150 | install-strip: install |
151 | ||
b0b70d84 AC |
152 | install-info: |
153 | ||
00189cc6 BM |
154 | install-pdf: |
155 | ||
312e3fcb CD |
156 | install-html: |
157 | ||
455c8f48 RW |
158 | .PHONY: install install-strip install-info install-pdf install-html |
159 | ||
b0b70d84 AC |
160 | # Cleaning rules. |
161 | mostlyclean: | |
7193e639 | 162 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE) |
b0b70d84 AC |
163 | |
164 | clean: | |
7193e639 | 165 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE) |
b0b70d84 AC |
166 | |
167 | distclean: | |
7193e639 | 168 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE) |
b0b70d84 AC |
169 | $(RM) Makefile config.status config.log |
170 | ||
171 | maintainer-clean: | |
172 | ||
455c8f48 RW |
173 | .PHONY: mostlyclean clean distclean maintainer-clean |
174 | ||
b0b70d84 AC |
175 | # Rules for rebuilding this Makefile. |
176 | Makefile: $(srcdir)/Makefile.in config.status | |
177 | CONFIG_FILES=$@ ; \ | |
178 | CONFIG_HEADERS= ; \ | |
179 | $(SHELL) ./config.status | |
180 | ||
181 | config.status: $(srcdir)/configure | |
182 | $(SHELL) ./config.status --recheck | |
183 | ||
6efbd53f RW |
184 | AUTOCONF = autoconf |
185 | configure_deps = \ | |
186 | $(srcdir)/configure.ac \ | |
187 | $(srcdir)/../config/acx.m4 \ | |
188 | $(srcdir)/../config/override.m4 \ | |
189 | $(srcdir)/../config/multi.m4 | |
190 | ||
191 | $(srcdir)/configure: @MAINT@ $(configure_deps) | |
192 | cd $(srcdir) && $(AUTOCONF) | |
54b2f310 DJ |
193 | |
194 | # Don't export variables to the environment, in order to not confuse | |
195 | # configure. | |
196 | .NOEXPORT: |