]>
Commit | Line | Data |
---|---|---|
8e31204b | 1 | # Makefile for libada. |
f1717362 | 2 | # Copyright (C) 2003-2016 Free Software Foundation, Inc. |
8e31204b | 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 | |
6bc9506f | 6 | # the Free Software Foundation; either version 3 of the License, or |
8e31204b | 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 | |
6bc9506f | 15 | # along with this program; see the file COPYING3. If not see |
16 | # <http://www.gnu.org/licenses/>. | |
8e31204b | 17 | |
18 | # Default target; must be first. | |
a136b23d | 19 | all: gnatlib |
3356431d | 20 | $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE) |
21 | ||
2b7a4d59 | 22 | .PHONY: all |
3356431d | 23 | |
24 | ## Multilib support variables. | |
25 | MULTISRCTOP = | |
26 | MULTIBUILDTOP = | |
27 | MULTIDIRS = | |
28 | MULTISUBDIR = | |
29 | MULTIDO = true | |
30 | MULTICLEAN = true | |
8e31204b | 31 | |
32 | # Standard autoconf-set variables. | |
33 | SHELL = @SHELL@ | |
34 | srcdir = @srcdir@ | |
9a8d280d | 35 | libdir = @libdir@ |
8e31204b | 36 | build = @build@ |
37 | target = @target@ | |
1f83ab49 | 38 | prefix = @prefix@ |
8e31204b | 39 | |
40 | # Nonstandard autoconf-set variables. | |
1f83ab49 | 41 | enable_shared = @enable_shared@ |
8732b645 | 42 | |
1f83ab49 | 43 | LN_S=@LN_S@ |
8732b645 | 44 | AWK=@AWK@ |
1f83ab49 | 45 | |
1dca4715 | 46 | ifeq (cp -p,$(LN_S)) |
47 | LN_S_RECURSIVE = cp -pR | |
48 | else | |
49 | LN_S_RECURSIVE = $(LN_S) | |
50 | endif | |
51 | ||
1f83ab49 | 52 | # Variables for the user (or the top level) to override. |
53 | objext=.o | |
1f83ab49 | 54 | THREAD_KIND=native |
55 | TRACE=no | |
1f83ab49 | 56 | LDFLAGS= |
1f83ab49 | 57 | |
58 | # The tedious process of getting CFLAGS right. | |
59 | CFLAGS=-g | |
d89b8910 | 60 | PICFLAG = @PICFLAG@ |
95e40d0c | 61 | GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc |
9a8d280d | 62 | GNATLIBCFLAGS= -g -O2 |
04c96bbc | 63 | GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \ |
95e40d0c | 64 | -fexceptions -DIN_RTS @have_getipinfo@ |
8e31204b | 65 | |
f0903548 | 66 | host_subdir = @host_subdir@ |
3356431d | 67 | GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc |
8e31204b | 68 | |
a1303bd0 | 69 | target_noncanonical:=@target_noncanonical@ |
70 | version := $(shell cat $(srcdir)/../gcc/BASE-VER) | |
3356431d | 71 | libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) |
4b095fbd | 72 | ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) |
a1c1db7f | 73 | ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR)) |
a1303bd0 | 74 | |
9a8d280d | 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 | |
a1303bd0 | 79 | LIBADA_FLAGS_TO_PASS = \ |
1f83ab49 | 80 | "MAKEOVERRIDES=" \ |
81 | "LDFLAGS=$(LDFLAGS)" \ | |
82 | "LN_S=$(LN_S)" \ | |
83 | "SHELL=$(SHELL)" \ | |
3356431d | 84 | "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ |
85 | "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ | |
53c7fb87 | 86 | "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ |
d89b8910 | 87 | "PICFLAG_FOR_TARGET=$(PICFLAG)" \ |
a1303bd0 | 88 | "THREAD_KIND=$(THREAD_KIND)" \ |
89 | "TRACE=$(TRACE)" \ | |
3356431d | 90 | "MULTISUBDIR=$(MULTISUBDIR)" \ |
a1303bd0 | 91 | "libsubdir=$(libsubdir)" \ |
1f83ab49 | 92 | "objext=$(objext)" \ |
93 | "prefix=$(prefix)" \ | |
9a8d280d | 94 | "exeext=.exeext.should.not.be.used " \ |
95 | 'CC=the.host.compiler.should.not.be.needed' \ | |
782bd3b1 | 96 | "GCC_FOR_TARGET=$(CC)" \ |
95e40d0c | 97 | "CFLAGS=$(CFLAGS)" |
1f83ab49 | 98 | |
8e31204b | 99 | # Rules to build gnatlib. |
a1c1db7f | 100 | .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool |
1f83ab49 | 101 | gnatlib: @default_gnatlib_target@ |
102 | ||
98982d6d | 103 | gnatlib-plain: osconstool $(GCC_DIR)/ada/Makefile |
a136b23d | 104 | test -f stamp-libada || \ |
a1303bd0 | 105 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \ |
a136b23d | 106 | && touch stamp-libada |
00f6be43 | 107 | -rm -rf adainclude |
108 | -rm -rf adalib | |
1dca4715 | 109 | $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude |
110 | $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib | |
1f83ab49 | 111 | |
98982d6d | 112 | gnatlib-sjlj gnatlib-zcx gnatlib-shared: osconstool $(GCC_DIR)/ada/Makefile |
a136b23d | 113 | test -f stamp-libada || \ |
a1303bd0 | 114 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \ |
a136b23d | 115 | && touch stamp-libada |
00f6be43 | 116 | -rm -rf adainclude |
117 | -rm -rf adalib | |
1dca4715 | 118 | $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude |
119 | $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib | |
5026857e | 120 | |
98982d6d | 121 | osconstool: |
52dae6f4 | 122 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) ./bldtools/oscons/xoscons |
98982d6d | 123 | |
a1303bd0 | 124 | install-gnatlib: $(GCC_DIR)/ada/Makefile |
125 | $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib | |
96b387a5 | 126 | |
8e31204b | 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 | ||
0274b253 | 139 | # Build PDF (none here). |
140 | pdf: | |
141 | ||
d77007e7 | 142 | # Build html (none here). |
143 | html: | |
144 | ||
8e31204b | 145 | # Build TAGS (none here). |
146 | TAGS: | |
147 | ||
2b7a4d59 | 148 | .PHONY: check installcheck info dvi pdf html |
149 | ||
8e31204b | 150 | # Installation rules. |
3356431d | 151 | install: install-gnatlib |
152 | $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE) | |
8e31204b | 153 | |
2b7a4d59 | 154 | install-strip: install |
155 | ||
8e31204b | 156 | install-info: |
157 | ||
9fd31a8e | 158 | install-pdf: |
159 | ||
155becb8 | 160 | install-html: |
161 | ||
2b7a4d59 | 162 | .PHONY: install install-strip install-info install-pdf install-html |
163 | ||
8e31204b | 164 | # Cleaning rules. |
165 | mostlyclean: | |
3356431d | 166 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE) |
8e31204b | 167 | |
168 | clean: | |
3356431d | 169 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE) |
8e31204b | 170 | |
171 | distclean: | |
3356431d | 172 | $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE) |
8e31204b | 173 | $(RM) Makefile config.status config.log |
174 | ||
175 | maintainer-clean: | |
176 | ||
2b7a4d59 | 177 | .PHONY: mostlyclean clean distclean maintainer-clean |
178 | ||
8e31204b | 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 | ||
a2655af1 | 188 | AUTOCONF = autoconf |
189 | configure_deps = \ | |
190 | $(srcdir)/configure.ac \ | |
191 | $(srcdir)/../config/acx.m4 \ | |
192 | $(srcdir)/../config/override.m4 \ | |
193 | $(srcdir)/../config/multi.m4 | |
194 | ||
195 | $(srcdir)/configure: @MAINT@ $(configure_deps) | |
196 | cd $(srcdir) && $(AUTOCONF) | |
428b4753 | 197 | |
198 | # Don't export variables to the environment, in order to not confuse | |
199 | # configure. | |
200 | .NOEXPORT: |