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