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