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 | |
17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
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 | |
45 | ||
46 | SHELL = /bin/sh | |
47 | ||
378fd382 | 48 | INSTALL = cp |
4d714963 RP |
49 | INSTALL_PROGRAM = $(INSTALL) |
50 | INSTALL_DATA = $(INSTALL) | |
3c8735af | 51 | |
440868a0 | 52 | AS = as |
ec342d7d | 53 | AR = ar |
b5329d84 | 54 | AR_FLAGS = rc |
e85e07cb | 55 | CC = cc |
f8a6ad66 | 56 | CFLAGS = -g |
a4e879a1 | 57 | # start-sanitize-chill |
7d9f0c54 MW |
58 | CHILLFLAGS = $(CFLAGS) |
59 | CHILL_LIB = -lchill | |
a4e879a1 | 60 | # end-sanitize-chill |
e85e07cb | 61 | CXX = gcc |
d1bea4c7 | 62 | CXXFLAGS = -g -O |
4d714963 | 63 | RANLIB = ranlib |
51489233 | 64 | NM = nm |
a54e05f6 | 65 | MUNCH_NM = $(NM) |
81246025 | 66 | GZIP = gzip |
85216403 | 67 | COMPRESS = compress |
eb02fd64 | 68 | |
40e16078 | 69 | # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove. |
98a33b6d | 70 | BISON = `if [ -f $${rootme}/byacc/byacc ] ; \ |
06a07944 | 71 | then echo $${rootme}/byacc/byacc ; \ |
378fd382 | 72 | else echo byacc ; \ |
06a07944 | 73 | fi` |
2645fb0c | 74 | |
98a33b6d | 75 | LEX = `if [ -f $${rootme}/flex/flex ] ; \ |
8b361a95 | 76 | then echo $${rootme}/flex/flex ; \ |
2198e4ba MT |
77 | else echo flex ; fi` |
78 | ||
6d681784 JG |
79 | MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \ |
80 | then echo $${rootme}/texinfo/makeinfo/makeinfo ; \ | |
77806c3e | 81 | else echo makeinfo ; fi` |
b772d75e | 82 | |
a54e05f6 KR |
83 | EXPECT = `if [ -f $${rootme}/expect/expect ] ; \ |
84 | then echo $${rootme}/expect/expect ; \ | |
85 | else echo expect ; fi` | |
86 | ||
87 | RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \ | |
88 | then echo $${srcroot}/dejagnu/runtest ; \ | |
6a42d184 DZ |
89 | else echo runtest ; fi` |
90 | ||
f980fcfb JG |
91 | |
92 | # libraries that may need to be augmented on a system-by-system basis | |
93 | X11_LIB = -lX11 | |
94 | ||
e85e07cb | 95 | # compilers to use to create programs which must be run in the build |
440868a0 ILT |
96 | # environment. |
97 | CC_FOR_BUILD = $(CC) | |
e85e07cb | 98 | CXX_FOR_BUILD = $(CXX) |
440868a0 | 99 | |
9f73dd6a | 100 | SUBDIRS = "this is set via configure, don't edit this" |
6a3958b2 RP |
101 | OTHERS = |
102 | ||
a0f47eb7 | 103 | ALL = all.normal |
c6ba9ae0 | 104 | INSTALL_TARGET = install-dirs $(INSTALL_MODULES) $(INSTALL_TARGET_MODULES) $(INSTALL_X11_MODULES) |
fb660409 | 105 | |
51489233 ILT |
106 | CC_FOR_TARGET = ` \ |
107 | if [ -f $${rootme}/gcc/Makefile ] ; then \ | |
31883f01 | 108 | echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \ |
51489233 | 109 | else \ |
378fd382 | 110 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
111 | echo $(CC); \ |
112 | else \ | |
113 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
114 | fi; \ | |
115 | fi` | |
116 | ||
a4e879a1 | 117 | # start-sanitize-chill |
7d9f0c54 MW |
118 | CHILL_FOR_TARGET = ` \ |
119 | if [ -f $${rootme}/gcc/Makefile ] ; then \ | |
120 | echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \ | |
121 | else \ | |
122 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
123 | echo $(CC); \ | |
124 | else \ | |
125 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
126 | fi; \ | |
127 | fi` | |
34b3298b | 128 | |
a4e879a1 | 129 | # end-sanitize-chill |
7d9f0c54 | 130 | |
d1bea4c7 | 131 | CXX_FOR_TARGET = ` \ |
fca4f908 | 132 | if [ -f $${rootme}/gcc/Makefile ] ; then \ |
31883f01 | 133 | echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \ |
fca4f908 | 134 | else \ |
e85e07cb ILT |
135 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
136 | echo $(CXX); \ | |
fca4f908 MW |
137 | else \ |
138 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
139 | fi; \ | |
140 | fi` | |
141 | ||
440868a0 ILT |
142 | AS_FOR_TARGET = ` \ |
143 | if [ -f $${rootme}/gas/Makefile ] ; then \ | |
144 | echo $${rootme}/gas/as.new ; \ | |
145 | else \ | |
e85e07cb | 146 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
440868a0 ILT |
147 | echo $(AS); \ |
148 | else \ | |
149 | t='$(program_transform_name)'; echo as | sed -e '' $$t ; \ | |
81246025 | 150 | fi; \ |
440868a0 ILT |
151 | fi` |
152 | ||
51489233 ILT |
153 | AR_FOR_TARGET = ` \ |
154 | if [ -f $${rootme}/binutils/Makefile ] ; then \ | |
155 | echo $${rootme}/binutils/ar ; \ | |
156 | else \ | |
378fd382 | 157 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
158 | echo $(AR); \ |
159 | else \ | |
160 | t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \ | |
81246025 | 161 | fi; \ |
51489233 ILT |
162 | fi` |
163 | ||
164 | RANLIB_FOR_TARGET = ` \ | |
165 | if [ -f $${rootme}/binutils/Makefile ] ; then \ | |
166 | echo $${rootme}/binutils/ranlib ; \ | |
167 | else \ | |
378fd382 | 168 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
169 | echo $(RANLIB); \ |
170 | else \ | |
171 | t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \ | |
81246025 | 172 | fi; \ |
51489233 ILT |
173 | fi` |
174 | ||
175 | NM_FOR_TARGET = ` \ | |
176 | if [ -f $${rootme}/binutils/Makefile ] ; then \ | |
177 | echo $${rootme}/binutils/nm ; \ | |
178 | else \ | |
378fd382 | 179 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ |
51489233 ILT |
180 | echo $(NM); \ |
181 | else \ | |
182 | t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \ | |
81246025 | 183 | fi; \ |
51489233 ILT |
184 | fi` |
185 | ||
0ef4728f | 186 | # FIXME: This is badly named. |
51489233 ILT |
187 | XTRAFLAGS = ` \ |
188 | if [ -f $${rootme}/gcc/Makefile ] ; then \ | |
9d401625 ILT |
189 | if [ -f $${rootme}/newlib/Makefile ] ; then \ |
190 | echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \ | |
51489233 | 191 | else \ |
9d401625 | 192 | echo -I$${rootme}/gcc/include ; \ |
51489233 ILT |
193 | fi ; \ |
194 | else \ | |
195 | echo ; \ | |
196 | fi` | |
23e3e7f9 | 197 | |
394ad658 | 198 | PRMS = all-prms |
b1cceba2 | 199 | |
eb02fd64 | 200 | #### host and target specific makefile fragments come in here. |
ec342d7d | 201 | ### |
eb02fd64 | 202 | |
0ef4728f ILT |
203 | # Flags to pass down to all sub-makes. |
204 | # Please keep these in alphabetical order. | |
205 | BASE_FLAGS_TO_PASS = \ | |
2198e4ba | 206 | "AR_FLAGS=$(AR_FLAGS)" \ |
d09de70e | 207 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ |
0ef4728f | 208 | "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ |
378fd382 | 209 | "BISON=$(BISON)" \ |
378fd382 | 210 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ |
0ef4728f | 211 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ |
2198e4ba | 212 | "CFLAGS=$(CFLAGS)" \ |
a4e879a1 | 213 | $(start-sanitize-chill)\ |
7d9f0c54 MW |
214 | "CHILLFLAGS=$(CHILLFLAGS)" \ |
215 | "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \ | |
216 | "CHILL_LIB=$(CHILL_LIB)" \ | |
a4e879a1 | 217 | $(end-sanitize-chill)\ |
0ef4728f ILT |
218 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ |
219 | "CXXFLAGS=$(CXXFLAGS)" \ | |
220 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
53222cbd | 221 | 'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \ |
2198e4ba MT |
222 | "INSTALL=$(INSTALL)" \ |
223 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
440868a0 | 224 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ |
378fd382 DZ |
225 | "LDFLAGS=$(LDFLAGS)" \ |
226 | "LEX=$(LEX)" \ | |
227 | "LOADLIBES=$(LOADLIBES)" \ | |
228 | "MAKEINFO=$(MAKEINFO)" \ | |
a54e05f6 | 229 | "MUNCH_NM=$(MUNCH_NM)" \ |
0ef4728f | 230 | "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ |
72c09fbc | 231 | "PRMS=$(PRMS)" \ |
d09de70e | 232 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ |
a54e05f6 | 233 | "EXPECT=$(EXPECT)" \ |
6a42d184 | 234 | "RUNTEST=$(RUNTEST)" \ |
a54e05f6 | 235 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ |
0ef4728f | 236 | "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \ |
378fd382 DZ |
237 | "exec_prefix=$(exec_prefix)" \ |
238 | "prefix=$(prefix)" \ | |
239 | "tooldir=$(tooldir)" | |
2198e4ba | 240 | |
0ef4728f ILT |
241 | # Flags to pass down to most sub-makes, in which we're building with |
242 | # the host environment. | |
6d681784 | 243 | # If any variables are added here, they must be added to do-*, below. |
0ef4728f | 244 | EXTRA_HOST_FLAGS = \ |
6d681784 JG |
245 | 'AR=$(AR)' \ |
246 | 'AS=$(AS)' \ | |
247 | 'CC=$(CC)' \ | |
248 | 'CXX=$(CXX)' \ | |
249 | 'NM=$(NM)' \ | |
250 | 'RANLIB=$(RANLIB)' \ | |
251 | 'XTRAFLAGS=' | |
0ef4728f ILT |
252 | |
253 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
254 | ||
d1bea4c7 DZ |
255 | # Flags that are concerned with the location of the X11 include files |
256 | # and library files | |
257 | X11_FLAGS_TO_PASS = \ | |
258 | "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \ | |
f980fcfb JG |
259 | "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \ |
260 | "X11_LIB=$(X11_LIB)" | |
d1bea4c7 | 261 | |
0ef4728f ILT |
262 | # Flags to pass down to makes which are built with the target environment. |
263 | # The double $ decreases the length of the command line; the variables | |
264 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. | |
6d681784 | 265 | # If any variables are added here, they must be added to do-*, below. |
0ef4728f ILT |
266 | EXTRA_TARGET_FLAGS = \ |
267 | 'AR=$$(AR_FOR_TARGET)' \ | |
268 | 'AS=$$(AS_FOR_TARGET)' \ | |
269 | 'CC=$$(CC_FOR_TARGET)' \ | |
270 | 'CXX=$$(CXX_FOR_TARGET)' \ | |
271 | 'NM=$$(NM_FOR_TARGET)' \ | |
272 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | |
273 | 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)' | |
274 | ||
275 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
51489233 | 276 | |
f4e414f1 ILT |
277 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it |
278 | # unfortunately needs the native compiler and the target ar and | |
0ef4728f | 279 | # ranlib. |
6d681784 | 280 | # If any variables are added here, they must be added to do-*, below. |
a54e05f6 KR |
281 | # The HOST_* variables are a special case, which are used for the gcc |
282 | # cross-building scheme. | |
283 | HOST_CC = $(CC_FOR_BUILD) | |
284 | HOST_PREFIX = | |
285 | HOST_PREFIX_1 = loser- | |
0ef4728f ILT |
286 | EXTRA_GCC_FLAGS = \ |
287 | 'AR=$$(AR_FOR_TARGET)' \ | |
6d681784 JG |
288 | 'AS=$(AS)' \ |
289 | 'CC=$(CC)' \ | |
290 | 'CXX=$(CXX)' \ | |
a54e05f6 KR |
291 | 'HOST_CC=$(CC_FOR_BUILD)' \ |
292 | 'HOST_PREFIX=$(HOST_PREFIX)' \ | |
293 | 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \ | |
6d681784 | 294 | 'NM=$(NM)' \ |
0ef4728f | 295 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ |
6d681784 | 296 | 'XTRAFLAGS=' |
0ef4728f | 297 | |
34b3298b | 298 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) |
f4e414f1 | 299 | |
6a42d184 | 300 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
301 | # using $(FLAGS_TO_PASS). |
302 | ALL_MODULES = \ | |
303 | all-autoconf \ | |
304 | all-bfd \ | |
305 | all-binutils \ | |
306 | all-byacc \ | |
307 | all-cvs \ | |
308 | all-dejagnu \ | |
309 | all-diff \ | |
310 | all-etc \ | |
311 | all-fileutils \ | |
312 | all-find \ | |
313 | all-flex \ | |
314 | all-gas \ | |
315 | all-gawk \ | |
316 | all-gdb \ | |
317 | all-gprof \ | |
318 | all-grep \ | |
319 | all-gzip \ | |
320 | all-hello \ | |
321 | all-indent \ | |
322 | all-ispell \ | |
323 | all-ld \ | |
324 | all-libiberty \ | |
325 | all-m4 \ | |
326 | all-make \ | |
327 | all-mmalloc \ | |
328 | all-opcodes \ | |
329 | all-patch \ | |
330 | all-prms \ | |
331 | all-rcs \ | |
332 | all-readline \ | |
275049c0 | 333 | all-release \ |
79337c85 ILT |
334 | all-recode \ |
335 | all-sed \ | |
336 | all-send-pr \ | |
337 | all-shellutils \ | |
338 | all-sim \ | |
339 | all-tar \ | |
340 | all-tcl \ | |
341 | all-texinfo \ | |
342 | all-textutils \ | |
343 | all-tgas \ | |
344 | all-time \ | |
345 | all-uudecode \ | |
346 | all-wdiff | |
347 | ||
6a42d184 DZ |
348 | # This is a list of the check targets for all of the modules which are |
349 | # compiled using $(FLAGS_TO_PASS). | |
350 | CHECK_MODULES = \ | |
351 | check-autoconf \ | |
352 | check-bfd \ | |
353 | check-binutils \ | |
354 | check-byacc \ | |
355 | check-cvs \ | |
356 | check-dejagnu \ | |
357 | check-diff \ | |
358 | check-etc \ | |
359 | check-fileutils \ | |
360 | check-find \ | |
361 | check-flex \ | |
362 | check-gas \ | |
363 | check-gawk \ | |
364 | check-gdb \ | |
365 | check-gprof \ | |
366 | check-grep \ | |
367 | check-gzip \ | |
368 | check-hello \ | |
369 | check-indent \ | |
370 | check-ispell \ | |
371 | check-ld \ | |
372 | check-libiberty \ | |
373 | check-m4 \ | |
374 | check-make \ | |
375 | check-mmcheckoc \ | |
376 | check-opcodes \ | |
377 | check-patch \ | |
378 | check-prms \ | |
379 | check-rcs \ | |
380 | check-readline \ | |
381 | check-recode \ | |
382 | check-sed \ | |
383 | check-send-pr \ | |
384 | check-shellutils \ | |
385 | check-sim \ | |
386 | check-tar \ | |
387 | check-tcl \ | |
388 | check-texinfo \ | |
389 | check-textutils \ | |
390 | check-tgas \ | |
391 | check-time \ | |
392 | check-uudecode \ | |
393 | check-wdiff | |
394 | ||
395 | # This is a list of the install targets for all of the modules which are | |
79337c85 ILT |
396 | # compiled using $(FLAGS_TO_PASS). |
397 | INSTALL_MODULES = \ | |
398 | install-autoconf \ | |
399 | install-bfd \ | |
400 | install-binutils \ | |
401 | install-byacc \ | |
402 | install-cvs \ | |
403 | install-dejagnu \ | |
404 | install-diff \ | |
405 | install-etc \ | |
406 | install-fileutils \ | |
407 | install-find \ | |
408 | install-flex \ | |
409 | install-gas \ | |
410 | install-gawk \ | |
411 | install-gdb \ | |
412 | install-glob \ | |
413 | install-gprof \ | |
414 | install-grep \ | |
415 | install-gzip \ | |
416 | install-hello \ | |
417 | install-indent \ | |
418 | install-ispell \ | |
419 | install-ld \ | |
420 | install-libiberty \ | |
421 | install-m4 \ | |
422 | install-make \ | |
423 | install-mmalloc \ | |
424 | install-opcodes \ | |
425 | install-patch \ | |
426 | install-prms \ | |
427 | install-rcs \ | |
428 | install-readline \ | |
429 | install-recode \ | |
430 | install-sed \ | |
431 | install-send-pr \ | |
432 | install-shellutils \ | |
433 | install-sim \ | |
434 | install-tar \ | |
435 | install-tcl \ | |
436 | install-texinfo \ | |
437 | install-textutils \ | |
438 | install-tgas \ | |
439 | install-time \ | |
440 | install-uudecode \ | |
441 | install-wdiff | |
442 | ||
6a42d184 | 443 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
444 | # using $(X11_FLAGS_TO_PASS). |
445 | ALL_X11_MODULES = \ | |
446 | all-emacs \ | |
447 | all-expect \ | |
448 | all-tclX \ | |
449 | all-tk | |
450 | ||
6a42d184 DZ |
451 | # This is a list of the check targets for all of the modules which are |
452 | # compiled using $(X11_FLAGS_TO_PASS). | |
453 | CHECK_X11_MODULES = \ | |
454 | check-emacs \ | |
455 | check-expect \ | |
456 | check-tclX \ | |
457 | check-tk | |
458 | ||
79337c85 ILT |
459 | # This is a list of the install targets for all the modules which are |
460 | # compiled using $(X11_FLAGS_TO_PASS). | |
461 | INSTALL_X11_MODULES = \ | |
462 | install-emacs \ | |
463 | install-expect \ | |
464 | install-tclX \ | |
465 | install-tk | |
fca4f908 | 466 | |
6a42d184 | 467 | # This is a list of the targets for all of the modules which are compiled |
79337c85 ILT |
468 | # using $(TARGET_FLAGS_TO_PASS). |
469 | ALL_TARGET_MODULES = \ | |
470 | $(start-sanitize-chill) \ | |
471 | all-chillrt \ | |
472 | $(end-sanitize-chill) \ | |
473 | all-libg++ \ | |
474 | all-newlib \ | |
475 | all-xiberty | |
476 | ||
6a42d184 DZ |
477 | # This is a list of the check targets for all of the modules which are |
478 | # compiled using $(TARGET_FLAGS_TO_PASS). | |
479 | CHECK_TARGET_MODULES = \ | |
480 | $(start-sanitize-chill) \ | |
481 | check-chillrt \ | |
482 | $(end-sanitize-chill) \ | |
483 | check-libg++ \ | |
484 | check-newlib \ | |
485 | check-xiberty | |
486 | ||
487 | # This is a list of the install targets for all of the modules which are | |
79337c85 ILT |
488 | # compiled using $(TARGET_FLAGS_TO_PASS). |
489 | INSTALL_TARGET_MODULES = \ | |
490 | $(start-sanitize-chill) \ | |
491 | install-chillrt \ | |
492 | $(end-sanitize-chill) \ | |
493 | install-libg++ \ | |
494 | install-newlib \ | |
495 | install-xiberty | |
4d714963 | 496 | |
79337c85 ILT |
497 | # This is a shell case of all modules which are compiled using |
498 | # $(TARGET_FLAGS_TO_PASS), used in the do-X rule. | |
499 | TARGET_LIBS = libg++ | newlib | xiberty | |
a4e879a1 | 500 | # start-sanitize-chill |
79337c85 | 501 | TARGET_LIBS = chillrt | libg++ | newlib | xiberty |
a4e879a1 | 502 | # end-sanitize-chill |
7481617f | 503 | |
79337c85 ILT |
504 | # The first rule in the file had better be this one. Don't put any above it. |
505 | all: $(ALL) | |
506 | .PHONY: all | |
507 | ||
508 | # The target built for a native build. | |
509 | .PHONY: all.normal | |
510 | all.normal: \ | |
511 | $(ALL_MODULES) \ | |
512 | $(ALL_TARGET_MODULES) \ | |
46d0ca81 | 513 | $(ALL_X11_MODULES) \ |
79337c85 ILT |
514 | all-gcc |
515 | ||
516 | # The target built for a cross build. | |
517 | .PHONY: all.cross | |
518 | all.cross: \ | |
519 | all-bfd \ | |
520 | all-binutils \ | |
521 | all-byacc \ | |
522 | all-dejagnu \ | |
523 | all-flex \ | |
524 | all-gas \ | |
525 | all-gcc \ | |
526 | all-gdb \ | |
527 | all-ld \ | |
528 | all-libiberty \ | |
529 | all-mmalloc \ | |
530 | all-opcodes \ | |
531 | all-readline \ | |
532 | all-sim \ | |
533 | $(ALL_TARGET_MODULES) | |
534 | ||
0ef4728f | 535 | # Do a target for all the subdirectories. A ``make do-X'' will do a |
53222cbd RP |
536 | # ``make X'' in all subdirectories (because, in general, there is a |
537 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
538 | # but it may do additional work as well). | |
0ef4728f ILT |
539 | # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, |
540 | # because it is so large that it can easily overflow the command line | |
541 | # length limit on some systems. | |
79337c85 | 542 | DO_X = \ |
79337c85 ILT |
543 | do-clean \ |
544 | do-distclean \ | |
545 | do-dvi \ | |
546 | do-info \ | |
547 | do-install-info \ | |
548 | do-installcheck \ | |
549 | do-mostlyclean \ | |
550 | do-realclean | |
551 | .PHONY: $(DO_X) | |
552 | $(DO_X): | |
0ef4728f ILT |
553 | @target=`echo $@ | sed -e 's/^do-//'`; \ |
554 | rootme=`pwd`; export rootme; \ | |
555 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
556 | for i in $(SUBDIRS); do \ | |
36286a3e | 557 | if [ -f ./$$i/Makefile ]; then \ |
0ef4728f ILT |
558 | case $$i in \ |
559 | $(TARGET_LIBS) ) \ | |
6d681784 JG |
560 | for flag in $(EXTRA_TARGET_FLAGS); do \ |
561 | eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \ | |
562 | done; \ | |
0ef4728f ILT |
563 | ;; \ |
564 | gcc) \ | |
6d681784 JG |
565 | for flag in $(EXTRA_GCC_FLAGS); do \ |
566 | eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \ | |
567 | done; \ | |
0ef4728f ILT |
568 | ;; \ |
569 | *) \ | |
6d681784 JG |
570 | for flag in $(EXTRA_HOST_FLAGS); do \ |
571 | eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \ | |
572 | done; \ | |
0ef4728f ILT |
573 | ;; \ |
574 | esac ; \ | |
6d681784 | 575 | export AR AS CC CXX NM RANLIB XTRAFLAGS; \ |
0ef4728f | 576 | if (cd ./$$i; \ |
6d681784 JG |
577 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
578 | "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \ | |
579 | "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \ | |
580 | $${target}); \ | |
0ef4728f ILT |
581 | then true; else exit 1; fi; \ |
582 | else true; fi; \ | |
583 | done | |
fb90daeb | 584 | |
79337c85 ILT |
585 | # Here are the targets which correspond to the do-X targets. |
586 | ||
65088029 | 587 | .PHONY: info installcheck dvi install-info |
79337c85 | 588 | .PHONY: clean distclean mostlyclean realclean local-clean local-distclean |
0ef4728f | 589 | info: do-info |
1a14993c | 590 | installcheck: do-installcheck |
0ef4728f | 591 | dvi: do-dvi |
9a9e8e7f | 592 | |
0ef4728f | 593 | install-info: install-info-dirs do-install-info dir.info |
72c09fbc SC |
594 | if [ -f dir.info ] ; then \ |
595 | $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \ | |
50fbe976 | 596 | else true ; fi |
4d714963 | 597 | |
0ef4728f ILT |
598 | do-install-info: install-info-dirs |
599 | ||
0ef4728f | 600 | local-clean: |
7fed4078 | 601 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E |
3b30df82 | 602 | |
0ef4728f | 603 | local-distclean: |
7fed4078 | 604 | -rm -f Makefile config.status |
7fcfdcf7 | 605 | |
0ef4728f ILT |
606 | clean: do-clean local-clean |
607 | mostlyclean: do-mostlyclean local-clean | |
608 | distclean: do-distclean local-clean local-distclean | |
609 | realclean: do-realclean local-clean local-distclean | |
610 | ||
65088029 ILT |
611 | # Check target. |
612 | ||
613 | .PHONY: check | |
614 | check: $(CHECK_MODULES) \ | |
615 | $(CHECK_TARGET_MODULES) \ | |
616 | $(CHECK_X11_MODULES) \ | |
617 | check-gcc | |
618 | ||
79337c85 | 619 | # Installation targets. |
4d714963 | 620 | |
275049c0 | 621 | .PHONY: install uninstall vault-install |
98a33b6d | 622 | install: $(INSTALL_TARGET) |
b26ff9d8 | 623 | |
79337c85 ILT |
624 | uninstall: |
625 | @echo "the uninstall target is not supported in this tree" | |
626 | ||
275049c0 JK |
627 | vault-install: |
628 | @if [ -f ./release/vault-install ] ; then \ | |
629 | ./release/vault-install $(host_alias) $(target_alias) ; \ | |
96bfa612 KR |
630 | else \ |
631 | true ; \ | |
275049c0 JK |
632 | fi |
633 | ||
79337c85 | 634 | .PHONY: install.all |
06a07944 RP |
635 | install.all: install-no-fixedincludes |
636 | @if [ -f ./gcc/Makefile ] ; then \ | |
637 | rootme=`pwd` ; export rootme ; \ | |
638 | (cd ./gcc; \ | |
639 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ | |
640 | else \ | |
641 | true ; \ | |
642 | fi | |
5a63b336 | 643 | |
96bfa612 | 644 | # install-no-fixedincludes is used because Cygnus can not distribute |
79337c85 ILT |
645 | # the fixed header files. |
646 | .PHONY: install-no-fixedincludes | |
647 | install-no-fixedincludes: \ | |
648 | install-dirs \ | |
79337c85 ILT |
649 | $(INSTALL_MODULES) \ |
650 | $(INSTALL_TARGET_MODULES) \ | |
96bfa612 KR |
651 | $(INSTALL_X11_MODULES) \ |
652 | gcc-no-fixedincludes \ | |
d1bea4c7 | 653 | |
5cc24596 | 654 | # Install the gcc headers files, but not the fixed include files, |
79337c85 ILT |
655 | # which Cygnus is not allowed to distribute. This rule is very |
656 | # dependent on the workings of the gcc Makefile.in. | |
657 | .PHONY: gcc-no-fixedincludes | |
06a07944 | 658 | gcc-no-fixedincludes: |
5cc24596 PB |
659 | @if [ -f ./gcc/Makefile ]; then \ |
660 | rm -rf gcc/tmp-include; \ | |
661 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
662 | mkdir gcc/include; \ | |
7f9cb3b2 | 663 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ |
a54e05f6 KR |
664 | touch gcc/stmp-fixinc; \ |
665 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ | |
5cc24596 PB |
666 | rootme=`pwd`; export rootme; \ |
667 | srcroot=`cd $(srcdir); pwd` ; export srcroot; \ | |
668 | (cd ./gcc; \ | |
669 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ | |
670 | rm -rf gcc/include; \ | |
671 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
672 | else true; fi | |
dcbfc14d | 673 | |
79337c85 ILT |
674 | .PHONY: install.cross |
675 | install.cross: \ | |
676 | install-dirs \ | |
677 | install-binutils \ | |
678 | install-byacc \ | |
679 | install-dejagnu \ | |
680 | install-etc \ | |
681 | install-flex \ | |
682 | install-gas \ | |
683 | install-gcc \ | |
684 | install-gdb \ | |
685 | install-glob \ | |
686 | install-ld \ | |
687 | install-libiberty \ | |
688 | install-mmalloc \ | |
689 | install-opcodes \ | |
690 | install-readline \ | |
691 | $(INSTALL_TARGET_MODULES) | |
692 | ||
693 | # This rule is used to build the modules which use FLAGS_TO_PASS. To | |
694 | # build a target all-X means to cd to X and make all. | |
695 | # all-glob is handled specially because it doesn't actually build. | |
696 | .PHONY: $(ALL_MODULES) all-glob | |
697 | $(ALL_MODULES) all-glob: | |
698 | @dir=`echo $@ | sed -e 's/all-//'`; \ | |
699 | if [ -f ./$${dir}/Makefile ] ; then \ | |
700 | rootme=`pwd`; export rootme; \ | |
701 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
702 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ | |
07362bd9 | 703 | else \ |
79337c85 | 704 | true; \ |
07362bd9 DZ |
705 | fi |
706 | ||
6a42d184 DZ |
707 | # This rule is used to check the modules which use FLAGS_TO_PASS. To |
708 | # build a target check-X means to cd to X and make all. | |
709 | .PHONY: $(CHECK_MODULES) | |
710 | $(CHECK_MODULES): | |
711 | @dir=`echo $@ | sed -e 's/check-//'`; \ | |
712 | if [ -f ./$${dir}/Makefile ] ; then \ | |
713 | rootme=`pwd`; export rootme; \ | |
714 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
715 | (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ | |
716 | else \ | |
717 | true; \ | |
718 | fi | |
719 | ||
79337c85 ILT |
720 | # This rule is used to install the modules which use FLAGS_TO_PASS. |
721 | # To build a target install-X means to cd to X and make install. | |
722 | .PHONY: $(INSTALL_MODULES) | |
723 | $(INSTALL_MODULES): install-dirs | |
724 | @dir=`echo $@ | sed -e 's/install-//'`; \ | |
725 | if [ -f ./$${dir}/Makefile ] ; then \ | |
726 | rootme=`pwd`; export rootme; \ | |
727 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
c6ba9ae0 | 728 | (cd $${dir}; $(MAKE) install); \ |
07362bd9 | 729 | else \ |
79337c85 | 730 | true; \ |
07362bd9 DZ |
731 | fi |
732 | ||
6a42d184 DZ |
733 | # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS. |
734 | # To build a target all-X means to cd to X and make all. | |
79337c85 ILT |
735 | .PHONY: $(ALL_TARGET_MODULES) |
736 | $(ALL_TARGET_MODULES): | |
737 | @dir=`echo $@ | sed -e 's/all-//'`; \ | |
738 | if [ -f ./$${dir}/Makefile ] ; then \ | |
739 | rootme=`pwd`; export rootme; \ | |
740 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
741 | (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ | |
07362bd9 | 742 | else \ |
79337c85 | 743 | true; \ |
07362bd9 DZ |
744 | fi |
745 | ||
6a42d184 DZ |
746 | # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS. |
747 | # To build a target install-X means to cd to X and make install. | |
748 | .PHONY: $(CHECK_TARGET_MODULES) | |
749 | $(CHECK_TARGET_MODULES): | |
750 | @dir=`echo $@ | sed -e 's/check-//'`; \ | |
751 | if [ -f ./$${dir}/Makefile ] ; then \ | |
752 | rootme=`pwd`; export rootme; \ | |
753 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
754 | (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \ | |
755 | else \ | |
756 | true; \ | |
757 | fi | |
758 | ||
79337c85 ILT |
759 | # This rule is used to install the modules which use |
760 | # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X | |
761 | # and make install. | |
762 | .PHONY: $(INSTALL_TARGET_MODULES) | |
763 | $(INSTALL_TARGET_MODULES): install-dirs | |
764 | @dir=`echo $@ | sed -e 's/install-//'`; \ | |
765 | if [ -f ./$${dir}/Makefile ] ; then \ | |
766 | rootme=`pwd`; export rootme; \ | |
767 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
768 | (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ | |
07362bd9 | 769 | else \ |
79337c85 | 770 | true; \ |
07362bd9 DZ |
771 | fi |
772 | ||
6a42d184 | 773 | # This rule is used to build the modules which use X11_FLAGS_TO_PASS. |
79337c85 ILT |
774 | # To build a target all-X means to cd to X and make all. |
775 | .PHONY: $(ALL_X11_MODULES) | |
776 | $(ALL_X11_MODULES): | |
777 | @dir=`echo $@ | sed -e 's/all-//'`; \ | |
778 | if [ -f ./$${dir}/Makefile ] ; then \ | |
779 | rootme=`pwd`; export rootme; \ | |
780 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
781 | (cd $${dir}; \ | |
782 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \ | |
07362bd9 | 783 | else \ |
79337c85 | 784 | true; \ |
07362bd9 DZ |
785 | fi |
786 | ||
6a42d184 DZ |
787 | # This rule is used to check the modules which use X11_FLAGS_TO_PASS. |
788 | # To build a target check-X means to cd to X and make all. | |
789 | .PHONY: $(CHECK_X11_MODULES) | |
790 | $(CHECK_X11_MODULES): | |
791 | @dir=`echo $@ | sed -e 's/check-//'`; \ | |
792 | if [ -f ./$${dir}/Makefile ] ; then \ | |
793 | rootme=`pwd`; export rootme; \ | |
794 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
795 | (cd $${dir}; \ | |
796 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \ | |
797 | else \ | |
798 | true; \ | |
799 | fi | |
800 | ||
801 | # This rule is used to install the modules which use X11_FLAGS_TO_PASS. | |
79337c85 ILT |
802 | # To build a target install-X means to cd to X and make install. |
803 | .PHONY: $(INSTALL_X11_MODULES) | |
804 | $(INSTALL_X11_MODULES): | |
6a42d184 | 805 | @dir=`echo $@ | sed -e 's/install-//'`; \ |
79337c85 ILT |
806 | if [ -f ./$${dir}/Makefile ] ; then \ |
807 | rootme=`pwd`; export rootme; \ | |
808 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
809 | (cd $${dir}; \ | |
810 | $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \ | |
07362bd9 | 811 | else \ |
79337c85 | 812 | true; \ |
07362bd9 DZ |
813 | fi |
814 | ||
79337c85 ILT |
815 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. |
816 | .PHONY: all-gcc | |
817 | all-gcc: | |
818 | @if [ -f ./gcc/Makefile ] ; then \ | |
819 | rootme=`pwd`; export rootme; \ | |
820 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
821 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ | |
07362bd9 | 822 | else \ |
79337c85 | 823 | true; \ |
07362bd9 DZ |
824 | fi |
825 | ||
65088029 ILT |
826 | .PHONY: check-gcc |
827 | check-gcc: | |
828 | @if [ -f ./gcc/Makefile ] ; then \ | |
829 | rootme=`pwd`; export rootme; \ | |
830 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
831 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ | |
832 | else \ | |
833 | true; \ | |
834 | fi | |
835 | ||
79337c85 ILT |
836 | .PHONY: install-gcc |
837 | install-gcc: | |
838 | @if [ -f ./gcc/Makefile ] ; then \ | |
839 | rootme=`pwd`; export rootme; \ | |
840 | srcroot=`cd $(srcdir); pwd`; export srcroot; \ | |
841 | (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ | |
07362bd9 | 842 | else \ |
79337c85 | 843 | true; \ |
07362bd9 DZ |
844 | fi |
845 | ||
79337c85 ILT |
846 | # This is a list of inter-dependencies among modules. |
847 | all-autoconf: | |
848 | all-bfd: | |
849 | all-binutils: all-libiberty all-opcodes all-bfd all-flex | |
850 | all-byacc: | |
851 | # start-sanitize-chill | |
852 | all-chillrt: all-binutils all-gas all-gcc all-newlib | |
853 | # end-sanitize-chill | |
854 | all-cvs: | |
855 | all-dejagnu: | |
856 | all-diff: all-libiberty | |
857 | all-emacs: | |
858 | all-etc: | |
c6ba9ae0 | 859 | all-expect: all-tcl all-tk |
275049c0 | 860 | all-fileutils: all-libiberty |
79337c85 | 861 | all-find: |
7dcc0664 | 862 | all-flex: all-libiberty all-byacc |
79337c85 ILT |
863 | all-gas: all-libiberty all-opcodes all-bfd |
864 | all-gawk: | |
865 | all-gcc: all-libiberty all-byacc all-binutils all-gas | |
a54e05f6 | 866 | all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim |
79337c85 ILT |
867 | all-glob: |
868 | all-gprof: all-libiberty all-bfd | |
869 | all-grep: | |
870 | all-gzip: all-libiberty | |
871 | all-hello: all-libiberty | |
872 | all-indent: | |
873 | all-ispell: all-emacs | |
874 | all-ld: all-libiberty all-bfd all-byacc all-flex | |
875 | all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib | |
876 | all-libiberty: | |
877 | all-m4: all-libiberty | |
878 | all-make: all-libiberty | |
879 | all-mmalloc: | |
880 | all-newlib: all-binutils all-gas all-gcc | |
275049c0 | 881 | all-opcodes: all-bfd |
79337c85 ILT |
882 | all-patch: |
883 | all-prms: | |
884 | all-rcs: | |
885 | all-readline: | |
886 | all-recode: all-libiberty | |
887 | all-sed: | |
888 | all-send-pr: | |
889 | all-shellutils: | |
890 | all-sim: all-libiberty all-bfd | |
07362bd9 | 891 | all-tar: all-libiberty |
79337c85 ILT |
892 | all-tcl: |
893 | all-tclX: all-tcl all-tk | |
894 | all-tk: all-tcl | |
895 | all-texinfo: all-libiberty | |
896 | all-textutils: | |
897 | all-tgas: all-libiberty all-bfd | |
898 | all-time: | |
899 | all-wdiff: | |
900 | all-uudecode: all-libiberty | |
901 | all-xiberty: all-gcc all-newlib | |
07362bd9 | 902 | |
79337c85 | 903 | ### other supporting targets |
07362bd9 | 904 | |
79337c85 ILT |
905 | MAKEDIRS= \ |
906 | $(prefix) \ | |
907 | $(exec_prefix) \ | |
908 | $(tooldir) | |
fca4f908 | 909 | |
79337c85 ILT |
910 | .PHONY: install-dirs |
911 | install-dirs: | |
912 | @for i in $(MAKEDIRS) ; do \ | |
913 | echo Making $$i... ; \ | |
914 | parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \ | |
915 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \ | |
916 | if [ ! -d $$i ] ; then \ | |
917 | if mkdir $$i ; then \ | |
918 | true ; \ | |
919 | else \ | |
920 | exit 1 ; \ | |
921 | fi ; \ | |
922 | else \ | |
923 | true ; \ | |
924 | fi ; \ | |
925 | done | |
23e3e7f9 | 926 | |
79337c85 ILT |
927 | .PHONY: install-info-dirs |
928 | install-info-dirs: | |
929 | if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi | |
930 | -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \ | |
931 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
932 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi | |
618f57a9 | 933 | |
79337c85 ILT |
934 | dir.info: do-install-info |
935 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
936 | $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ | |
937 | mv -f dir.info.new dir.info ; \ | |
938 | else true ; \ | |
72c09fbc | 939 | fi |
6b7e5998 | 940 | |
b1cceba2 DZ |
941 | dist: |
942 | @echo "Building a full distribution of this tree isn't done" | |
943 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
944 | ||
eb02fd64 RP |
945 | etags tags: TAGS |
946 | ||
02a7ba9a | 947 | TAGS: |
eb02fd64 RP |
948 | etags `$(MAKE) ls` |
949 | ||
950 | ls: | |
951 | @echo Makefile | |
952 | @for i in $(SUBDIRS); \ | |
953 | do \ | |
954 | (cd $$i; \ | |
955 | pwd=`pwd`; \ | |
956 | wd=`basename $$pwd`; \ | |
957 | for j in `$(MAKE) ls`; \ | |
958 | do \ | |
959 | echo $$wd/$$j; \ | |
960 | done) \ | |
961 | done | |
962 | ||
eb02fd64 RP |
963 | # with the gnu make, this is done automatically. |
964 | ||
f1eb48b6 | 965 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 966 | $(SHELL) ./config.status |
eb02fd64 | 967 | |
11954bf1 JG |
968 | # |
969 | # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc | |
970 | ||
d94d255d | 971 | DEVO_SUPPORT= README Makefile.in configure configure.in \ |
6d681784 JG |
972 | config.guess config.sub config move-if-change |
973 | ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \ | |
275049c0 | 974 | configure.texi standards.texi make-stds.texi |
72c09fbc | 975 | GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim |
d94d255d | 976 | GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) |
11954bf1 | 977 | |
79337c85 ILT |
978 | .PHONY: setup-dirs-gdb gdb.tar.Z make-gdb.tar.Z |
979 | setup-dirs-gdb: | |
11954bf1 | 980 | ./configure sun4 |
53222cbd | 981 | $(MAKE) clean |
11954bf1 | 982 | ./configure -rm sun4 |
42187387 | 983 | chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print` |
abc52b80 | 984 | |
40e16078 | 985 | gdb.tar.Z: setup-dirs-gdb |
42187387 | 986 | (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc") |
873045c1 | 987 | (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir) |
abc52b80 JG |
988 | $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z |
989 | ||
f980fcfb | 990 | make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex |
abc52b80 JG |
991 | rm -rf proto-toplev; mkdir proto-toplev |
992 | ln -s ../gdb/proto-gdb.dir proto-toplev/gdb | |
993 | (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \ | |
994 | ln -s ../$$i . ; \ | |
995 | done) | |
6d681784 JG |
996 | mkdir proto-toplev/etc |
997 | (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \ | |
998 | ln -s ../../etc/$$i . ; \ | |
999 | done) | |
7c9feeb7 RP |
1000 | # Put only one copy (four hard links) of COPYING in the tar file. |
1001 | rm proto-toplev/bfd/COPYING | |
1002 | ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING | |
1003 | rm proto-toplev/include/COPYING | |
1004 | ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING | |
1005 | rm proto-toplev/readline/COPYING | |
1006 | ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING | |
a50b5d9d JG |
1007 | |
1008 | # Take out texinfo and glob from configurable dirs | |
a3a063a9 | 1009 | rm proto-toplev/configure.in |
a50b5d9d JG |
1010 | sed -e '/^host_tools=/s/texinfo //' \ |
1011 | -e '/^host_libs=/s/glob //' \ | |
1012 | <configure.in >proto-toplev/configure.in | |
6995fe83 | 1013 | |
a50b5d9d JG |
1014 | # Take out texinfo from a few places; make simple BISON=bison line. |
1015 | rm proto-toplev/Makefile.in | |
1016 | sed -e '/^all\.normal: /s/\all-texinfo //' \ | |
1017 | -e '/^ install-texinfo /d' \ | |
40e16078 KR |
1018 | -e '/^BISON = /,/^$$/d' \ |
1019 | -e '/^# BISON:/s/.*/BISON = bison -y/' \ | |
6995fe83 SG |
1020 | <Makefile.in >proto-toplev/Makefile.in |
1021 | ||
abc52b80 | 1022 | mkdir proto-toplev/texinfo |
a50b5d9d | 1023 | ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ |
81246025 | 1024 | ln -s ../../texinfo/tex3patch proto-toplev/texinfo/ |
905bb120 | 1025 | chmod og=u `find proto-toplev -print` |
abc52b80 | 1026 | (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \ |
abc52b80 | 1027 | ln -s proto-toplev gdb-$$VER; \ |
85216403 FF |
1028 | echo "==> Making gdb-$$VER.tar.Z"; \ |
1029 | tar cfh - gdb-$$VER | $(COMPRESS) -v >gdb-$$VER.tar.Z; \ | |
1030 | echo "==> Making gdb-$$VER.tar.z"; \ | |
1031 | tar cfh - gdb-$$VER | $(GZIP) -v -9 >gdb-$$VER.tar.z) | |
0ec776a5 | 1032 | |
873045c1 FF |
1033 | # Make the testsuite archive separately. |
1034 | ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite | |
a54e05f6 KR |
1035 | # Blow away the Chill test that requires a Chill compiled executable, |
1036 | # since GNU Chill is not yet publically available. | |
1037 | rm -rf proto-toplev/gdb/testsuite/gdb.t31 | |
1038 | ||
873045c1 FF |
1039 | # Put a copy of COPYING in the tar file. |
1040 | ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING | |
1041 | chmod og=u `find proto-toplev/gdb/testsuite -print` | |
1042 | (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \ | |
1043 | echo "==> Making gdb-$$VER-testsuite.tar.Z"; \ | |
a54e05f6 KR |
1044 | tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \ |
1045 | gdb-$$VER/config.sub gdb-$$VER/move-if-change \ | |
1046 | gdb-$$VER/gdb/testsuite | \ | |
873045c1 FF |
1047 | $(COMPRESS) -v >gdb-$$VER-testsuite.tar.Z; \ |
1048 | echo "==> Making gdb-$$VER-testsuite.tar.z"; \ | |
a54e05f6 KR |
1049 | tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \ |
1050 | gdb-$$VER/config.sub gdb-$$VER/move-if-change \ | |
1051 | gdb-$$VER/gdb/testsuite | \ | |
873045c1 FF |
1052 | $(GZIP) -v -9 >gdb-$$VER-testsuite.tar.z) |
1053 | ||
40e16078 KR |
1054 | # When you use `make setup-dirs' or `make taz' you should always redefine |
1055 | # this macro. | |
1056 | SUPPORT_FILES = list-of-support-files-for-tool-in-question | |
7f9cb3b2 KR |
1057 | # Directories that might want `make diststuff' run. |
1058 | DISTSTUFFDIRS= ld gprof gdb | |
40e16078 | 1059 | |
a54e05f6 KR |
1060 | .PHONY: taz |
1061 | ||
7f9cb3b2 | 1062 | taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex texinfo/gpl.texinfo |
40e16078 KR |
1063 | ./configure sun4 |
1064 | $(MAKE) clean | |
1065 | ./configure -rm sun4 | |
2b6582b4 | 1066 | chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) $(TOOL) -print` |
7f9cb3b2 | 1067 | # Make links, and run "make diststuff" when needed. |
a54e05f6 KR |
1068 | # The `echo' for setting `p' is to convert all whitespace to spaces. |
1069 | # Then the `case' further below should tell whether $$d is in | |
7f9cb3b2 | 1070 | # DISTSTUFFDIRS. |
a54e05f6 | 1071 | rm -rf proto-toplev ; mkdir proto-toplev |
7f9cb3b2 KR |
1072 | set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \ |
1073 | p=" `echo $(DISTSTUFFDIRS)` " ; \ | |
a54e05f6 KR |
1074 | for d in $$dirs ; do \ |
1075 | if [ -d $$d ]; then \ | |
7f9cb3b2 KR |
1076 | case " $$p " in \ |
1077 | *" $$d "*) \ | |
1078 | echo making diststuff in $$d ; \ | |
1079 | (cd $$d ; $(MAKE) -f Makefile.in diststuff) || exit 1 ;; \ | |
a54e05f6 | 1080 | esac ; \ |
7f9cb3b2 KR |
1081 | if [ -d $$d/proto-$$d.dir ]; then \ |
1082 | ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \ | |
1083 | else \ | |
1084 | ln -s ../$$d proto-toplev/$$d ; \ | |
1085 | fi ; \ | |
a54e05f6 | 1086 | else ln -s ../$$d proto-toplev/$$d ; fi ; \ |
40e16078 | 1087 | done |
a54e05f6 | 1088 | # |
40e16078 KR |
1089 | mkdir proto-toplev/etc |
1090 | (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \ | |
1091 | ln -s ../../etc/$$i . ; \ | |
1092 | done) | |
a54e05f6 | 1093 | # |
40e16078 KR |
1094 | # Take out texinfo and glob from configurable dirs |
1095 | rm proto-toplev/configure.in | |
1096 | sed -e '/^host_tools=/s/texinfo //' \ | |
1097 | -e '/^host_libs=/s/glob //' \ | |
1098 | <configure.in >proto-toplev/configure.in | |
a54e05f6 | 1099 | # |
40e16078 KR |
1100 | # Take out texinfo from a few places; make simple BISON=bison line. |
1101 | rm proto-toplev/Makefile.in | |
1102 | sed -e '/^all\.normal: /s/\all-texinfo //' \ | |
1103 | -e '/^ install-texinfo /d' \ | |
1104 | -e '/^BISON = /,/^$$/d' \ | |
1105 | -e '/^# BISON:/s/.*/BISON = bison -y/' \ | |
1106 | <Makefile.in >proto-toplev/Makefile.in | |
a54e05f6 | 1107 | # |
40e16078 KR |
1108 | mkdir proto-toplev/texinfo |
1109 | ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ | |
7f9cb3b2 | 1110 | ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/ |
40e16078 KR |
1111 | ln -s ../../texinfo/tex3patch proto-toplev/texinfo/ |
1112 | chmod og=u `find proto-toplev -print` | |
7f9cb3b2 | 1113 | (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ |
40e16078 KR |
1114 | echo "==> Making $(TOOL)-$$VER.tar.z"; \ |
1115 | ln -s proto-toplev $(TOOL)-$$VER; \ | |
1116 | tar cfh - $(TOOL)-$$VER \ | |
96bfa612 | 1117 | | $(GZIP) -v -9 >$(TOOL)-$$VER.tar.gz) |
40e16078 | 1118 | |
7f9cb3b2 KR |
1119 | TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo |
1120 | DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) | |
40e16078 | 1121 | |
96bfa612 | 1122 | .PHONY: gas.tar.gz |
7f9cb3b2 | 1123 | GAS_SUPPORT_DIRS= bfd include libiberty opcodes |
96bfa612 | 1124 | gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas |
40e16078 KR |
1125 | $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas |
1126 | ||
7f9cb3b2 | 1127 | # The FSF "binutils" release includes gprof and ld. |
96bfa612 | 1128 | .PHONY: binutils.tar.gz |
7f9cb3b2 | 1129 | BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof |
96bfa612 | 1130 | binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils |
7f9cb3b2 KR |
1131 | $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" TOOL=binutils |
1132 | ||
96bfa612 | 1133 | .PHONY: gas+binutils.tar.gz |
a54e05f6 | 1134 | GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof |
96bfa612 | 1135 | gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas |
394ad658 | 1136 | $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" TOOL=gas |
79337c85 ILT |
1137 | |
1138 | .NOEXPORT: | |
1139 | MAKEOVERRIDES= | |
1140 | ||
1141 | # start-sanitize-chill | |
1142 | ## This is ugly, but I don't want GNU make to put these variables in | |
1143 | ## the environment. Older makes will see this as a set of targets | |
1144 | ## with no dependencies and no actions. | |
1145 | unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET : | |
1146 | # end-sanitize-chill | |
1147 | ||
eb02fd64 | 1148 | # end of Makefile.in |