Commit | Line | Data |
---|---|---|
eb02fd64 | 1 | # |
131a3881 | 2 | # Makefile for directory with subdirs to build. |
79337c85 | 3 | # Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation |
eb02fd64 | 4 | # |
4dfe09da RP |
5 | # This file is free software; you can redistribute it and/or modify |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
8c222f6e | 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4dfe09da | 18 | # |
f149eb99 | 19 | |
eb02fd64 | 20 | srcdir = . |
28f3b094 | 21 | |
4d714963 | 22 | prefix = /usr/local |
eb02fd64 | 23 | |
7fcfdcf7 SC |
24 | exec_prefix = $(prefix) |
25 | bindir = $(exec_prefix)/bin | |
26 | libdir = $(exec_prefix)/lib | |
a54e05f6 | 27 | tooldir = $(exec_prefix)/$(target) |
7fcfdcf7 | 28 | |
51489233 ILT |
29 | program_transform_name = |
30 | ||
4d714963 | 31 | datadir = $(prefix)/lib |
7fcfdcf7 | 32 | mandir = $(prefix)/man |
4d714963 RP |
33 | man1dir = $(mandir)/man1 |
34 | man2dir = $(mandir)/man2 | |
35 | man3dir = $(mandir)/man3 | |
36 | man4dir = $(mandir)/man4 | |
37 | man5dir = $(mandir)/man5 | |
38 | man6dir = $(mandir)/man6 | |
39 | man7dir = $(mandir)/man7 | |
40 | man8dir = $(mandir)/man8 | |
41 | man9dir = $(mandir)/man9 | |
7fcfdcf7 | 42 | infodir = $(prefix)/info |
4d714963 RP |
43 | includedir = $(prefix)/include |
44 | docdir = $(datadir)/doc | |
04103845 | 45 | GDB_NLM_DEPS = |
4d714963 RP |
46 | |
47 | SHELL = /bin/sh | |
48 | ||
f35c6160 | 49 | INSTALL = $${srcroot}/install.sh -c |
4d714963 | 50 | INSTALL_PROGRAM = $(INSTALL) |
5cc73086 | 51 | INSTALL_DATA = $(INSTALL) -m 644 |
fe560b9f | 52 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
3c8735af | 53 | |
09985c96 | 54 | INSTALL_DOSREL = install-dosrel-fake |
a987271c | 55 | |
440868a0 | 56 | AS = as |
ec342d7d | 57 | AR = ar |
b5329d84 | 58 | AR_FLAGS = rc |
e85e07cb | 59 | CC = cc |
7b636683 | 60 | |
66957ce4 ILT |
61 | # Special variables passed down in EXTRA_GCC_FLAGS. They are defined |
62 | # here so that they can be overridden by Makefile fragments. | |
753d5049 SC |
63 | HOST_CC = $(CC_FOR_BUILD) |
64 | HOST_PREFIX = | |
65 | HOST_PREFIX_1 = loser- | |
66 | ||
7b636683 JK |
67 | # We don't specify -g -O because many compilers don't support -g -O, |
68 | # and/or -O is broken in and of itself. | |
f8a6ad66 | 69 | CFLAGS = -g |
3585593d BK |
70 | LIBCFLAGS = $(CFLAGS) |
71 | CFLAGS_FOR_TARGET = $(CFLAGS) | |
72 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | |
04103845 DE |
73 | PICFLAG = |
74 | PICFLAG_FOR_TARGET = | |
7b636683 | 75 | |
a4e879a1 | 76 | # start-sanitize-chill |
7d9f0c54 MW |
77 | CHILLFLAGS = $(CFLAGS) |
78 | CHILL_LIB = -lchill | |
a4e879a1 | 79 | # end-sanitize-chill |
e85e07cb | 80 | CXX = gcc |
7b636683 | 81 | |
1d5fcc66 | 82 | # Use -O2 to stress test the compiler. |
864a5888 PB |
83 | CXXFLAGS = -g -O2 |
84 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
3585593d | 85 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) |
2f64ef77 | 86 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates |
7b636683 | 87 | |
4d714963 | 88 | RANLIB = ranlib |
b6ae0f10 ILT |
89 | |
90 | DLLTOOL = dlltool | |
91 | ||
51489233 | 92 | NM = nm |
5cc73086 KR |
93 | # Not plain GZIP, since gzip looks there for extra command-line options. |
94 | GZIPPROG = gzip | |
eb02fd64 | 95 | |
aaefc574 JM |
96 | # These values are substituted by configure. |
97 | DEFAULT_YACC = yacc | |
98 | DEFAULT_LEX = lex | |
99 | ||
40e16078 | 100 | # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove. |
5cc73086 KR |
101 | BISON = `if [ -f $$r/byacc/byacc ] ; \ |
102 | then echo $$r/byacc/byacc ; \ | |
aaefc574 | 103 | else echo ${DEFAULT_YACC} ; \ |
06a07944 | 104 | fi` |
2645fb0c | 105 | |
5cc73086 KR |
106 | LEX = `if [ -f $$r/flex/flex ] ; \ |
107 | then echo $$r/flex/flex ; \ | |
aaefc574 | 108 | else echo ${DEFAULT_LEX} ; fi` |
2198e4ba | 109 | |
5cc73086 KR |
110 | M4 = `if [ -f $$r/m4/m4 ] ; \ |
111 | then echo $$r/m4/m4 ; \ | |
65e21701 KR |
112 | else echo m4 ; fi` |
113 | ||
5cc73086 KR |
114 | MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ |
115 | then echo $$r/texinfo/makeinfo/makeinfo ; \ | |
77806c3e | 116 | else echo makeinfo ; fi` |
484fa12d | 117 | |
9823504d ILT |
118 | # This just becomes part of the MAKEINFO definition passed down to |
119 | # sub-makes. It lets flags be given on the command line while still | |
120 | # using the makeinfo from the object tree. | |
121 | MAKEINFOFLAGS = | |
b772d75e | 122 | |
5cc73086 KR |
123 | EXPECT = `if [ -f $$r/expect/expect ] ; \ |
124 | then echo $$r/expect/expect ; \ | |
a54e05f6 KR |
125 | else echo expect ; fi` |
126 | ||
127 | RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \ | |
128 | then echo $${srcroot}/dejagnu/runtest ; \ | |
6a42d184 DZ |
129 | else echo runtest ; fi` |
130 | ||
f980fcfb | 131 | |
e85e07cb | 132 | # compilers to use to create programs which must be run in the build |
440868a0 ILT |
133 | # environment. |
134 | CC_FOR_BUILD = $(CC) | |
e85e07cb | 135 | CXX_FOR_BUILD = $(CXX) |
440868a0 | 136 | |
9f73dd6a | 137 | SUBDIRS = "this is set via configure, don't edit this" |
6a3958b2 RP |
138 | OTHERS = |
139 | ||
ca2ce3b3 ILT |
140 | # This is set by the configure script to the list of directories which |
141 | # should be built using the target tools. | |
ab1cbc67 | 142 | TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup |
ca2ce3b3 | 143 | |
e66eb658 PB |
144 | # Target libraries are put under this directory: |
145 | TARGET_SUBDIR = . # Changed by configure to $(target_alias) if cross. | |
146 | ||
ca2ce3b3 ILT |
147 | # This is set by the configure script to the arguments passed to configure. |
148 | CONFIG_ARGUMENTS = | |
149 | ||
b6ae0f10 ILT |
150 | # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared |
151 | # was used. | |
152 | SET_LIB_PATH = | |
153 | ||
154 | # This is the name of the environment variable used for the path to | |
155 | # the libraries. This may be changed by configure.in. | |
156 | RPATH_ENVVAR = LD_LIBRARY_PATH | |
157 | ||
158 | # configure.in sets SET_LIB_PATH to this if --enable-shared was used. | |
159 | REALLY_SET_LIB_PATH = \ | |
160 | $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \ | |
161 | export $(RPATH_ENVVAR); | |
162 | ||
a0f47eb7 | 163 | ALL = all.normal |
f35c6160 DZ |
164 | INSTALL_TARGET = install-dirs \ |
165 | $(INSTALL_MODULES) \ | |
166 | $(INSTALL_TARGET_MODULES) \ | |
167 | $(INSTALL_X11_MODULES) \ | |
753d5049 | 168 | install-gcc \ |
09985c96 | 169 | $(INSTALL_DOSREL) |
753d5049 | 170 | |
fb660409 | 171 | |
51489233 | 172 | CC_FOR_TARGET = ` \ |
5cc73086 | 173 | if [ -f $$r/gcc/Makefile ] ; then \ |
e66eb658 PB |
174 | if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ |
175 | echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \ | |
753d5049 SC |
176 | else \ |
177 | echo $$r/gcc/xgcc -B$$r/gcc/; \ | |
178 | fi; \ | |
51489233 | 179 | else \ |
378fd382 | 180 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
181 | echo $(CC); \ |
182 | else \ | |
ea6d5817 | 183 | t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ |
51489233 ILT |
184 | fi; \ |
185 | fi` | |
186 | ||
a4e879a1 | 187 | # start-sanitize-chill |
7d9f0c54 | 188 | CHILL_FOR_TARGET = ` \ |
5cc73086 | 189 | if [ -f $$r/gcc/Makefile ] ; then \ |
04103845 | 190 | echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \ |
7d9f0c54 MW |
191 | else \ |
192 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
193 | echo $(CC); \ | |
194 | else \ | |
ea6d5817 | 195 | t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ |
7d9f0c54 MW |
196 | fi; \ |
197 | fi` | |
34b3298b | 198 | |
a4e879a1 | 199 | # end-sanitize-chill |
7d9f0c54 | 200 | |
d1bea4c7 | 201 | CXX_FOR_TARGET = ` \ |
5cc73086 | 202 | if [ -f $$r/gcc/Makefile ] ; then \ |
e66eb658 PB |
203 | if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ |
204 | echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \ | |
753d5049 SC |
205 | else \ |
206 | echo $$r/gcc/xgcc -B$$r/gcc/; \ | |
207 | fi; \ | |
fca4f908 | 208 | else \ |
e85e07cb ILT |
209 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
210 | echo $(CXX); \ | |
fca4f908 | 211 | else \ |
ea6d5817 | 212 | t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ |
fca4f908 MW |
213 | fi; \ |
214 | fi` | |
215 | ||
440868a0 | 216 | AS_FOR_TARGET = ` \ |
ea6d5817 | 217 | if [ -f $$r/gas/as.new ] ; then \ |
5cc73086 | 218 | echo $$r/gas/as.new ; \ |
440868a0 | 219 | else \ |
e85e07cb | 220 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
440868a0 ILT |
221 | echo $(AS); \ |
222 | else \ | |
ea6d5817 | 223 | t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \ |
81246025 | 224 | fi; \ |
440868a0 ILT |
225 | fi` |
226 | ||
054f9ada JM |
227 | LD_FOR_TARGET = ` \ |
228 | if [ -f $$r/ld/ld.new ] ; then \ | |
229 | echo $$r/ld/ld.new ; \ | |
230 | else \ | |
231 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
232 | echo $(LD); \ | |
233 | else \ | |
234 | t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \ | |
235 | fi; \ | |
236 | fi` | |
237 | ||
a220ba0f SC |
238 | DLLTOOL_FOR_TARGET = ` \ |
239 | if [ -f $$r/binutils/dlltool ] ; then \ | |
240 | echo $$r/binutils/dlltool ; \ | |
241 | else \ | |
242 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
243 | echo $(DLLTOOL); \ | |
244 | else \ | |
245 | t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \ | |
246 | fi; \ | |
247 | fi` | |
248 | ||
51489233 | 249 | AR_FOR_TARGET = ` \ |
5cc73086 KR |
250 | if [ -f $$r/binutils/ar ] ; then \ |
251 | echo $$r/binutils/ar ; \ | |
51489233 | 252 | else \ |
378fd382 | 253 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
254 | echo $(AR); \ |
255 | else \ | |
ea6d5817 | 256 | t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \ |
81246025 | 257 | fi; \ |
51489233 ILT |
258 | fi` |
259 | ||
260 | RANLIB_FOR_TARGET = ` \ | |
5cc73086 KR |
261 | if [ -f $$r/binutils/ranlib ] ; then \ |
262 | echo $$r/binutils/ranlib ; \ | |
51489233 | 263 | else \ |
378fd382 | 264 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
265 | echo $(RANLIB); \ |
266 | else \ | |
ea6d5817 | 267 | t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \ |
81246025 | 268 | fi; \ |
51489233 ILT |
269 | fi` |
270 | ||
271 | NM_FOR_TARGET = ` \ | |
ea6d5817 | 272 | if [ -f $$r/binutils/nm.new ] ; then \ |
753d5049 | 273 | echo $$r/binutils/nm.new ; \ |
51489233 | 274 | else \ |
378fd382 | 275 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
276 | echo $(NM); \ |
277 | else \ | |
ea6d5817 | 278 | t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \ |
81246025 | 279 | fi; \ |
51489233 ILT |
280 | fi` |
281 | ||
eb02fd64 | 282 | #### host and target specific makefile fragments come in here. |
ec342d7d | 283 | ### |
eb02fd64 | 284 | |
0ef4728f ILT |
285 | # Flags to pass down to all sub-makes. |
286 | # Please keep these in alphabetical order. | |
287 | BASE_FLAGS_TO_PASS = \ | |
2198e4ba | 288 | "AR_FLAGS=$(AR_FLAGS)" \ |
d09de70e | 289 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ |
0ef4728f | 290 | "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ |
378fd382 | 291 | "BISON=$(BISON)" \ |
378fd382 | 292 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ |
0ef4728f | 293 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ |
2198e4ba | 294 | "CFLAGS=$(CFLAGS)" \ |
3585593d | 295 | "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ |
a4e879a1 | 296 | $(start-sanitize-chill)\ |
7d9f0c54 MW |
297 | "CHILLFLAGS=$(CHILLFLAGS)" \ |
298 | "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \ | |
299 | "CHILL_LIB=$(CHILL_LIB)" \ | |
a4e879a1 | 300 | $(end-sanitize-chill)\ |
0ef4728f ILT |
301 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ |
302 | "CXXFLAGS=$(CXXFLAGS)" \ | |
3585593d | 303 | "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ |
0ef4728f | 304 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ |
a220ba0f | 305 | "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ |
a9a2f22f | 306 | "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \ |
2198e4ba MT |
307 | "INSTALL=$(INSTALL)" \ |
308 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
440868a0 | 309 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ |
f35c6160 | 310 | "INSTALL_XFORM=$(INSTALL_XFORM)" \ |
378fd382 DZ |
311 | "LDFLAGS=$(LDFLAGS)" \ |
312 | "LEX=$(LEX)" \ | |
054f9ada | 313 | "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ |
3585593d BK |
314 | "LIBCFLAGS=$(LIBCFLAGS)" \ |
315 | "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ | |
04103845 DE |
316 | "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ |
317 | "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ | |
65e21701 | 318 | "M4=$(M4)" \ |
9823504d | 319 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ |
0ef4728f | 320 | "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ |
04103845 DE |
321 | "PICFLAG=$(PICFLAG)" \ |
322 | "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ | |
d09de70e | 323 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ |
49dfa984 | 324 | "SHELL=$(SHELL)" \ |
a54e05f6 | 325 | "EXPECT=$(EXPECT)" \ |
6a42d184 | 326 | "RUNTEST=$(RUNTEST)" \ |
86365152 | 327 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ |
5cc73086 | 328 | "YACC=$(BISON)" \ |
378fd382 DZ |
329 | "exec_prefix=$(exec_prefix)" \ |
330 | "prefix=$(prefix)" \ | |
331 | "tooldir=$(tooldir)" | |
2198e4ba | 332 | |
0ef4728f ILT |
333 | # Flags to pass down to most sub-makes, in which we're building with |
334 | # the host environment. | |
6d681784 | 335 | # If any variables are added here, they must be added to do-*, below. |
0ef4728f | 336 | EXTRA_HOST_FLAGS = \ |
6d681784 JG |
337 | 'AR=$(AR)' \ |
338 | 'AS=$(AS)' \ | |
339 | 'CC=$(CC)' \ | |
340 | 'CXX=$(CXX)' \ | |
b6ae0f10 | 341 | 'DLLTOOL=$(DLLTOOL)' \ |
6d681784 | 342 | 'NM=$(NM)' \ |
b6ae0f10 ILT |
343 | 'RANLIB=$(RANLIB)' |
344 | ||
0ef4728f ILT |
345 | |
346 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
347 | ||
d1bea4c7 DZ |
348 | # Flags that are concerned with the location of the X11 include files |
349 | # and library files | |
054f9ada JM |
350 | # |
351 | # NOTE: until the top-level is getting the values via autoconf, it only | |
352 | # causes problems to have this top-level Makefile overriding the autoconf-set | |
353 | # values in child directories. Only variables that don't conflict with | |
354 | # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now. | |
355 | # | |
d1bea4c7 | 356 | X11_FLAGS_TO_PASS = \ |
054f9ada JM |
357 | 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ |
358 | 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' | |
d1bea4c7 | 359 | |
0ef4728f ILT |
360 | # Flags to pass down to makes which are built with the target environment. |
361 | # The double $ decreases the length of the command line; the variables | |
362 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. | |
6d681784 | 363 | # If any variables are added here, they must be added to do-*, below. |
0ef4728f ILT |
364 | EXTRA_TARGET_FLAGS = \ |
365 | 'AR=$$(AR_FOR_TARGET)' \ | |
366 | 'AS=$$(AS_FOR_TARGET)' \ | |
367 | 'CC=$$(CC_FOR_TARGET)' \ | |
3585593d | 368 | 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ |
0ef4728f | 369 | 'CXX=$$(CXX_FOR_TARGET)' \ |
3585593d | 370 | 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ |
a220ba0f | 371 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ |
054f9ada | 372 | 'LD=$$(LD_FOR_TARGET)' \ |
3585593d BK |
373 | 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ |
374 | 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | |
0ef4728f | 375 | 'NM=$$(NM_FOR_TARGET)' \ |
04103845 | 376 | 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \ |
753d5049 | 377 | 'RANLIB=$$(RANLIB_FOR_TARGET)' |
0ef4728f ILT |
378 | |
379 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
51489233 | 380 | |
f4e414f1 ILT |
381 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it |
382 | # unfortunately needs the native compiler and the target ar and | |
0ef4728f | 383 | # ranlib. |
66957ce4 ILT |
384 | # If any variables are added here, they must be added to do-*, below. |
385 | # The HOST_* variables are a special case, which are used for the gcc | |
386 | # cross-building scheme. | |
0ef4728f ILT |
387 | EXTRA_GCC_FLAGS = \ |
388 | 'AR=$$(AR_FOR_TARGET)' \ | |
6d681784 JG |
389 | 'AS=$(AS)' \ |
390 | 'CC=$(CC)' \ | |
391 | 'CXX=$(CXX)' \ | |
b6ae0f10 | 392 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ |
a54e05f6 KR |
393 | 'HOST_CC=$(CC_FOR_BUILD)' \ |
394 | 'HOST_PREFIX=$(HOST_PREFIX)' \ | |
395 | 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \ | |
6d681784 | 396 | 'NM=$(NM)' \ |
4c0b7ebc DE |
397 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ |
398 | `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \ | |
399 | `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \ | |
400 | `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \ | |
401 | `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \ | |
402 | `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \ | |
403 | `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \ | |
404 | `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \ | |
405 | `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi` | |
0ef4728f | 406 | |
34b3298b | 407 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) |
f4e414f1 | 408 | |
6a42d184 | 409 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
410 | # using $(FLAGS_TO_PASS). |
411 | ALL_MODULES = \ | |
412 | all-autoconf \ | |
413 | all-bfd \ | |
414 | all-binutils \ | |
415 | all-byacc \ | |
416 | all-cvs \ | |
417 | all-dejagnu \ | |
418 | all-diff \ | |
ac259c28 | 419 | all-dosutils \ |
79337c85 ILT |
420 | all-etc \ |
421 | all-fileutils \ | |
422 | all-find \ | |
423 | all-flex \ | |
424 | all-gas \ | |
425 | all-gawk \ | |
79337c85 ILT |
426 | all-gprof \ |
427 | all-grep \ | |
19b1d034 | 428 | all-grez \ |
79337c85 ILT |
429 | all-gzip \ |
430 | all-hello \ | |
431 | all-indent \ | |
432 | all-ispell \ | |
433 | all-ld \ | |
434 | all-libiberty \ | |
435 | all-m4 \ | |
436 | all-make \ | |
437 | all-mmalloc \ | |
438 | all-opcodes \ | |
439 | all-patch \ | |
0f8f1d33 | 440 | all-perl \ |
79337c85 ILT |
441 | all-prms \ |
442 | all-rcs \ | |
443 | all-readline \ | |
275049c0 | 444 | all-release \ |
79337c85 ILT |
445 | all-recode \ |
446 | all-sed \ | |
447 | all-send-pr \ | |
448 | all-shellutils \ | |
449 | all-sim \ | |
450 | all-tar \ | |
451 | all-tcl \ | |
452 | all-texinfo \ | |
453 | all-textutils \ | |
454 | all-tgas \ | |
455 | all-time \ | |
456 | all-uudecode \ | |
753d5049 SC |
457 | all-wdiff |
458 | ||
6a42d184 DZ |
459 | # This is a list of the check targets for all of the modules which are |
460 | # compiled using $(FLAGS_TO_PASS). | |
4f0b8f27 TL |
461 | # This is a list of the check targets for all of the modules which are |
462 | # compiled using $(FLAGS_TO_PASS). | |
463 | # | |
d237841c BC |
464 | # The list is in two parts. The first lists those tools which |
465 | # are tested as part of the host's native tool-chain, and not | |
466 | # tested in a cross configuration. | |
467 | NATIVE_CHECK_MODULES = \ | |
468 | check-byacc \ | |
4f0b8f27 TL |
469 | check-flex |
470 | ||
d237841c | 471 | CROSS_CHECK_MODULES = \ |
6a42d184 DZ |
472 | check-autoconf \ |
473 | check-bfd \ | |
474 | check-binutils \ | |
6a42d184 DZ |
475 | check-cvs \ |
476 | check-dejagnu \ | |
477 | check-diff \ | |
478 | check-etc \ | |
479 | check-fileutils \ | |
480 | check-find \ | |
6a42d184 DZ |
481 | check-gas \ |
482 | check-gawk \ | |
6a42d184 DZ |
483 | check-gprof \ |
484 | check-grep \ | |
485 | check-gzip \ | |
486 | check-hello \ | |
487 | check-indent \ | |
488 | check-ispell \ | |
489 | check-ld \ | |
490 | check-libiberty \ | |
491 | check-m4 \ | |
492 | check-make \ | |
493 | check-mmcheckoc \ | |
494 | check-opcodes \ | |
495 | check-patch \ | |
0f8f1d33 | 496 | check-perl \ |
6a42d184 DZ |
497 | check-prms \ |
498 | check-rcs \ | |
499 | check-readline \ | |
500 | check-recode \ | |
501 | check-sed \ | |
502 | check-send-pr \ | |
503 | check-shellutils \ | |
504 | check-sim \ | |
505 | check-tar \ | |
506 | check-tcl \ | |
507 | check-texinfo \ | |
508 | check-textutils \ | |
509 | check-tgas \ | |
510 | check-time \ | |
511 | check-uudecode \ | |
512 | check-wdiff | |
d237841c BC |
513 | |
514 | CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) | |
6a42d184 DZ |
515 | |
516 | # This is a list of the install targets for all of the modules which are | |
79337c85 ILT |
517 | # compiled using $(FLAGS_TO_PASS). |
518 | INSTALL_MODULES = \ | |
519 | install-autoconf \ | |
520 | install-bfd \ | |
521 | install-binutils \ | |
522 | install-byacc \ | |
523 | install-cvs \ | |
524 | install-dejagnu \ | |
525 | install-diff \ | |
753d5049 | 526 | install-dosutils \ |
79337c85 ILT |
527 | install-etc \ |
528 | install-fileutils \ | |
529 | install-find \ | |
530 | install-flex \ | |
531 | install-gas \ | |
532 | install-gawk \ | |
79337c85 ILT |
533 | install-gprof \ |
534 | install-grep \ | |
19b1d034 | 535 | install-grez \ |
79337c85 ILT |
536 | install-gzip \ |
537 | install-hello \ | |
538 | install-indent \ | |
539 | install-ispell \ | |
540 | install-ld \ | |
541 | install-libiberty \ | |
542 | install-m4 \ | |
543 | install-make \ | |
544 | install-mmalloc \ | |
545 | install-opcodes \ | |
546 | install-patch \ | |
0f8f1d33 | 547 | install-perl \ |
79337c85 ILT |
548 | install-prms \ |
549 | install-rcs \ | |
550 | install-readline \ | |
551 | install-recode \ | |
552 | install-sed \ | |
553 | install-send-pr \ | |
554 | install-shellutils \ | |
555 | install-sim \ | |
556 | install-tar \ | |
557 | install-tcl \ | |
558 | install-texinfo \ | |
559 | install-textutils \ | |
560 | install-tgas \ | |
561 | install-time \ | |
562 | install-uudecode \ | |
563 | install-wdiff | |
564 | ||
6a42d184 | 565 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
566 | # using $(X11_FLAGS_TO_PASS). |
567 | ALL_X11_MODULES = \ | |
568 | all-emacs \ | |
4d802af9 | 569 | all-emacs19 \ |
04103845 | 570 | all-gdb \ |
79337c85 | 571 | all-expect \ |
65e21701 | 572 | all-gash \ |
0f8f1d33 | 573 | all-guile \ |
79337c85 ILT |
574 | all-tclX \ |
575 | all-tk | |
576 | ||
6a42d184 DZ |
577 | # This is a list of the check targets for all of the modules which are |
578 | # compiled using $(X11_FLAGS_TO_PASS). | |
579 | CHECK_X11_MODULES = \ | |
580 | check-emacs \ | |
04103845 | 581 | check-gdb \ |
0f8f1d33 | 582 | check-guile \ |
6a42d184 | 583 | check-expect \ |
65e21701 | 584 | check-gash \ |
6a42d184 DZ |
585 | check-tclX \ |
586 | check-tk | |
587 | ||
79337c85 ILT |
588 | # This is a list of the install targets for all the modules which are |
589 | # compiled using $(X11_FLAGS_TO_PASS). | |
590 | INSTALL_X11_MODULES = \ | |
591 | install-emacs \ | |
4d802af9 | 592 | install-emacs19 \ |
04103845 | 593 | install-gdb \ |
0f8f1d33 | 594 | install-guile \ |
79337c85 | 595 | install-expect \ |
65e21701 | 596 | install-gash \ |
79337c85 ILT |
597 | install-tclX \ |
598 | install-tk | |
fca4f908 | 599 | |
6a42d184 | 600 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
601 | # using $(TARGET_FLAGS_TO_PASS). |
602 | ALL_TARGET_MODULES = \ | |
ab1cbc67 PB |
603 | all-target-libio \ |
604 | all-target-libstdc++ \ | |
605 | all-target-librx \ | |
606 | all-target-libg++ \ | |
607 | all-target-newlib \ | |
608 | all-target-winsup \ | |
609 | all-target-libgloss \ | |
4c0b7ebc DE |
610 | all-target-libiberty \ |
611 | all-target-examples | |
79337c85 | 612 | |
ca2ce3b3 ILT |
613 | # This is a list of the configure targets for all of the modules which |
614 | # are compiled using the target tools. | |
615 | CONFIGURE_TARGET_MODULES = \ | |
ab1cbc67 PB |
616 | configure-target-libio \ |
617 | configure-target-libstdc++ \ | |
618 | configure-target-librx \ | |
619 | configure-target-libg++ \ | |
620 | configure-target-newlib \ | |
621 | configure-target-winsup \ | |
622 | configure-target-libgloss \ | |
4c0b7ebc DE |
623 | configure-target-libiberty \ |
624 | configure-target-examples | |
ca2ce3b3 | 625 | |
6a42d184 DZ |
626 | # This is a list of the check targets for all of the modules which are |
627 | # compiled using $(TARGET_FLAGS_TO_PASS). | |
628 | CHECK_TARGET_MODULES = \ | |
ab1cbc67 PB |
629 | check-target-libio \ |
630 | check-target-libstdc++ \ | |
631 | check-target-libg++ \ | |
632 | check-target-newlib \ | |
633 | check-target-winsup \ | |
634 | check-target-libiberty | |
6a42d184 DZ |
635 | |
636 | # This is a list of the install targets for all of the modules which are | |
79337c85 ILT |
637 | # compiled using $(TARGET_FLAGS_TO_PASS). |
638 | INSTALL_TARGET_MODULES = \ | |
ab1cbc67 PB |
639 | install-target-libio \ |
640 | install-target-libstdc++ \ | |
641 | install-target-libg++ \ | |
642 | install-target-newlib \ | |
643 | install-target-winsup \ | |
644 | install-target-libgloss \ | |
645 | install-target-libiberty | |
7481617f | 646 | |
79337c85 | 647 | # The first rule in the file had better be this one. Don't put any above it. |
a59b94d2 | 648 | all: all.normal |
79337c85 ILT |
649 | .PHONY: all |
650 | ||
651 | # The target built for a native build. | |
652 | .PHONY: all.normal | |
653 | all.normal: \ | |
654 | $(ALL_MODULES) \ | |
655 | $(ALL_TARGET_MODULES) \ | |
46d0ca81 | 656 | $(ALL_X11_MODULES) \ |
79337c85 ILT |
657 | all-gcc |
658 | ||
0ef4728f | 659 | # Do a target for all the subdirectories. A ``make do-X'' will do a |
53222cbd RP |
660 | # ``make X'' in all subdirectories (because, in general, there is a |
661 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
662 | # but it may do additional work as well). | |
0ef4728f ILT |
663 | # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, |
664 | # because it is so large that it can easily overflow the command line | |
665 | # length limit on some systems. | |
79337c85 | 666 | DO_X = \ |
79337c85 ILT |
667 | do-clean \ |
668 | do-distclean \ | |
669 | do-dvi \ | |
670 | do-info \ | |
671 | do-install-info \ | |
672 | do-installcheck \ | |
673 | do-mostlyclean \ | |
ca2ce3b3 | 674 | do-maintainer-clean \ |
753d5049 | 675 | do-TAGS |
79337c85 ILT |
676 | .PHONY: $(DO_X) |
677 | $(DO_X): | |
0ef4728f | 678 | @target=`echo $@ | sed -e 's/^do-//'`; \ |
5cc73086 | 679 | r=`pwd`; export r; \ |
0ef4728f | 680 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 681 | $(SET_LIB_PATH) \ |
ab1cbc67 | 682 | for i in $(SUBDIRS) -dummy-; do \ |
36286a3e | 683 | if [ -f ./$$i/Makefile ]; then \ |
0ef4728f | 684 | case $$i in \ |
0ef4728f | 685 | gcc) \ |
6d681784 | 686 | for flag in $(EXTRA_GCC_FLAGS); do \ |
0f8f1d33 | 687 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ |
6d681784 | 688 | done; \ |
0ef4728f ILT |
689 | ;; \ |
690 | *) \ | |
6d681784 | 691 | for flag in $(EXTRA_HOST_FLAGS); do \ |
0f8f1d33 | 692 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ |
6d681784 | 693 | done; \ |
0ef4728f ILT |
694 | ;; \ |
695 | esac ; \ | |
b6ae0f10 | 696 | export AR AS CC CXX NM RANLIB DLLTOOL; \ |
0ef4728f | 697 | if (cd ./$$i; \ |
6d681784 JG |
698 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
699 | "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \ | |
753d5049 | 700 | "RANLIB=$${RANLIB}" \ |
b6ae0f10 | 701 | "DLLTOOL=$${DLLTOOL}" \ |
6d681784 | 702 | $${target}); \ |
0ef4728f ILT |
703 | then true; else exit 1; fi; \ |
704 | else true; fi; \ | |
ec7a8792 ILT |
705 | done |
706 | @target=`echo $@ | sed -e 's/^do-//'`; \ | |
707 | r=`pwd`; export r; \ | |
708 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 709 | $(SET_LIB_PATH) \ |
ab1cbc67 PB |
710 | for i in $(TARGET_CONFIGDIRS) -dummy-; do \ |
711 | if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ | |
712 | for flag in $(EXTRA_TARGET_FLAGS); do \ | |
0f8f1d33 | 713 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ |
ab1cbc67 | 714 | done; \ |
b6ae0f10 | 715 | export AR AS CC CXX NM RANLIB DLLTOOL; \ |
ab1cbc67 PB |
716 | if (cd $(TARGET_SUBDIR)/$$i; \ |
717 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
718 | "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \ | |
719 | "RANLIB=$${RANLIB}" \ | |
b6ae0f10 | 720 | "DLLTOOL=$${DLLTOOL}" \ |
ab1cbc67 PB |
721 | $${target}); \ |
722 | then true; else exit 1; fi; \ | |
723 | else true; fi; \ | |
0ef4728f | 724 | done |
fb90daeb | 725 | |
79337c85 ILT |
726 | # Here are the targets which correspond to the do-X targets. |
727 | ||
65088029 | 728 | .PHONY: info installcheck dvi install-info |
ca2ce3b3 ILT |
729 | .PHONY: clean distclean mostlyclean maintainer-clean realclean |
730 | .PHONY: local-clean local-distclean local-maintainer-clean | |
0ef4728f | 731 | info: do-info |
1a14993c | 732 | installcheck: do-installcheck |
0ef4728f | 733 | dvi: do-dvi |
9a9e8e7f | 734 | |
f35c6160 DZ |
735 | install-info: do-install-info dir.info |
736 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
72c09fbc SC |
737 | if [ -f dir.info ] ; then \ |
738 | $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \ | |
50fbe976 | 739 | else true ; fi |
4d714963 | 740 | |
0ef4728f | 741 | local-clean: |
7fed4078 | 742 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E |
3b30df82 | 743 | |
0ef4728f | 744 | local-distclean: |
7fed4078 | 745 | -rm -f Makefile config.status |
8c5bc3e3 ILT |
746 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
747 | rm -rf $(TARGET_SUBDIR); \ | |
748 | else true; fi | |
7fcfdcf7 | 749 | |
ca2ce3b3 ILT |
750 | local-maintainer-clean: |
751 | @echo "This command is intended for maintainers to use;" | |
752 | @echo "it deletes files that may require special tools to rebuild." | |
753 | ||
0ef4728f ILT |
754 | clean: do-clean local-clean |
755 | mostlyclean: do-mostlyclean local-clean | |
756 | distclean: do-distclean local-clean local-distclean | |
ca2ce3b3 ILT |
757 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean |
758 | maintainer-clean: local-distclean | |
759 | realclean: maintainer-clean | |
0ef4728f | 760 | |
65088029 ILT |
761 | # Check target. |
762 | ||
763 | .PHONY: check | |
764 | check: $(CHECK_MODULES) \ | |
765 | $(CHECK_TARGET_MODULES) \ | |
766 | $(CHECK_X11_MODULES) \ | |
767 | check-gcc | |
768 | ||
79337c85 | 769 | # Installation targets. |
4d714963 | 770 | |
04103845 | 771 | .PHONY: install uninstall source-vault binary-vault vault-install |
98a33b6d | 772 | install: $(INSTALL_TARGET) |
b26ff9d8 | 773 | |
79337c85 ILT |
774 | uninstall: |
775 | @echo "the uninstall target is not supported in this tree" | |
776 | ||
04103845 DE |
777 | source-vault: |
778 | $(MAKE) -f ./release/Build-A-Release \ | |
779 | host=$(host_alias) source-vault | |
780 | ||
781 | binary-vault: | |
782 | $(MAKE) -f ./release/Build-A-Release \ | |
783 | host=$(host_alias) target=$(target_alias) | |
784 | ||
275049c0 JK |
785 | vault-install: |
786 | @if [ -f ./release/vault-install ] ; then \ | |
787 | ./release/vault-install $(host_alias) $(target_alias) ; \ | |
96bfa612 KR |
788 | else \ |
789 | true ; \ | |
275049c0 JK |
790 | fi |
791 | ||
79337c85 | 792 | .PHONY: install.all |
06a07944 RP |
793 | install.all: install-no-fixedincludes |
794 | @if [ -f ./gcc/Makefile ] ; then \ | |
5cc73086 | 795 | r=`pwd` ; export r ; \ |
b6ae0f10 | 796 | $(SET_LIB_PATH) \ |
06a07944 RP |
797 | (cd ./gcc; \ |
798 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ | |
799 | else \ | |
800 | true ; \ | |
801 | fi | |
5a63b336 | 802 | |
96bfa612 | 803 | # install-no-fixedincludes is used because Cygnus can not distribute |
79337c85 ILT |
804 | # the fixed header files. |
805 | .PHONY: install-no-fixedincludes | |
806 | install-no-fixedincludes: \ | |
807 | install-dirs \ | |
79337c85 ILT |
808 | $(INSTALL_MODULES) \ |
809 | $(INSTALL_TARGET_MODULES) \ | |
96bfa612 | 810 | $(INSTALL_X11_MODULES) \ |
f35c6160 | 811 | gcc-no-fixedincludes |
d1bea4c7 | 812 | |
5cc24596 | 813 | # Install the gcc headers files, but not the fixed include files, |
79337c85 ILT |
814 | # which Cygnus is not allowed to distribute. This rule is very |
815 | # dependent on the workings of the gcc Makefile.in. | |
816 | .PHONY: gcc-no-fixedincludes | |
06a07944 | 817 | gcc-no-fixedincludes: |
5cc24596 PB |
818 | @if [ -f ./gcc/Makefile ]; then \ |
819 | rm -rf gcc/tmp-include; \ | |
820 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
821 | mkdir gcc/include; \ | |
7f9cb3b2 | 822 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ |
753d5049 | 823 | touch gcc/stmp-fixinc gcc/include/fixed; \ |
a54e05f6 | 824 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ |
5cc73086 | 825 | r=`pwd`; export r; \ |
5cc24596 | 826 | srcroot=`cd $(srcdir); pwd` ; export srcroot; \ |
b6ae0f10 | 827 | $(SET_LIB_PATH) \ |
5cc24596 PB |
828 | (cd ./gcc; \ |
829 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ | |
830 | rm -rf gcc/include; \ | |
831 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
832 | else true; fi | |
dcbfc14d | 833 | |
79337c85 ILT |
834 | # This rule is used to build the modules which use FLAGS_TO_PASS. To |
835 | # build a target all-X means to cd to X and make all. | |
3de70f1d | 836 | # |
055cca84 | 837 | # all-gui, and all-libproc are handled specially because |
4d802af9 MT |
838 | # they are still experimental, and if they fail to build, that |
839 | # shouldn't stop "make all". | |
04103845 DE |
840 | .PHONY: $(ALL_MODULES) all-gui all-libproc |
841 | $(ALL_MODULES) all-gui all-libproc: | |
79337c85 | 842 | @dir=`echo $@ | sed -e 's/all-//'`; \ |
472af17f ILT |
843 | if [ -f ./$${dir}/Makefile ] ; then \ |
844 | r=`pwd`; export r; \ | |
845 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 846 | $(SET_LIB_PATH) \ |
472af17f | 847 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ |
07362bd9 | 848 | else \ |
79337c85 | 849 | true; \ |
07362bd9 DZ |
850 | fi |
851 | ||
80cbf870 ILT |
852 | # These rules are used to check the modules which use FLAGS_TO_PASS. |
853 | # To build a target check-X means to cd to X and make check. Some | |
854 | # modules are only tested in a native toolchain. | |
4f0b8f27 | 855 | |
d237841c BC |
856 | .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) |
857 | $(NATIVE_CHECK_MODULES): | |
39cc6dae RS |
858 | @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
859 | dir=`echo $@ | sed -e 's/check-//'`; \ | |
472af17f ILT |
860 | if [ -f ./$${dir}/Makefile ] ; then \ |
861 | r=`pwd`; export r; \ | |
862 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 863 | $(SET_LIB_PATH) \ |
472af17f ILT |
864 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ |
865 | else \ | |
866 | true; \ | |
4f0b8f27 TL |
867 | fi; \ |
868 | fi | |
869 | ||
870 | $(CROSS_CHECK_MODULES): | |
6a42d184 DZ |
871 | @dir=`echo $@ | sed -e 's/check-//'`; \ |
872 | if [ -f ./$${dir}/Makefile ] ; then \ | |
5cc73086 | 873 | r=`pwd`; export r; \ |
6a42d184 | 874 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 875 | $(SET_LIB_PATH) \ |
6a42d184 DZ |
876 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ |
877 | else \ | |
878 | true; \ | |
879 | fi | |
880 | ||
79337c85 ILT |
881 | # This rule is used to install the modules which use FLAGS_TO_PASS. |
882 | # To build a target install-X means to cd to X and make install. | |
883 | .PHONY: $(INSTALL_MODULES) | |
884 | $(INSTALL_MODULES): install-dirs | |
885 | @dir=`echo $@ | sed -e 's/install-//'`; \ | |
886 | if [ -f ./$${dir}/Makefile ] ; then \ | |
5cc73086 | 887 | r=`pwd`; export r; \ |
79337c85 | 888 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 889 | $(SET_LIB_PATH) \ |
f35c6160 | 890 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ |
07362bd9 | 891 | else \ |
79337c85 | 892 | true; \ |
07362bd9 DZ |
893 | fi |
894 | ||
ca2ce3b3 ILT |
895 | # This rule is used to configure the modules which are built with the |
896 | # target tools. | |
897 | .PHONY: $(CONFIGURE_TARGET_MODULES) | |
898 | $(CONFIGURE_TARGET_MODULES): | |
ab1cbc67 PB |
899 | @dir=`echo $@ | sed -e 's/configure-target-//'`; \ |
900 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ | |
ca2ce3b3 ILT |
901 | true; \ |
902 | elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ | |
efd7b806 | 903 | if [ -d $(srcdir)/$${dir} ]; then \ |
ab1cbc67 | 904 | [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\ |
efd7b806 SC |
905 | r=`pwd`; export r; \ |
906 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 907 | $(SET_LIB_PATH) \ |
efd7b806 SC |
908 | AR="$(AR_FOR_TARGET)"; export AR; \ |
909 | AS="$(AS_FOR_TARGET)"; export AS; \ | |
910 | CC="$(CC_FOR_TARGET)"; export CC; \ | |
911 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | |
912 | CXX="$(CXX_FOR_TARGET)"; export CXX; \ | |
913 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | |
b6ae0f10 | 914 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ |
054f9ada | 915 | LD="$(LD_FOR_TARGET)"; export LD; \ |
efd7b806 SC |
916 | NM="$(NM_FOR_TARGET)"; export NM; \ |
917 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ | |
19b1d034 | 918 | echo Configuring in $(TARGET_SUBDIR)/$${dir}; \ |
ab1cbc67 | 919 | cd $(TARGET_SUBDIR)/$${dir}; \ |
283a2b3d DE |
920 | case $(srcdir) in \ |
921 | /*) \ | |
922 | topdir=$(srcdir) ;; \ | |
923 | *) \ | |
924 | case "$(TARGET_SUBDIR)" in \ | |
925 | .) topdir="../$(srcdir)" ;; \ | |
926 | *) topdir="../../$(srcdir)" ;; \ | |
927 | esac ;; \ | |
928 | esac; \ | |
929 | if [ "$(srcdir)" = "." ] ; then \ | |
930 | if [ "$(TARGET_SUBDIR)" != "." ] ; then \ | |
0f8f1d33 TT |
931 | if $(SHELL) $${srcroot}/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ |
932 | if [ -f Makefile ]; then \ | |
933 | if $(MAKE) distclean; then \ | |
934 | true; \ | |
935 | else \ | |
936 | exit 1; \ | |
937 | fi; \ | |
938 | else \ | |
939 | true; \ | |
940 | fi; \ | |
283a2b3d DE |
941 | else \ |
942 | exit 1; \ | |
943 | fi; \ | |
944 | else \ | |
945 | true; \ | |
946 | fi; \ | |
947 | srcdiroption="--srcdir=."; \ | |
948 | libsrcdir="."; \ | |
949 | else \ | |
950 | srcdiroption="--srcdir=$${topdir}/$${dir}"; \ | |
951 | libsrcdir="$${srcroot}/$${dir}"; \ | |
952 | fi; \ | |
953 | if [ -f $${libsrcdir}/configure ] ; then \ | |
954 | $(SHELL) $${libsrcdir}/configure \ | |
955 | $(CONFIG_ARGUMENTS) $${srcdiroption} \ | |
956 | --with-target-subdir="$(TARGET_SUBDIR)"; \ | |
19b1d034 | 957 | else \ |
283a2b3d DE |
958 | $(SHELL) $${srcroot}/configure \ |
959 | $(CONFIG_ARGUMENTS) $${srcdiroption} \ | |
960 | --with-target-subdir="$(TARGET_SUBDIR)"; \ | |
19b1d034 | 961 | fi; \ |
efd7b806 SC |
962 | else \ |
963 | true; \ | |
9908eb6a | 964 | fi; \ |
ca2ce3b3 ILT |
965 | else \ |
966 | true; \ | |
967 | fi | |
968 | ||
6a42d184 DZ |
969 | # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS. |
970 | # To build a target all-X means to cd to X and make all. | |
79337c85 ILT |
971 | .PHONY: $(ALL_TARGET_MODULES) |
972 | $(ALL_TARGET_MODULES): | |
ab1cbc67 PB |
973 | @dir=`echo $@ | sed -e 's/all-target-//'`; \ |
974 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ | |
5cc73086 | 975 | r=`pwd`; export r; \ |
79337c85 | 976 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 977 | $(SET_LIB_PATH) \ |
ab1cbc67 | 978 | (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ |
07362bd9 | 979 | else \ |
79337c85 | 980 | true; \ |
07362bd9 DZ |
981 | fi |
982 | ||
6a42d184 DZ |
983 | # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS. |
984 | # To build a target install-X means to cd to X and make install. | |
985 | .PHONY: $(CHECK_TARGET_MODULES) | |
986 | $(CHECK_TARGET_MODULES): | |
136ca05d | 987 | @dir=`echo $@ | sed -e 's/check-target-//'`; \ |
ab1cbc67 | 988 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ |
5cc73086 | 989 | r=`pwd`; export r; \ |
6a42d184 | 990 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 991 | $(SET_LIB_PATH) \ |
ab1cbc67 | 992 | (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ |
6a42d184 DZ |
993 | else \ |
994 | true; \ | |
995 | fi | |
996 | ||
79337c85 ILT |
997 | # This rule is used to install the modules which use |
998 | # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X | |
999 | # and make install. | |
1000 | .PHONY: $(INSTALL_TARGET_MODULES) | |
1001 | $(INSTALL_TARGET_MODULES): install-dirs | |
ab1cbc67 PB |
1002 | @dir=`echo $@ | sed -e 's/install-target-//'`; \ |
1003 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ | |
5cc73086 | 1004 | r=`pwd`; export r; \ |
79337c85 | 1005 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1006 | $(SET_LIB_PATH) \ |
ab1cbc67 PB |
1007 | (cd $(TARGET_SUBDIR)/$${dir}; \ |
1008 | $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ | |
07362bd9 | 1009 | else \ |
79337c85 | 1010 | true; \ |
07362bd9 DZ |
1011 | fi |
1012 | ||
6a42d184 | 1013 | # This rule is used to build the modules which use X11_FLAGS_TO_PASS. |
79337c85 ILT |
1014 | # To build a target all-X means to cd to X and make all. |
1015 | .PHONY: $(ALL_X11_MODULES) | |
1016 | $(ALL_X11_MODULES): | |
1017 | @dir=`echo $@ | sed -e 's/all-//'`; \ | |
1018 | if [ -f ./$${dir}/Makefile ] ; then \ | |
5cc73086 | 1019 | r=`pwd`; export r; \ |
79337c85 | 1020 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1021 | $(SET_LIB_PATH) \ |
79337c85 ILT |
1022 | (cd $${dir}; \ |
1023 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \ | |
07362bd9 | 1024 | else \ |
79337c85 | 1025 | true; \ |
07362bd9 DZ |
1026 | fi |
1027 | ||
6a42d184 DZ |
1028 | # This rule is used to check the modules which use X11_FLAGS_TO_PASS. |
1029 | # To build a target check-X means to cd to X and make all. | |
1030 | .PHONY: $(CHECK_X11_MODULES) | |
1031 | $(CHECK_X11_MODULES): | |
1032 | @dir=`echo $@ | sed -e 's/check-//'`; \ | |
1033 | if [ -f ./$${dir}/Makefile ] ; then \ | |
5cc73086 | 1034 | r=`pwd`; export r; \ |
6a42d184 | 1035 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1036 | $(SET_LIB_PATH) \ |
6a42d184 DZ |
1037 | (cd $${dir}; \ |
1038 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \ | |
1039 | else \ | |
1040 | true; \ | |
1041 | fi | |
1042 | ||
1043 | # This rule is used to install the modules which use X11_FLAGS_TO_PASS. | |
79337c85 ILT |
1044 | # To build a target install-X means to cd to X and make install. |
1045 | .PHONY: $(INSTALL_X11_MODULES) | |
1046 | $(INSTALL_X11_MODULES): | |
6a42d184 | 1047 | @dir=`echo $@ | sed -e 's/install-//'`; \ |
79337c85 | 1048 | if [ -f ./$${dir}/Makefile ] ; then \ |
5cc73086 | 1049 | r=`pwd`; export r; \ |
79337c85 | 1050 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1051 | $(SET_LIB_PATH) \ |
79337c85 ILT |
1052 | (cd $${dir}; \ |
1053 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \ | |
07362bd9 | 1054 | else \ |
79337c85 | 1055 | true; \ |
07362bd9 DZ |
1056 | fi |
1057 | ||
79337c85 ILT |
1058 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. |
1059 | .PHONY: all-gcc | |
1060 | all-gcc: | |
1061 | @if [ -f ./gcc/Makefile ] ; then \ | |
5cc73086 | 1062 | r=`pwd`; export r; \ |
79337c85 | 1063 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1064 | $(SET_LIB_PATH) \ |
79337c85 | 1065 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ |
07362bd9 | 1066 | else \ |
79337c85 | 1067 | true; \ |
07362bd9 DZ |
1068 | fi |
1069 | ||
4c0b7ebc DE |
1070 | .PHONY: all-bootstrap |
1071 | all-bootstrap: | |
1072 | @if [ -f ./gcc/Makefile ] ; then \ | |
1073 | r=`pwd`; export r; \ | |
1074 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 1075 | $(SET_LIB_PATH) \ |
4c0b7ebc DE |
1076 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \ |
1077 | else \ | |
1078 | true; \ | |
1079 | fi | |
1080 | ||
65088029 ILT |
1081 | .PHONY: check-gcc |
1082 | check-gcc: | |
1083 | @if [ -f ./gcc/Makefile ] ; then \ | |
5cc73086 | 1084 | r=`pwd`; export r; \ |
65088029 | 1085 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1086 | $(SET_LIB_PATH) \ |
65088029 ILT |
1087 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ |
1088 | else \ | |
1089 | true; \ | |
1090 | fi | |
1091 | ||
79337c85 ILT |
1092 | .PHONY: install-gcc |
1093 | install-gcc: | |
1094 | @if [ -f ./gcc/Makefile ] ; then \ | |
5cc73086 | 1095 | r=`pwd`; export r; \ |
79337c85 | 1096 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ |
b6ae0f10 | 1097 | $(SET_LIB_PATH) \ |
79337c85 | 1098 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
07362bd9 | 1099 | else \ |
79337c85 | 1100 | true; \ |
07362bd9 DZ |
1101 | fi |
1102 | ||
753d5049 SC |
1103 | |
1104 | # EXPERIMENTAL STUFF | |
1105 | # This rule is used to install the modules which use FLAGS_TO_PASS. | |
1106 | # To build a target install-X means to cd to X and make install. | |
09985c96 SC |
1107 | .PHONY: install-dosrel |
1108 | install-dosrel: install-dirs info | |
753d5049 SC |
1109 | @dir=`echo $@ | sed -e 's/install-//'`; \ |
1110 | if [ -f ./$${dir}/Makefile ] ; then \ | |
1111 | r=`pwd`; export r; \ | |
1112 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
b6ae0f10 | 1113 | $(SET_LIB_PATH) \ |
753d5049 SC |
1114 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ |
1115 | else \ | |
1116 | true; \ | |
1117 | fi | |
1118 | ||
09985c96 | 1119 | install-dosrel-fake: |
a987271c | 1120 | |
753d5049 | 1121 | |
79337c85 | 1122 | # This is a list of inter-dependencies among modules. |
65e21701 | 1123 | all-autoconf: all-m4 |
79337c85 | 1124 | all-bfd: |
dfe44004 | 1125 | all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc |
79337c85 | 1126 | all-byacc: |
79337c85 | 1127 | all-cvs: |
4d802af9 | 1128 | all-dejagnu: all-tcl all-expect all-tk |
79337c85 ILT |
1129 | all-diff: all-libiberty |
1130 | all-emacs: | |
1d5fcc66 | 1131 | all-emacs19: all-byacc |
79337c85 | 1132 | all-etc: |
4c0b7ebc DE |
1133 | configure-target-examples: $(ALL_GCC) |
1134 | all-target-examples: configure-target-examples | |
c6ba9ae0 | 1135 | all-expect: all-tcl all-tk |
275049c0 | 1136 | all-fileutils: all-libiberty |
79337c85 | 1137 | all-find: |
7dcc0664 | 1138 | all-flex: all-libiberty all-byacc |
79337c85 | 1139 | all-gas: all-libiberty all-opcodes all-bfd |
65e21701 | 1140 | all-gash: all-tcl |
79337c85 | 1141 | all-gawk: |
fc3524a9 DE |
1142 | ALL_GCC = all-gcc |
1143 | all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld | |
4c0b7ebc | 1144 | all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld |
01082eaf MM |
1145 | GDB_TK = all-tk all-tcl |
1146 | all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK) | |
b6ae0f10 | 1147 | all-gprof: all-libiberty all-bfd all-opcodes |
6214eb23 | 1148 | all-grep: all-libiberty |
b6ae0f10 | 1149 | all-grez: all-libiberty all-bfd all-opcodes |
ab1cbc67 | 1150 | all-gui: all-gdb all-libproc all-target-librx |
0f8f1d33 | 1151 | all-guile: |
79337c85 ILT |
1152 | all-gzip: all-libiberty |
1153 | all-hello: all-libiberty | |
1154 | all-indent: | |
3585593d | 1155 | all-ispell: all-emacs19 |
b6ae0f10 | 1156 | all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex |
283a2b3d | 1157 | configure-target-libg++: $(ALL_GCC) configure-target-librx |
ab1cbc67 PB |
1158 | all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++ |
1159 | configure-target-libgloss: $(ALL_GCC) | |
283a2b3d | 1160 | all-target-libgloss: configure-target-libgloss configure-target-newlib |
ab1cbc67 PB |
1161 | configure-target-libio: $(ALL_GCC) |
1162 | all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib | |
79337c85 | 1163 | all-libiberty: |
ab1cbc67 PB |
1164 | configure-target-librx: $(ALL_GCC) configure-target-newlib |
1165 | all-target-librx: configure-target-librx | |
1166 | configure-target-libstdc++: $(ALL_GCC) | |
1167 | all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio | |
79337c85 ILT |
1168 | all-m4: all-libiberty |
1169 | all-make: all-libiberty | |
1170 | all-mmalloc: | |
ab1cbc67 PB |
1171 | configure-target-newlib: $(ALL_GCC) |
1172 | all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc | |
b6ae0f10 | 1173 | all-opcodes: all-bfd all-libiberty |
be2c65d3 | 1174 | all-patch: all-libiberty |
0f8f1d33 | 1175 | all-perl: |
b255ccdb | 1176 | all-prms: all-libiberty |
79337c85 ILT |
1177 | all-rcs: |
1178 | all-readline: | |
1179 | all-recode: all-libiberty | |
ac259c28 JM |
1180 | all-sed: all-libiberty |
1181 | all-send-pr: all-prms | |
79337c85 | 1182 | all-shellutils: |
b6ae0f10 | 1183 | all-sim: all-libiberty all-bfd all-opcodes |
07362bd9 | 1184 | all-tar: all-libiberty |
79337c85 ILT |
1185 | all-tcl: |
1186 | all-tclX: all-tcl all-tk | |
1187 | all-tk: all-tcl | |
1188 | all-texinfo: all-libiberty | |
1189 | all-textutils: | |
b6ae0f10 | 1190 | all-tgas: all-libiberty all-bfd all-opcodes |
79337c85 ILT |
1191 | all-time: |
1192 | all-wdiff: | |
b6ae0f10 | 1193 | all-target-winsup: all-target-newlib all-target-libiberty configure-target-winsup |
ab1cbc67 | 1194 | configure-target-winsup: configure-target-newlib |
79337c85 | 1195 | all-uudecode: all-libiberty |
ab1cbc67 PB |
1196 | configure-target-libiberty: $(ALL_GCC) |
1197 | all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib | |
0f8f1d33 TT |
1198 | all-target: $(ALL_TARGET_MODULES) |
1199 | install-target: $(INSTALL_TARGET_MODULES) | |
07362bd9 | 1200 | |
79337c85 | 1201 | ### other supporting targets |
07362bd9 | 1202 | |
79337c85 ILT |
1203 | MAKEDIRS= \ |
1204 | $(prefix) \ | |
1205 | $(exec_prefix) \ | |
1206 | $(tooldir) | |
fca4f908 | 1207 | |
79337c85 ILT |
1208 | .PHONY: install-dirs |
1209 | install-dirs: | |
1210 | @for i in $(MAKEDIRS) ; do \ | |
1211 | echo Making $$i... ; \ | |
62cd4a20 | 1212 | parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \ |
79337c85 ILT |
1213 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \ |
1214 | if [ ! -d $$i ] ; then \ | |
1215 | if mkdir $$i ; then \ | |
1216 | true ; \ | |
1217 | else \ | |
1218 | exit 1 ; \ | |
1219 | fi ; \ | |
1220 | else \ | |
1221 | true ; \ | |
1222 | fi ; \ | |
1223 | done | |
23e3e7f9 | 1224 | |
618f57a9 | 1225 | |
79337c85 ILT |
1226 | dir.info: do-install-info |
1227 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
1228 | $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ | |
1229 | mv -f dir.info.new dir.info ; \ | |
1230 | else true ; \ | |
72c09fbc | 1231 | fi |
6b7e5998 | 1232 | |
b1cceba2 DZ |
1233 | dist: |
1234 | @echo "Building a full distribution of this tree isn't done" | |
1235 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
1236 | ||
eb02fd64 RP |
1237 | etags tags: TAGS |
1238 | ||
753d5049 SC |
1239 | # Right now this just builds TAGS in each subdirectory. emacs19 has the |
1240 | # ability to use several tags files at once, so there is probably no need | |
1241 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
1242 | # (if we felt like it) have this Makefile write a piece of elisp which | |
1243 | # the user could load to tell emacs19 where all the TAGS files we just | |
1244 | # built are. | |
1245 | TAGS: do-TAGS | |
eb02fd64 | 1246 | |
eb02fd64 RP |
1247 | # with the gnu make, this is done automatically. |
1248 | ||
01ec9588 | 1249 | Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 1250 | $(SHELL) ./config.status |
eb02fd64 | 1251 | |
11954bf1 | 1252 | # |
01ec9588 | 1253 | # Support for building net releases |
11954bf1 | 1254 | |
01ec9588 JK |
1255 | # Files in devo used in any net release. |
1256 | # ChangeLog omitted because it may refer to files which are not in this | |
1257 | # distribution (perhaps it would be better to include it anyway). | |
d94d255d | 1258 | DEVO_SUPPORT= README Makefile.in configure configure.in \ |
9823504d | 1259 | config.guess config.sub config move-if-change \ |
81597186 | 1260 | mpw-README mpw-build.in mpw-config.in mpw-configure \ |
283a2b3d | 1261 | COPYING COPYING.LIB install.sh config-ml.in symlink-tree |
01ec9588 JK |
1262 | |
1263 | # Files in devo/etc used in any net release. | |
1264 | # ChangeLog omitted because it may refer to files which are not in this | |
1265 | # distribution (perhaps it would be better to include it anyway). | |
6d681784 | 1266 | ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \ |
ab1cbc67 PB |
1267 | configure.texi standards.texi make-stds.texi \ |
1268 | configure.info* standards.info* cfg-paper.info* | |
01ec9588 | 1269 | |
40e16078 KR |
1270 | # When you use `make setup-dirs' or `make taz' you should always redefine |
1271 | # this macro. | |
1272 | SUPPORT_FILES = list-of-support-files-for-tool-in-question | |
65e21701 KR |
1273 | # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF). |
1274 | DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in | |
40e16078 | 1275 | |
a54e05f6 KR |
1276 | .PHONY: taz |
1277 | ||
484fa12d JW |
1278 | taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ |
1279 | texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo | |
1280 | # Make sure "diststuff" files get built properly. | |
65e21701 KR |
1281 | for f in $(DISTBISONFILES) ; do \ |
1282 | if [ -r $$f ]; then \ | |
7b636683 | 1283 | sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \ |
65e21701 KR |
1284 | mv -f tmp $$f ; \ |
1285 | else true; fi ; \ | |
1286 | done | |
484fa12d JW |
1287 | # Take out texinfo from a few places; make simple BISON=bison line. |
1288 | sed -e '/^all\.normal: /s/\all-texinfo //' \ | |
1289 | -e '/^ install-texinfo /d' \ | |
1290 | -e '/^BISON = /,/^$$/d' \ | |
1291 | -e '/^# BISON:/s/.*/BISON = bison -y/' \ | |
1292 | <Makefile.in >tmp | |
1293 | mv -f tmp Makefile.in | |
65e21701 | 1294 | # |
1d5fcc66 PB |
1295 | $(start-sanitize-Sanitize) |
1296 | @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ; | |
1297 | $(end-sanitize-Sanitize) | |
40e16078 | 1298 | ./configure sun4 |
ab1cbc67 PB |
1299 | [ -z "$(CONFIGURE_TARGET_MODULES)" ] \ |
1300 | || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \ | |
aaefc574 | 1301 | CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)" |
6b9e3a78 | 1302 | # Make links, and run "make diststuff" or "make info" when needed. |
a54e05f6 | 1303 | rm -rf proto-toplev ; mkdir proto-toplev |
7f9cb3b2 | 1304 | set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \ |
a54e05f6 KR |
1305 | for d in $$dirs ; do \ |
1306 | if [ -d $$d ]; then \ | |
ab1cbc67 PB |
1307 | if [ ! -f $$d/Makefile ] ; then true ; \ |
1308 | elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \ | |
1309 | (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \ | |
6b9e3a78 | 1310 | elif grep '^info:' $$d/Makefile >/dev/null ; then \ |
ab1cbc67 | 1311 | (cd $$d ; $(MAKE) info ) || exit 1 ; \ |
6b9e3a78 | 1312 | fi ; \ |
7f9cb3b2 KR |
1313 | if [ -d $$d/proto-$$d.dir ]; then \ |
1314 | ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \ | |
1315 | else \ | |
1316 | ln -s ../$$d proto-toplev/$$d ; \ | |
1317 | fi ; \ | |
a54e05f6 | 1318 | else ln -s ../$$d proto-toplev/$$d ; fi ; \ |
40e16078 | 1319 | done |
3dbe0fa2 | 1320 | cd etc ; $(MAKE) info |
5600fbd2 | 1321 | $(MAKE) distclean |
a54e05f6 | 1322 | # |
40e16078 | 1323 | mkdir proto-toplev/etc |
15408b3b KR |
1324 | (cd proto-toplev/etc; \ |
1325 | for i in $(ETC_SUPPORT); do \ | |
40e16078 | 1326 | ln -s ../../etc/$$i . ; \ |
15408b3b | 1327 | done) |
a54e05f6 | 1328 | # |
04103845 | 1329 | # Take out texinfo from configurable dirs |
40e16078 KR |
1330 | rm proto-toplev/configure.in |
1331 | sed -e '/^host_tools=/s/texinfo //' \ | |
40e16078 | 1332 | <configure.in >proto-toplev/configure.in |
a54e05f6 | 1333 | # |
40e16078 KR |
1334 | mkdir proto-toplev/texinfo |
1335 | ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ | |
7f9cb3b2 | 1336 | ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/ |
484fa12d | 1337 | ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/ |
40e16078 | 1338 | ln -s ../../texinfo/tex3patch proto-toplev/texinfo/ |
a561909f | 1339 | chmod og=u `find . -print` |
7f9cb3b2 | 1340 | (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ |
1d2bb445 | 1341 | echo "==> Making $(TOOL)-$$VER.tar.gz"; \ |
a59b94d2 | 1342 | rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \ |
40e16078 | 1343 | tar cfh - $(TOOL)-$$VER \ |
5cc73086 | 1344 | | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz ) |
40e16078 | 1345 | |
484fa12d | 1346 | TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo |
7f9cb3b2 | 1347 | DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) |
40e16078 | 1348 | |
96bfa612 | 1349 | .PHONY: gas.tar.gz |
7f9cb3b2 | 1350 | GAS_SUPPORT_DIRS= bfd include libiberty opcodes |
96bfa612 | 1351 | gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas |
484fa12d JW |
1352 | $(MAKE) -f Makefile.in taz TOOL=gas \ |
1353 | SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" | |
40e16078 | 1354 | |
7f9cb3b2 | 1355 | # The FSF "binutils" release includes gprof and ld. |
96bfa612 | 1356 | .PHONY: binutils.tar.gz |
4be4b991 | 1357 | BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof |
96bfa612 | 1358 | binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils |
484fa12d | 1359 | $(MAKE) -f Makefile.in taz TOOL=binutils \ |
2492f942 | 1360 | SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat" |
7f9cb3b2 | 1361 | |
96bfa612 | 1362 | .PHONY: gas+binutils.tar.gz |
a54e05f6 | 1363 | GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof |
96bfa612 | 1364 | gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas |
484fa12d | 1365 | $(MAKE) -f Makefile.in taz TOOL=gas \ |
2492f942 | 1366 | SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat" |
79337c85 | 1367 | |
5600fbd2 | 1368 | .PHONY: libg++.tar.gz |
ab1cbc67 | 1369 | LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty |
5600fbd2 | 1370 | libg++.tar.gz: $(DIST_SUPPORT) libg++ |
484fa12d JW |
1371 | $(MAKE) -f Makefile.in taz TOOL=libg++ \ |
1372 | SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" | |
5600fbd2 | 1373 | |
49dfa984 JM |
1374 | GNATS_SUPPORT_DIRS=include libiberty send-pr |
1375 | gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats | |
a0bd8e18 | 1376 | $(MAKE) -f Makefile.in taz TOOL=gnats \ |
49dfa984 JM |
1377 | SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" |
1378 | ||
1d5fcc66 | 1379 | .PHONY: gdb.tar.gz |
81597186 | 1380 | GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils |
ca2ce3b3 | 1381 | GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi` |
1d5fcc66 PB |
1382 | gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb |
1383 | $(MAKE) -f Makefile.in taz TOOL=gdb \ | |
ca2ce3b3 | 1384 | SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)" |
1d5fcc66 | 1385 | |
7166a308 | 1386 | .PHONY: newlib.tar.gz |
a220ba0f | 1387 | NEWLIB_SUPPORT_DIRS=libgloss |
04103845 | 1388 | # taz configures for the sun4 target which won't configure newlib. |
a220ba0f SC |
1389 | # We need newlib configured so that the .info files are made. |
1390 | # Unfortunately, it is not enough to just configure newlib separately: | |
1391 | # taz will build the .info files but since SUBDIRS won't contain newlib, | |
1392 | # distclean won't be run (leaving Makefile, config.status, and the tmp files | |
1393 | # used in building the .info files, eg: *.def, *.ref). | |
4c0b7ebc DE |
1394 | # The problem isn't solvable however without a lot of extra work because |
1395 | # target libraries are built in subdir $(target_alias) which gets nuked during | |
1396 | # the make distclean. For now punt on the issue of shipping newlib info files | |
1397 | # with newlib net releases and wait for a day when some native target (sun4?) | |
1398 | # supports newlib (if only minimally). | |
7166a308 KR |
1399 | newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib |
1400 | $(MAKE) -f Makefile.in taz TOOL=newlib \ | |
1401 | SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \ | |
6b9e3a78 | 1402 | DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib |
7166a308 | 1403 | |
79337c85 ILT |
1404 | .NOEXPORT: |
1405 | MAKEOVERRIDES= | |
1406 | ||
1407 | # start-sanitize-chill | |
1408 | ## This is ugly, but I don't want GNU make to put these variables in | |
1409 | ## the environment. Older makes will see this as a set of targets | |
1410 | ## with no dependencies and no actions. | |
1411 | unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET : | |
1412 | # end-sanitize-chill | |
1413 | ||
eb02fd64 | 1414 | # end of Makefile.in |