]> gcc.gnu.org Git - gcc.git/blame - Makefile.in
t-linux (LIBGCC1, [...]): Add macros and set to empty.
[gcc.git] / Makefile.in
CommitLineData
6599da04
JM
1#
2# Makefile for directory with subdirs to build.
f75778a8 3# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation
6599da04
JM
4#
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19
20srcdir = .
21
22prefix = /usr/local
23
24exec_prefix = $(prefix)
25bindir = $(exec_prefix)/bin
26libdir = $(exec_prefix)/lib
27tooldir = $(exec_prefix)/$(target)
28
29program_transform_name =
30
31datadir = $(prefix)/share
32mandir = $(prefix)/man
33man1dir = $(mandir)/man1
34man2dir = $(mandir)/man2
35man3dir = $(mandir)/man3
36man4dir = $(mandir)/man4
37man5dir = $(mandir)/man5
38man6dir = $(mandir)/man6
39man7dir = $(mandir)/man7
40man8dir = $(mandir)/man8
41man9dir = $(mandir)/man9
42infodir = $(prefix)/info
43includedir = $(prefix)/include
44GDB_NLM_DEPS =
45
46SHELL = /bin/sh
47
48# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
49# cygwin32 host.
50INSTALL_PROGRAM_ARGS =
51
52INSTALL = $(SHELL) $$s/install-sh -c
53INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
54INSTALL_SCRIPT = $(INSTALL)
55INSTALL_DATA = $(INSTALL) -m 644
56
57INSTALL_DOSREL = install-dosrel-fake
58
59AS = as
60AR = ar
61AR_FLAGS = rc
62CC = cc
63
64# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
65# here so that they can be overridden by Makefile fragments.
66HOST_CC = $(CC_FOR_BUILD)
67HOST_PREFIX =
68HOST_PREFIX_1 = loser-
69
70# These flag values are normally overridden by the configure script.
71CFLAGS = -g
72CXXFLAGS = -g -O2
73
74LIBCFLAGS = $(CFLAGS)
75CFLAGS_FOR_TARGET = $(CFLAGS)
76LDFLAGS_FOR_TARGET =
77LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
78PICFLAG =
79PICFLAG_FOR_TARGET =
80
81CXX = c++
82
83# Use -O2 to stress test the compiler.
84LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
85CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
86LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
87
88RANLIB = ranlib
89
90DLLTOOL = dlltool
91WINDRES = windres
92
93NM = nm
94
95LD = ld
96
97# Not plain GZIP, since gzip looks there for extra command-line options.
98GZIPPROG = gzip
99
100# These values are substituted by configure.
101DEFAULT_YACC = yacc
102DEFAULT_LEX = lex
103
104BISON = `if [ -f $$r/bison/bison ] ; then \
105 echo $$r/bison/bison -L $$s/bison/ ; \
106 else \
107 echo bison ; \
108 fi`
109
110YACC = `if [ -f $$r/bison/bison ] ; then \
111 echo $$r/bison/bison -y -L $$s/bison/ ; \
112 elif [ -f $$r/byacc/byacc ] ; then \
113 echo $$r/byacc/byacc ; \
114 else \
115 echo ${DEFAULT_YACC} ; \
116 fi`
117
118LEX = `if [ -f $$r/flex/flex ] ; \
119 then echo $$r/flex/flex ; \
120 else echo ${DEFAULT_LEX} ; fi`
121
122M4 = `if [ -f $$r/m4/m4 ] ; \
123 then echo $$r/m4/m4 ; \
124 else echo m4 ; fi`
125
126MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
127 then echo $$r/texinfo/makeinfo/makeinfo ; \
128 else echo makeinfo ; fi`
129
130# This just becomes part of the MAKEINFO definition passed down to
131# sub-makes. It lets flags be given on the command line while still
132# using the makeinfo from the object tree.
133MAKEINFOFLAGS =
134
135EXPECT = `if [ -f $$r/expect/expect ] ; \
136 then echo $$r/expect/expect ; \
137 else echo expect ; fi`
138
139RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
140 then echo $$s/dejagnu/runtest ; \
141 else echo runtest ; fi`
142
143
144# compilers to use to create programs which must be run in the build
145# environment.
146CC_FOR_BUILD = $(CC)
147CXX_FOR_BUILD = $(CXX)
148
149SUBDIRS = "this is set via configure, don't edit this"
150OTHERS =
151
152# This is set by the configure script to the list of directories which
153# should be built using the target tools.
8821a725 154TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ libf2c winsup
6599da04
JM
155
156# Target libraries are put under this directory:
157# Changed by configure to $(target_alias) if cross.
158TARGET_SUBDIR = .
159
160# This is set by the configure script to the arguments passed to configure.
161CONFIG_ARGUMENTS =
162
163# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
164# was used.
165SET_LIB_PATH =
166
167# This is the name of the environment variable used for the path to
168# the libraries. This may be changed by configure.in.
169RPATH_ENVVAR = LD_LIBRARY_PATH
170
171# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
172REALLY_SET_LIB_PATH = \
173 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
174 export $(RPATH_ENVVAR);
175
176ALL = all.normal
177INSTALL_TARGET = installdirs \
96b0f1fc 178 install-gcc \
6599da04
JM
179 $(INSTALL_MODULES) \
180 $(INSTALL_TARGET_MODULES) \
181 $(INSTALL_X11_MODULES) \
6599da04
JM
182 $(INSTALL_DOSREL)
183
205cba53
JL
184INSTALL_TARGET_CROSS = installdirs \
185 install-gcc-cross \
186 $(INSTALL_MODULES) \
187 $(INSTALL_TARGET_MODULES) \
188 $(INSTALL_X11_MODULES) \
189 $(INSTALL_DOSREL)
6599da04
JM
190
191CC_FOR_TARGET = ` \
192 if [ -f $$r/gcc/xgcc ] ; then \
193 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
194 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
195 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
196 else \
197 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
198 fi; \
199 else \
200 echo $$r/gcc/xgcc -B$$r/gcc/; \
201 fi; \
202 else \
203 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
204 echo $(CC); \
205 else \
206 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
207 fi; \
208 fi`
209
210# If CC_FOR_TARGET is not overriden on the command line, then this
211# variable is passed down to the gcc Makefile, where it is used to
212# build libgcc2.a. We define it here so that it can itself be
213# overridden on the command line.
214GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
215
216
217CXX_FOR_TARGET = ` \
218 if [ -f $$r/gcc/xgcc ] ; then \
219 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
220 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
221 echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
222 else \
223 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
224 fi; \
225 else \
226 echo $$r/gcc/xgcc -B$$r/gcc/; \
227 fi; \
228 else \
229 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
230 echo $(CXX); \
231 else \
232 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
233 fi; \
234 fi`
235
236AS_FOR_TARGET = ` \
237 if [ -f $$r/gas/as-new ] ; then \
238 echo $$r/gas/as-new ; \
239 else \
240 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
241 echo $(AS); \
242 else \
243 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
244 fi; \
245 fi`
246
247LD_FOR_TARGET = ` \
248 if [ -f $$r/ld/ld-new ] ; then \
249 echo $$r/ld/ld-new ; \
250 else \
251 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
252 echo $(LD); \
253 else \
254 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
255 fi; \
256 fi`
257
258DLLTOOL_FOR_TARGET = ` \
259 if [ -f $$r/binutils/dlltool ] ; then \
260 echo $$r/binutils/dlltool ; \
261 else \
262 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
263 echo $(DLLTOOL); \
264 else \
265 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
266 fi; \
267 fi`
268
269WINDRES_FOR_TARGET = ` \
270 if [ -f $$r/binutils/windres ] ; then \
271 echo $$r/binutils/windres ; \
272 else \
273 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
274 echo $(WINDRES); \
275 else \
276 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
277 fi; \
278 fi`
279
280AR_FOR_TARGET = ` \
281 if [ -f $$r/binutils/ar ] ; then \
282 echo $$r/binutils/ar ; \
283 else \
284 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
285 echo $(AR); \
286 else \
287 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
288 fi; \
289 fi`
290
291RANLIB_FOR_TARGET = ` \
292 if [ -f $$r/binutils/ranlib ] ; then \
293 echo $$r/binutils/ranlib ; \
294 else \
295 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
296 echo $(RANLIB); \
297 else \
298 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
299 fi; \
300 fi`
301
302NM_FOR_TARGET = ` \
303 if [ -f $$r/binutils/nm-new ] ; then \
304 echo $$r/binutils/nm-new ; \
305 else \
306 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
307 echo $(NM); \
308 else \
309 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
310 fi; \
311 fi`
312
313#### host and target specific makefile fragments come in here.
314###
315
316# Flags to pass down to all sub-makes.
317# Please keep these in alphabetical order.
318BASE_FLAGS_TO_PASS = \
319 "AR_FLAGS=$(AR_FLAGS)" \
320 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
321 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
322 "BISON=$(BISON)" \
323 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
324 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
325 "CFLAGS=$(CFLAGS)" \
326 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
327 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
328 "CXXFLAGS=$(CXXFLAGS)" \
329 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
330 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
331 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
332 "INSTALL=$(INSTALL)" \
333 "INSTALL_DATA=$(INSTALL_DATA)" \
334 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
335 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
336 "LDFLAGS=$(LDFLAGS)" \
337 "LEX=$(LEX)" \
338 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
339 "LIBCFLAGS=$(LIBCFLAGS)" \
340 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
341 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
342 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
343 "M4=$(M4)" \
344 "MAKE=$(MAKE)" \
345 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
346 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
6599da04
JM
347 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
348 "SHELL=$(SHELL)" \
349 "EXPECT=$(EXPECT)" \
350 "RUNTEST=$(RUNTEST)" \
351 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
352 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
353 "YACC=$(YACC)" \
354 "exec_prefix=$(exec_prefix)" \
355 "prefix=$(prefix)" \
d0a8352c
MH
356 "tooldir=$(tooldir)" \
357 "gxx_include_dir=$(gxx_include_dir)"
6599da04
JM
358
359# Flags to pass down to most sub-makes, in which we're building with
360# the host environment.
361# If any variables are added here, they must be added to do-*, below.
362EXTRA_HOST_FLAGS = \
363 'AR=$(AR)' \
364 'AS=$(AS)' \
365 'CC=$(CC)' \
366 'CXX=$(CXX)' \
367 'DLLTOOL=$(DLLTOOL)' \
368 'LD=$(LD)' \
369 'NM=$(NM)' \
370 'RANLIB=$(RANLIB)' \
371 'WINDRES=$(WINDRES)'
372
373FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
374
375# Flags that are concerned with the location of the X11 include files
376# and library files
377#
378# NOTE: until the top-level is getting the values via autoconf, it only
379# causes problems to have this top-level Makefile overriding the autoconf-set
380# values in child directories. Only variables that don't conflict with
381# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
382#
383X11_FLAGS_TO_PASS = \
384 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
385 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
386
387# Flags to pass down to makes which are built with the target environment.
388# The double $ decreases the length of the command line; the variables
389# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
390# If any variables are added here, they must be added to do-*, below.
391EXTRA_TARGET_FLAGS = \
392 'AR=$$(AR_FOR_TARGET)' \
393 'AS=$$(AS_FOR_TARGET)' \
394 'CC=$$(CC_FOR_TARGET)' \
395 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
396 'CXX=$$(CXX_FOR_TARGET)' \
397 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
398 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
399 'LD=$$(LD_FOR_TARGET)' \
400 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
401 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
402 'NM=$$(NM_FOR_TARGET)' \
6599da04
JM
403 'RANLIB=$$(RANLIB_FOR_TARGET)' \
404 'WINDRES=$$(WINDRES_FOR_TARGET)'
405
406TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
407
408# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
409# unfortunately needs the native compiler and the target ar and
410# ranlib.
411# If any variables are added here, they must be added to do-*, below.
412# The HOST_* variables are a special case, which are used for the gcc
413# cross-building scheme.
414EXTRA_GCC_FLAGS = \
415 'AR=$$(AR_FOR_TARGET)' \
416 'AS=$(AS)' \
417 'CC=$(CC)' \
418 'CXX=$(CXX)' \
419 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
420 'HOST_CC=$(CC_FOR_BUILD)' \
421 'HOST_PREFIX=$(HOST_PREFIX)' \
422 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
423 'NM=$(NM)' \
424 'RANLIB=$$(RANLIB_FOR_TARGET)' \
425 'WINDRES=$$(WINDRES_FOR_TARGET)' \
426 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
427 "`if test x'$(LANGUAGES)' != x; then echo 'LANGUAGES=$(LANGUAGES)'; else echo 'XFOO=bar'; fi`" \
428 "`if test x'$(STMP_FIXPROTO)' != x; then echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)'; else echo 'XFOO=bar'; fi`" \
429 "`if test x'$(LIMITS_H_TEST)' != x; then echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)'; else echo 'XFOO=bar'; fi`" \
430 "`if test x'$(LIBGCC1_TEST)' != x; then echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)'; else echo 'XFOO=bar'; fi`" \
431 "`if test x'$(LIBGCC2_CFLAGS)' != x; then echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
432 "`if test x'$(LIBGCC2_DEBUG_CFLAGS)' != x; then echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
433 "`if test x'$(LIBGCC2_INCLUDES)' != x; then echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)'; else echo 'XFOO=bar'; fi`" \
434 "`if test x'$(ENQUIRE)' != x; then echo 'ENQUIRE=$(ENQUIRE)'; else echo 'XFOO=bar'; fi`" \
435 "`if test x'$(BOOT_CFLAGS)' != x; then echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)'; else echo 'XFOO=bar'; fi`"
436
437GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
438
439# This is a list of the targets for all of the modules which are compiled
440# using $(FLAGS_TO_PASS).
441ALL_MODULES = \
442 all-apache \
443 all-autoconf \
444 all-automake \
445 all-bash \
446 all-bfd \
447 all-binutils \
448 all-bison \
449 all-byacc \
450 all-cvs \
451 all-db \
452 all-dejagnu \
453 all-diff \
454 all-dosutils \
455 all-etc \
456 all-fileutils \
457 all-findutils \
458 all-find \
459 all-flex \
460 all-gas \
461 all-gawk \
462 all-gnuserv \
463 all-gprof \
464 all-grep \
465 all-grez \
466 all-gzip \
467 all-hello \
468 all-indent \
469 all-inet \
470 all-ispell \
471 all-itcl \
472 all-ld \
473 all-libiberty \
474 all-m4 \
475 all-make \
476 all-mmalloc \
477 all-opcodes \
478 all-patch \
479 all-perl \
480 all-prms \
481 all-rcs \
482 all-readline \
483 all-release \
484 all-recode \
485 all-sed \
486 all-send-pr \
487 all-shellutils \
488 all-sim \
489 all-sn \
490 all-tar \
491 all-tcl \
492 all-texinfo \
493 all-textutils \
494 all-tgas \
495 all-time \
496 all-uudecode \
497 all-wdiff
498
499# This is a list of the check targets for all of the modules which are
500# compiled using $(FLAGS_TO_PASS).
501#
502# The list is in two parts. The first lists those tools which
503# are tested as part of the host's native tool-chain, and not
504# tested in a cross configuration.
505NATIVE_CHECK_MODULES = \
506 check-bison \
507 check-byacc \
508 check-flex
509
510CROSS_CHECK_MODULES = \
511 check-apache \
512 check-autoconf \
513 check-automake \
514 check-bash \
515 check-bfd \
516 check-binutils \
517 check-cvs \
518 check-db \
519 check-dejagnu \
520 check-diff \
521 check-etc \
522 check-fileutils \
523 check-findutils \
524 check-find \
525 check-gas \
526 check-gawk \
527 check-gnuserv \
528 check-gprof \
529 check-grep \
530 check-gzip \
531 check-hello \
532 check-indent \
533 check-inet \
534 check-ispell \
535 check-itcl \
536 check-ld \
537 check-libiberty \
538 check-m4 \
539 check-make \
540 check-mmcheckoc \
541 check-opcodes \
542 check-patch \
543 check-perl \
544 check-prms \
545 check-rcs \
546 check-readline \
547 check-recode \
548 check-sed \
549 check-send-pr \
550 check-shellutils \
551 check-sn \
552 check-sim \
553 check-tar \
554 check-tcl \
555 check-texinfo \
556 check-textutils \
557 check-tgas \
558 check-time \
559 check-uudecode \
560 check-wdiff
561
562CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
563
564# This is a list of the install targets for all of the modules which are
565# compiled using $(FLAGS_TO_PASS).
566# We put install-opcodes before install-binutils because the installed
567# binutils might be on PATH, and they might need the shared opcodes
568# library.
569INSTALL_MODULES = \
570 install-apache \
571 install-autoconf \
572 install-automake \
573 install-bash \
574 install-bfd \
575 install-opcodes \
576 install-binutils \
577 install-bison \
578 install-byacc \
579 install-cvs \
580 install-db \
581 install-dejagnu \
582 install-diff \
583 install-dosutils \
584 install-etc \
585 install-fileutils \
586 install-findutils \
587 install-find \
588 install-flex \
589 install-gas \
590 install-gawk \
591 install-gnuserv \
592 install-gprof \
593 install-grep \
594 install-grez \
595 install-gzip \
596 install-hello \
597 install-indent \
598 install-inet \
599 install-ispell \
600 install-itcl \
601 install-ld \
602 install-libiberty \
603 install-m4 \
604 install-make \
605 install-mmalloc \
606 install-patch \
607 install-perl \
608 install-prms \
609 install-rcs \
610 install-readline \
611 install-recode \
612 install-sed \
613 install-send-pr \
614 install-shellutils \
615 install-sim \
616 install-sn \
617 install-tar \
618 install-tcl \
619 install-texinfo \
620 install-textutils \
621 install-tgas \
622 install-time \
623 install-uudecode \
624 install-wdiff
625
626# This is a list of the targets for all of the modules which are compiled
627# using $(X11_FLAGS_TO_PASS).
628ALL_X11_MODULES = \
629 all-emacs \
630 all-emacs19 \
631 all-gdb \
632 all-expect \
633 all-gash \
634 all-guile \
635 all-tclX \
636 all-tk \
637 all-tix
638
639# This is a list of the check targets for all of the modules which are
640# compiled using $(X11_FLAGS_TO_PASS).
641CHECK_X11_MODULES = \
642 check-emacs \
643 check-gdb \
644 check-guile \
645 check-expect \
646 check-gash \
647 check-tclX \
648 check-tk \
649 check-tix
650
651# This is a list of the install targets for all the modules which are
652# compiled using $(X11_FLAGS_TO_PASS).
653INSTALL_X11_MODULES = \
654 install-emacs \
655 install-emacs19 \
656 install-gdb \
657 install-guile \
658 install-expect \
659 install-gash \
660 install-tclX \
661 install-tk \
662 install-tix
663
664# This is a list of the targets for all of the modules which are compiled
665# using $(TARGET_FLAGS_TO_PASS).
666ALL_TARGET_MODULES = \
667 all-target-libio \
668 all-target-libstdc++ \
669 all-target-librx \
670 all-target-libg++ \
671 all-target-newlib \
8821a725 672 all-target-libf2c \
6599da04
JM
673 all-target-winsup \
674 all-target-libgloss \
675 all-target-libiberty \
676 all-target-gperf \
677 all-target-examples
678
679# This is a list of the configure targets for all of the modules which
680# are compiled using the target tools.
681CONFIGURE_TARGET_MODULES = \
682 configure-target-libio \
683 configure-target-libstdc++ \
684 configure-target-librx \
685 configure-target-libg++ \
686 configure-target-newlib \
8821a725 687 configure-target-libf2c \
6599da04
JM
688 configure-target-winsup \
689 configure-target-libgloss \
690 configure-target-libiberty \
691 configure-target-gperf \
692 configure-target-examples
693
694# This is a list of the check targets for all of the modules which are
695# compiled using $(TARGET_FLAGS_TO_PASS).
696CHECK_TARGET_MODULES = \
697 check-target-libio \
698 check-target-libstdc++ \
699 check-target-libg++ \
700 check-target-newlib \
8821a725 701 check-target-libf2c \
6599da04
JM
702 check-target-winsup \
703 check-target-libiberty \
704 check-target-gperf
705
706# This is a list of the install targets for all of the modules which are
707# compiled using $(TARGET_FLAGS_TO_PASS).
708INSTALL_TARGET_MODULES = \
709 install-target-libio \
710 install-target-libstdc++ \
711 install-target-libg++ \
712 install-target-newlib \
8821a725 713 install-target-libf2c \
6599da04
JM
714 install-target-winsup \
715 install-target-libgloss \
716 install-target-libiberty \
717 install-target-gperf
718
719# This is a list of the targets for which we can do a clean-{target}.
720CLEAN_MODULES = \
721 clean-apache \
722 clean-autoconf \
723 clean-automake \
724 clean-bash \
725 clean-bfd \
726 clean-binutils \
727 clean-bison \
728 clean-byacc \
729 clean-cvs \
730 clean-db \
731 clean-dejagnu \
732 clean-diff \
733 clean-dosutils \
734 clean-etc \
735 clean-fileutils \
736 clean-findutils \
737 clean-find \
738 clean-flex \
739 clean-gas \
740 clean-gawk \
741 clean-gnuserv \
742 clean-gprof \
743 clean-grep \
744 clean-grez \
745 clean-gzip \
746 clean-hello \
747 clean-indent \
748 clean-inet \
749 clean-ispell \
750 clean-itcl \
751 clean-ld \
752 clean-libiberty \
753 clean-m4 \
754 clean-make \
755 clean-mmalloc \
756 clean-opcodes \
757 clean-patch \
758 clean-perl \
759 clean-prms \
760 clean-rcs \
761 clean-readline \
762 clean-release \
763 clean-recode \
764 clean-sed \
765 clean-send-pr \
766 clean-shellutils \
767 clean-sim \
768 clean-sn \
769 clean-tar \
770 clean-tcl \
771 clean-texinfo \
772 clean-textutils \
773 clean-tgas \
774 clean-time \
775 clean-uudecode \
776 clean-wdiff
777
778# All of the target modules that can be cleaned
779CLEAN_TARGET_MODULES = \
780 clean-target-libio \
781 clean-target-libstdc++ \
782 clean-target-librx \
783 clean-target-libg++ \
784 clean-target-newlib \
8821a725 785 clean-target-libf2c \
6599da04
JM
786 clean-target-winsup \
787 clean-target-libgloss \
788 clean-target-libiberty \
789 clean-target-gperf \
790 clean-target-examples
791
792# All of the x11 modules that can be cleaned
793CLEAN_X11_MODULES = \
794 clean-emacs \
795 clean-emacs19 \
796 clean-gdb \
797 clean-expect \
798 clean-gash \
799 clean-guile \
800 clean-tclX \
801 clean-tk \
802 clean-tix
803
804# The first rule in the file had better be this one. Don't put any above it.
805all: all.normal
806.PHONY: all
807
808# The target built for a native build.
809.PHONY: all.normal
810all.normal: \
811 $(ALL_MODULES) \
812 $(ALL_X11_MODULES) \
813 $(ALL_TARGET_MODULES) \
814 all-gcc
815
816# Do a target for all the subdirectories. A ``make do-X'' will do a
817# ``make X'' in all subdirectories (because, in general, there is a
818# dependency (below) of X upon do-X, a ``make X'' will also do this,
819# but it may do additional work as well).
820# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
821# because it is so large that it can easily overflow the command line
822# length limit on some systems.
823DO_X = \
824 do-clean \
825 do-distclean \
826 do-dvi \
827 do-info \
828 do-install-info \
829 do-installcheck \
830 do-mostlyclean \
831 do-maintainer-clean \
832 do-TAGS
833.PHONY: $(DO_X)
834$(DO_X):
835 @target=`echo $@ | sed -e 's/^do-//'`; \
836 r=`pwd`; export r; \
837 s=`cd $(srcdir); pwd`; export s; \
838 $(SET_LIB_PATH) \
839 for i in $(SUBDIRS) -dummy-; do \
840 if [ -f ./$$i/Makefile ]; then \
841 case $$i in \
842 gcc) \
843 for flag in $(EXTRA_GCC_FLAGS); do \
844 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
845 done; \
846 ;; \
847 *) \
848 for flag in $(EXTRA_HOST_FLAGS); do \
849 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
850 done; \
851 ;; \
852 esac ; \
853 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
854 if (cd ./$$i; \
855 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
856 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
857 "RANLIB=$${RANLIB}" \
858 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
859 $${target}); \
860 then true; else exit 1; fi; \
861 else true; fi; \
862 done
863 @target=`echo $@ | sed -e 's/^do-//'`; \
864 r=`pwd`; export r; \
865 s=`cd $(srcdir); pwd`; export s; \
866 $(SET_LIB_PATH) \
867 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
868 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
869 for flag in $(EXTRA_TARGET_FLAGS); do \
870 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
871 done; \
872 export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
873 if (cd $(TARGET_SUBDIR)/$$i; \
874 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
875 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
876 "RANLIB=$${RANLIB}" \
877 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
878 $${target}); \
879 then true; else exit 1; fi; \
880 else true; fi; \
881 done
882
883# Here are the targets which correspond to the do-X targets.
884
885.PHONY: info installcheck dvi install-info
886.PHONY: clean distclean mostlyclean maintainer-clean realclean
887.PHONY: local-clean local-distclean local-maintainer-clean
888info: do-info
889installcheck: do-installcheck
890dvi: do-dvi
891
892# Make sure makeinfo is built before we do a `make info'.
893do-info: all-texinfo
894
895install-info: do-install-info dir.info
896 s=`cd $(srcdir); pwd`; export s; \
897 if [ -f dir.info ] ; then \
898 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
899 else true ; fi
900
901local-clean:
902 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
903
904local-distclean:
f401679e 905 -rm -f Makefile config.status config.cache mh-frag mt-frag
6599da04
JM
906 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
907 rm -rf $(TARGET_SUBDIR); \
908 else true; fi
909
910local-maintainer-clean:
911 @echo "This command is intended for maintainers to use;"
912 @echo "it deletes files that may require special tools to rebuild."
913
914clean: do-clean local-clean
915mostlyclean: do-mostlyclean local-clean
916distclean: do-distclean local-clean local-distclean
917maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
918maintainer-clean: local-distclean
919realclean: maintainer-clean
920
921# This rule is used to clean specific modules.
922.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
923$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
924 @dir=`echo $@ | sed -e 's/clean-//'`; \
925 if [ -f ./$${dir}/Makefile ] ; then \
926 r=`pwd`; export r; \
927 s=`cd $(srcdir); pwd`; export s; \
928 $(SET_LIB_PATH) \
929 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
930 else \
931 true; \
932 fi
933
934.PHONY: $(CLEAN_TARGET_MODULES)
935$(CLEAN_TARGET_MODULES):
936 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
937 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
938 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
939 r=`pwd`; export r; \
940 s=`cd $(srcdir); pwd`; export s; \
941 $(SET_LIB_PATH) \
942 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
943 else \
944 true; \
945 fi
946
947clean-target: $(CLEAN_TARGET_MODULES)
948
949# Check target.
950
951.PHONY: check
952check: $(CHECK_MODULES) \
953 $(CHECK_TARGET_MODULES) \
954 $(CHECK_X11_MODULES) \
955 check-gcc
956
957# Installation targets.
958
205cba53 959.PHONY: install install-cross uninstall source-vault binary-vault vault-install
6599da04 960install: $(INSTALL_TARGET)
205cba53 961install-cross: $(INSTALL_TARGET_CROSS)
6599da04
JM
962
963uninstall:
964 @echo "the uninstall target is not supported in this tree"
965
966source-vault:
967 $(MAKE) -f ./release/Build-A-Release \
968 host=$(host_alias) source-vault
969
970binary-vault:
971 $(MAKE) -f ./release/Build-A-Release \
972 host=$(host_alias) target=$(target_alias)
973
974vault-install:
975 @if [ -f ./release/vault-install ] ; then \
976 ./release/vault-install $(host_alias) $(target_alias) ; \
977 else \
978 true ; \
979 fi
980
981.PHONY: install.all
982install.all: install-no-fixedincludes
983 @if [ -f ./gcc/Makefile ] ; then \
984 r=`pwd` ; export r ; \
985 $(SET_LIB_PATH) \
986 (cd ./gcc; \
987 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
988 else \
989 true ; \
990 fi
991
992# inet-install is used because the I*Net wants DejaGNU installed but
993# not built. Similarly, gzip is built but not installed.
994inet-install:
995 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
996
997# install-no-fixedincludes is used because Cygnus can not distribute
998# the fixed header files.
999.PHONY: install-no-fixedincludes
1000install-no-fixedincludes: \
1001 installdirs \
1002 $(INSTALL_MODULES) \
1003 $(INSTALL_TARGET_MODULES) \
1004 $(INSTALL_X11_MODULES) \
1005 gcc-no-fixedincludes
1006
1007# Install the gcc headers files, but not the fixed include files,
1008# which Cygnus is not allowed to distribute. This rule is very
1009# dependent on the workings of the gcc Makefile.in.
1010.PHONY: gcc-no-fixedincludes
1011gcc-no-fixedincludes:
1012 @if [ -f ./gcc/Makefile ]; then \
1013 rm -rf gcc/tmp-include; \
1014 mv gcc/include gcc/tmp-include 2>/dev/null; \
1015 mkdir gcc/include; \
1016 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1017 touch gcc/stmp-fixinc gcc/include/fixed; \
1018 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1019 r=`pwd`; export r; \
1020 s=`cd $(srcdir); pwd` ; export s; \
1021 $(SET_LIB_PATH) \
1022 (cd ./gcc; \
1023 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1024 rm -rf gcc/include; \
1025 mv gcc/tmp-include gcc/include 2>/dev/null; \
1026 else true; fi
1027
1028# This rule is used to build the modules which use FLAGS_TO_PASS. To
1029# build a target all-X means to cd to X and make all.
1030#
1031# all-gui, and all-libproc are handled specially because
1032# they are still experimental, and if they fail to build, that
1033# shouldn't stop "make all".
1034.PHONY: $(ALL_MODULES) all-gui all-libproc
1035$(ALL_MODULES) all-gui all-libproc:
1036 @dir=`echo $@ | sed -e 's/all-//'`; \
1037 if [ -f ./$${dir}/Makefile ] ; then \
1038 r=`pwd`; export r; \
1039 s=`cd $(srcdir); pwd`; export s; \
1040 $(SET_LIB_PATH) \
1041 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1042 else \
1043 true; \
1044 fi
1045
1046# These rules are used to check the modules which use FLAGS_TO_PASS.
1047# To build a target check-X means to cd to X and make check. Some
1048# modules are only tested in a native toolchain.
1049
1050.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1051$(NATIVE_CHECK_MODULES):
1052 @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
1053 dir=`echo $@ | sed -e 's/check-//'`; \
1054 if [ -f ./$${dir}/Makefile ] ; then \
1055 r=`pwd`; export r; \
1056 s=`cd $(srcdir); pwd`; export s; \
1057 $(SET_LIB_PATH) \
1058 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1059 else \
1060 true; \
1061 fi; \
1062 fi
1063
1064$(CROSS_CHECK_MODULES):
1065 @dir=`echo $@ | sed -e 's/check-//'`; \
1066 if [ -f ./$${dir}/Makefile ] ; then \
1067 r=`pwd`; export r; \
1068 s=`cd $(srcdir); pwd`; export s; \
1069 $(SET_LIB_PATH) \
1070 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1071 else \
1072 true; \
1073 fi
1074
1075# This rule is used to install the modules which use FLAGS_TO_PASS.
1076# To build a target install-X means to cd to X and make install.
1077.PHONY: $(INSTALL_MODULES)
1078$(INSTALL_MODULES): installdirs
1079 @dir=`echo $@ | sed -e 's/install-//'`; \
1080 if [ -f ./$${dir}/Makefile ] ; then \
1081 r=`pwd`; export r; \
1082 s=`cd $(srcdir); pwd`; export s; \
1083 $(SET_LIB_PATH) \
1084 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1085 else \
1086 true; \
1087 fi
1088
1089# This rule is used to configure the modules which are built with the
1090# target tools.
1091.PHONY: $(CONFIGURE_TARGET_MODULES)
1092$(CONFIGURE_TARGET_MODULES):
1093 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1094 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1095 r=`pwd`; export r; \
1096 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1097 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1098 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1099 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1100 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1101 else \
1102 echo "Multilibs changed for $${dir}, reconfiguring"; \
1103 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1104 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1105 fi; \
1106 else \
1107 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1108 fi; \
1109 fi; \
1110 fi; exit 0 # break command into two pieces
1111 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1112 if [ ! -d $(TARGET_SUBDIR) ]; then \
1113 true; \
1114 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1115 true; \
1116 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1117 if [ -d $(srcdir)/$${dir} ]; then \
1118 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1119 r=`pwd`; export r; \
1120 s=`cd $(srcdir); pwd`; export s; \
1121 $(SET_LIB_PATH) \
1122 AR="$(AR_FOR_TARGET)"; export AR; \
1123 AS="$(AS_FOR_TARGET)"; export AS; \
1124 CC="$(CC_FOR_TARGET)"; export CC; \
1125 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1126 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1127 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1128 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1129 LD="$(LD_FOR_TARGET)"; export LD; \
1130 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1131 NM="$(NM_FOR_TARGET)"; export NM; \
1132 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1133 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1134 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1135 cd $(TARGET_SUBDIR)/$${dir}; \
1136 case $(srcdir) in \
1137 /*) \
1138 topdir=$(srcdir) ;; \
1139 *) \
1140 case "$(TARGET_SUBDIR)" in \
1141 .) topdir="../$(srcdir)" ;; \
1142 *) topdir="../../$(srcdir)" ;; \
1143 esac ;; \
1144 esac; \
1145 if [ "$(srcdir)" = "." ] ; then \
1146 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1147 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1148 if [ -f Makefile ]; then \
1149 if $(MAKE) distclean; then \
1150 true; \
1151 else \
1152 exit 1; \
1153 fi; \
1154 else \
1155 true; \
1156 fi; \
1157 else \
1158 exit 1; \
1159 fi; \
1160 else \
1161 true; \
1162 fi; \
1163 srcdiroption="--srcdir=."; \
1164 libsrcdir="."; \
1165 else \
1166 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1167 libsrcdir="$$s/$${dir}"; \
1168 fi; \
1169 if [ -f $${libsrcdir}/configure ] ; then \
ce0d965c 1170 CONFIG_SITE=/dev/null $(SHELL) $${libsrcdir}/configure \
6599da04
JM
1171 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1172 --with-target-subdir="$(TARGET_SUBDIR)"; \
1173 else \
ce0d965c 1174 CONFIG_SITE=/dev/null $(SHELL) $$s/configure \
6599da04
JM
1175 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1176 --with-target-subdir="$(TARGET_SUBDIR)"; \
1177 fi; \
1178 else \
1179 true; \
1180 fi; \
1181 else \
1182 true; \
1183 fi
1184
1185# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1186# To build a target all-X means to cd to X and make all.
1187.PHONY: $(ALL_TARGET_MODULES)
1188$(ALL_TARGET_MODULES):
1189 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1190 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1191 r=`pwd`; export r; \
1192 s=`cd $(srcdir); pwd`; export s; \
1193 $(SET_LIB_PATH) \
1194 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1195 else \
1196 true; \
1197 fi
1198
1199# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1200# To build a target install-X means to cd to X and make install.
1201.PHONY: $(CHECK_TARGET_MODULES)
1202$(CHECK_TARGET_MODULES):
1203 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1204 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1205 r=`pwd`; export r; \
1206 s=`cd $(srcdir); pwd`; export s; \
1207 $(SET_LIB_PATH) \
1208 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1209 else \
1210 true; \
1211 fi
1212
1213# This rule is used to install the modules which use
1214# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1215# and make install.
1216.PHONY: $(INSTALL_TARGET_MODULES)
1217$(INSTALL_TARGET_MODULES): installdirs
1218 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1219 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1220 r=`pwd`; export r; \
1221 s=`cd $(srcdir); pwd`; export s; \
1222 $(SET_LIB_PATH) \
1223 (cd $(TARGET_SUBDIR)/$${dir}; \
1224 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1225 else \
1226 true; \
1227 fi
1228
1229# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1230# To build a target all-X means to cd to X and make all.
1231.PHONY: $(ALL_X11_MODULES)
1232$(ALL_X11_MODULES):
1233 @dir=`echo $@ | sed -e 's/all-//'`; \
1234 if [ -f ./$${dir}/Makefile ] ; then \
1235 r=`pwd`; export r; \
1236 s=`cd $(srcdir); pwd`; export s; \
1237 $(SET_LIB_PATH) \
1238 (cd $${dir}; \
1239 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1240 else \
1241 true; \
1242 fi
1243
1244# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1245# To build a target check-X means to cd to X and make all.
1246.PHONY: $(CHECK_X11_MODULES)
1247$(CHECK_X11_MODULES):
1248 @dir=`echo $@ | sed -e 's/check-//'`; \
1249 if [ -f ./$${dir}/Makefile ] ; then \
1250 r=`pwd`; export r; \
1251 s=`cd $(srcdir); pwd`; export s; \
1252 $(SET_LIB_PATH) \
1253 (cd $${dir}; \
1254 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1255 else \
1256 true; \
1257 fi
1258
1259# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1260# To build a target install-X means to cd to X and make install.
1261.PHONY: $(INSTALL_X11_MODULES)
1262$(INSTALL_X11_MODULES): installdirs
1263 @dir=`echo $@ | sed -e 's/install-//'`; \
1264 if [ -f ./$${dir}/Makefile ] ; then \
1265 r=`pwd`; export r; \
1266 s=`cd $(srcdir); pwd`; export s; \
1267 $(SET_LIB_PATH) \
1268 (cd $${dir}; \
1269 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1270 else \
1271 true; \
1272 fi
1273
1274# gcc is the only module which uses GCC_FLAGS_TO_PASS.
1275.PHONY: all-gcc
1276all-gcc:
1277 @if [ -f ./gcc/Makefile ] ; then \
1278 r=`pwd`; export r; \
1279 s=`cd $(srcdir); pwd`; export s; \
1280 $(SET_LIB_PATH) \
1281 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1282 else \
1283 true; \
1284 fi
1285
ec20b1b9
JL
1286# Building GCC uses some tools for rebuilding "source" files
1287# like texinfo, bison/byacc, etc. So we must depend on those.
1288#
1289# While building GCC, it may be necessary to run various target
1290# programs like the assembler, linker, etc. So we depend on
1291# those too.
1292#
1293# In theory, on an SMP all those dependencies can be resolved
1294# in parallel.
1295#
cc71c0ca
MH
1296.PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap3 bootstrap4
1297bootstrap bootstrap-lean bootstrap2 bootstrap3 bootstrap4: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
ec20b1b9
JL
1298 @r=`pwd`; export r; \
1299 s=`cd $(srcdir); pwd`; export s; \
1300 $(SET_LIB_PATH) \
339c9b00
AO
1301 echo "Bootstrapping the compiler"; \
1302 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
ec20b1b9
JL
1303 @r=`pwd`; export r; \
1304 s=`cd $(srcdir); pwd`; export s; \
cc71c0ca
MH
1305 case "$@" in \
1306 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1307 compare=compare3 ;; \
1308 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1309 compare=compare-lean ;; \
1310 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1311 compare=compare ;; \
1312 esac; \
ec20b1b9 1313 $(SET_LIB_PATH) \
cc71c0ca
MH
1314 echo "$$msg"; \
1315 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
b1e3ddfd
AJ
1316 @echo "Building runtime libraries"; \
1317 $(MAKE) all
1318
09f97c1e
JL
1319.PHONY: cross
1320cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1321 @r=`pwd`; export r; \
1322 s=`cd $(srcdir); pwd`; export s; \
1323 $(SET_LIB_PATH) \
1324 echo "Building the C and C++ compiler"; \
1325 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1326 @echo "Building runtime libraries"; \
1327 $(MAKE) all LANGUAGES="c c++"
1328
6599da04
JM
1329.PHONY: check-gcc
1330check-gcc:
1331 @if [ -f ./gcc/Makefile ] ; then \
1332 r=`pwd`; export r; \
1333 s=`cd $(srcdir); pwd`; export s; \
1334 $(SET_LIB_PATH) \
1335 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1336 else \
1337 true; \
1338 fi
1339
1340.PHONY: install-gcc
1341install-gcc:
1342 @if [ -f ./gcc/Makefile ] ; then \
1343 r=`pwd`; export r; \
1344 s=`cd $(srcdir); pwd`; export s; \
1345 $(SET_LIB_PATH) \
205cba53 1346 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
6599da04
JM
1347 else \
1348 true; \
1349 fi
1350
205cba53
JL
1351.PHONY: install-gcc-cross
1352install-gcc-cross:
1353 @if [ -f ./gcc/Makefile ] ; then \
1354 r=`pwd`; export r; \
1355 s=`cd $(srcdir); pwd`; export s; \
1356 $(SET_LIB_PATH) \
1357 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1358 else \
1359 true; \
1360 fi
6599da04
JM
1361# EXPERIMENTAL STUFF
1362# This rule is used to install the modules which use FLAGS_TO_PASS.
1363# To build a target install-X means to cd to X and make install.
1364.PHONY: install-dosrel
1365install-dosrel: installdirs info
1366 @dir=`echo $@ | sed -e 's/install-//'`; \
1367 if [ -f ./$${dir}/Makefile ] ; then \
1368 r=`pwd`; export r; \
1369 s=`cd $(srcdir); pwd`; export s; \
1370 $(SET_LIB_PATH) \
1371 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1372 else \
1373 true; \
1374 fi
1375
1376install-dosrel-fake:
1377
1378
1379# This is a list of inter-dependencies among modules.
1380all-apache:
1381all-autoconf: all-m4 all-texinfo
1382all-automake:
1383all-bash:
1384all-bfd:
1385all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc
1386all-bison: all-texinfo
1387all-byacc:
1388all-cvs:
1389all-db:
1390all-dejagnu: all-tcl all-expect all-tk
1391all-diff: all-libiberty
1392all-emacs:
1393all-emacs19: all-bison all-byacc
1394all-etc:
1395configure-target-examples: $(ALL_GCC)
1396all-target-examples: configure-target-examples
1397all-expect: all-tcl all-tk
1398all-fileutils: all-libiberty
1399all-findutils:
1400all-find:
1401all-flex: all-libiberty all-bison all-byacc
1402all-gas: all-libiberty all-opcodes all-bfd
1403all-gash: all-tcl
1404all-gawk:
1405ALL_GCC = all-gcc
1406all-gcc: all-bison all-byacc all-binutils all-gas all-ld
6599da04
JM
1407GDB_TK = all-tk all-tcl all-itcl all-tix
1408all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1409all-gnuserv:
1410configure-target-gperf: $(ALL_GCC)
1411all-target-gperf: configure-target-gperf all-target-libiberty all-target-libg++
1412all-gprof: all-libiberty all-bfd all-opcodes
1413all-grep: all-libiberty
1414all-grez: all-libiberty all-bfd all-opcodes
1415all-gui: all-gdb all-libproc all-target-librx
1416all-guile:
1417all-gzip: all-libiberty
1418all-hello: all-libiberty
1419all-indent:
1420all-inet: all-tcl all-send-pr all-perl
1421all-ispell: all-emacs19
1422all-itcl: all-tcl all-tk
1423all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex
1424configure-target-libg++: $(ALL_GCC) configure-target-librx
1425all-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++
1426configure-target-libgloss: $(ALL_GCC)
1427all-target-libgloss: configure-target-libgloss configure-target-newlib
1428configure-target-libio: $(ALL_GCC)
1429all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
c9670e62 1430check-target-libio: all-target-libstdc++
6599da04
JM
1431all-libiberty:
1432configure-target-librx: $(ALL_GCC) configure-target-newlib
1433all-target-librx: configure-target-librx
1434configure-target-libstdc++: $(ALL_GCC)
1435all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
8821a725 1436all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib
6599da04
JM
1437all-m4: all-libiberty
1438all-make: all-libiberty
1439all-mmalloc:
1440configure-target-newlib: $(ALL_GCC)
1441all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1442all-opcodes: all-bfd all-libiberty
1443all-patch: all-libiberty
1444all-perl:
1445all-prms: all-libiberty
1446all-rcs:
1447all-readline:
1448all-recode: all-libiberty
1449all-sed: all-libiberty
1450all-send-pr: all-prms
1451all-shellutils:
1452all-sim: all-libiberty all-bfd all-opcodes
1453all-sn: all-tcl all-tk all-itcl all-db all-grep
1454all-tar: all-libiberty
1455all-tcl:
1456all-tclX: all-tcl all-tk
1457all-tk: all-tcl
1458all-texinfo: all-libiberty
1459all-textutils:
1460all-tgas: all-libiberty all-bfd all-opcodes
1461all-time:
1462all-tix: all-tcl all-tk
1463all-wdiff:
1464all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup
1465configure-target-winsup: configure-target-newlib
1466all-uudecode: all-libiberty
1467configure-target-libiberty: $(ALL_GCC)
1468all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1469all-target: $(ALL_TARGET_MODULES)
1470install-target: $(INSTALL_TARGET_MODULES)
1471
1472### other supporting targets
1473
1474MAKEDIRS= \
1475 $(prefix) \
1476 $(exec_prefix)
1477.PHONY: installdirs
1478installdirs: mkinstalldirs
1479 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1480
1481dir.info: do-install-info
1482 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1483 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1484 mv -f dir.info.new dir.info ; \
1485 else true ; \
1486 fi
1487
1488dist:
1489 @echo "Building a full distribution of this tree isn't done"
1490 @echo "via 'make dist'. Check out the etc/ subdirectory"
1491
1492etags tags: TAGS
1493
1494# Right now this just builds TAGS in each subdirectory. emacs19 has the
1495# ability to use several tags files at once, so there is probably no need
1496# to combine them into one big TAGS file (like CVS 1.3 does). We could
1497# (if we felt like it) have this Makefile write a piece of elisp which
1498# the user could load to tell emacs19 where all the TAGS files we just
1499# built are.
1500TAGS: do-TAGS
1501
1502# with the gnu make, this is done automatically.
1503
1504Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1505 $(SHELL) ./config.status
1506
1507#
1508# Support for building net releases
1509
1510# Files in devo used in any net release.
1511# ChangeLog omitted because it may refer to files which are not in this
1512# distribution (perhaps it would be better to include it anyway).
1513DEVO_SUPPORT= README Makefile.in configure configure.in \
1514 config.guess config.sub config move-if-change \
1515 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1516 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1517 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1518
1519# Files in devo/etc used in any net release.
1520# ChangeLog omitted because it may refer to files which are not in this
1521# distribution (perhaps it would be better to include it anyway).
1522ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1523 make-stds.texi standards.info*
1524
1525# When you use `make setup-dirs' or `make taz' you should always redefine
1526# this macro.
1527SUPPORT_FILES = list-of-support-files-for-tool-in-question
1528
1529.PHONY: taz
1530
1531taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1532 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1533 # Take out texinfo from a few places; make simple BISON=bison line.
1534 sed -e '/^all\.normal: /s/\all-texinfo //' \
1535 -e '/^ install-texinfo /d' \
1536 <Makefile.in >tmp
1537 mv -f tmp Makefile.in
1538 #
1539 ./configure sun4
1540 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1541 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1542 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1543 # Make links, and run "make diststuff" or "make info" when needed.
1544 rm -rf proto-toplev ; mkdir proto-toplev
1545 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1546 for d in $$dirs ; do \
1547 if [ -d $$d ]; then \
1548 if [ ! -f $$d/Makefile ] ; then true ; \
1549 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1550 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1551 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1552 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1553 fi ; \
1554 if [ -d $$d/proto-$$d.dir ]; then \
1555 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1556 else \
1557 ln -s ../$$d proto-toplev/$$d ; \
1558 fi ; \
1559 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1560 done
1561 cd etc ; $(MAKE) info
1562 $(MAKE) distclean
1563 #
1564 mkdir proto-toplev/etc
1565 (cd proto-toplev/etc; \
1566 for i in $(ETC_SUPPORT); do \
1567 ln -s ../../etc/$$i . ; \
1568 done)
1569 #
1570 # Take out texinfo from configurable dirs
1571 rm proto-toplev/configure.in
1572 sed -e '/^host_tools=/s/texinfo //' \
1573 <configure.in >proto-toplev/configure.in
1574 #
1575 mkdir proto-toplev/texinfo
1576 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1577 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1578 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1579 if test -r texinfo/util/tex3patch ; then \
1580 mkdir proto-toplev/texinfo/util && \
1581 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1582 else true; fi
1583 chmod og=u `find . -print`
1584 if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1585 ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
1586 else \
1587 ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1588 fi; \
1589 $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
1590
1591do-tar-gz:
1592 echo "==> Making $(TOOL)-$(VER).tar.gz"
1593 -rm -f $(TOOL)-$(VER)
1594 ln -s proto-toplev $(TOOL)-$(VER)
1595 tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1596 $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1597
1598TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1599DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1600
1601.PHONY: gas.tar.gz
1602GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1603gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1604 $(MAKE) -f Makefile.in taz TOOL=gas \
1605 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1606
1607# The FSF "binutils" release includes gprof and ld.
1608.PHONY: binutils.tar.gz
1609BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1610binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1611 $(MAKE) -f Makefile.in taz TOOL=binutils \
1612 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1613
1614.PHONY: gas+binutils.tar.gz
1615GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1616gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1617 $(MAKE) -f Makefile.in taz TOOL=gas \
1618 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1619
1620.PHONY: libg++.tar.gz
1621LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1622libg++.tar.gz: $(DIST_SUPPORT) libg++
1623 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1624 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1625
1626GNATS_SUPPORT_DIRS=include libiberty send-pr
1627gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1628 $(MAKE) -f Makefile.in taz TOOL=gnats \
1629 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1630
1631.PHONY: gdb.tar.gz
1632GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1633GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1634gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1635 $(MAKE) -f Makefile.in taz TOOL=gdb \
1636 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1637
1638.PHONY: newlib.tar.gz
1639NEWLIB_SUPPORT_DIRS=libgloss
1640# taz configures for the sun4 target which won't configure newlib.
1641# We need newlib configured so that the .info files are made.
1642# Unfortunately, it is not enough to just configure newlib separately:
1643# taz will build the .info files but since SUBDIRS won't contain newlib,
1644# distclean won't be run (leaving Makefile, config.status, and the tmp files
1645# used in building the .info files, eg: *.def, *.ref).
1646# The problem isn't solvable however without a lot of extra work because
1647# target libraries are built in subdir $(target_alias) which gets nuked during
1648# the make distclean. For now punt on the issue of shipping newlib info files
1649# with newlib net releases and wait for a day when some native target (sun4?)
1650# supports newlib (if only minimally).
1651newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1652 $(MAKE) -f Makefile.in taz TOOL=newlib \
1653 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1654 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1655
1656.NOEXPORT:
1657MAKEOVERRIDES=
1658
1659
1660# end of Makefile.in
This page took 0.207342 seconds and 5 git commands to generate.