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