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