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