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