Imported fixes for testsuite failures from psion branch.
[official-gcc.git] / Makefile.in
blob4187c4384eb050c84835b06b41b676808356a774
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 GDB_NLM_DEPS =
46 SHELL = /bin/sh
48 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
49 # cygwin32 host.
50 INSTALL_PROGRAM_ARGS =
52 INSTALL = $(SHELL) $$s/install-sh -c
53 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
54 INSTALL_SCRIPT = $(INSTALL)
55 INSTALL_DATA = $(INSTALL) -m 644
57 INSTALL_DOSREL = install-dosrel-fake
59 AS = as
60 AR = ar
61 AR_FLAGS = rc
62 CC = cc
64 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
65 # here so that they can be overridden by Makefile fragments.
66 HOST_CC = $(CC_FOR_BUILD)
67 HOST_PREFIX =
68 HOST_PREFIX_1 = loser-
70 # These flag values are normally overridden by the configure script.
71 CFLAGS = -g
72 CXXFLAGS = -g -O2
74 LIBCFLAGS = $(CFLAGS)
75 CFLAGS_FOR_TARGET = $(CFLAGS)
76 LDFLAGS_FOR_TARGET =
77 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
78 PICFLAG =
79 PICFLAG_FOR_TARGET =
81 CXX = c++
83 # Use -O2 to stress test the compiler.
84 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
85 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
86 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
88 RANLIB = ranlib
90 DLLTOOL = dlltool
91 WINDRES = windres
93 NM = nm
95 LD = ld
97 # Not plain GZIP, since gzip looks there for extra command-line options.
98 GZIPPROG = gzip
100 # These values are substituted by configure.
101 DEFAULT_YACC = yacc
102 DEFAULT_LEX = lex
103 DEFAULT_M4 = m4
105 BISON = `if [ -f $$r/bison/bison ] ; then \
106 echo $$r/bison/bison -L $$s/bison/ ; \
107 else \
108 echo bison ; \
111 YACC = `if [ -f $$r/bison/bison ] ; then \
112 echo $$r/bison/bison -y -L $$s/bison/ ; \
113 elif [ -f $$r/byacc/byacc ] ; then \
114 echo $$r/byacc/byacc ; \
115 else \
116 echo ${DEFAULT_YACC} ; \
119 LEX = `if [ -f $$r/flex/flex ] ; \
120 then echo $$r/flex/flex ; \
121 else echo ${DEFAULT_LEX} ; fi`
123 M4 = `if [ -f $$r/m4/m4 ] ; \
124 then echo $$r/m4/m4 ; \
125 else echo ${DEFAULT_M4} ; fi`
127 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \
128 then echo $$r/texinfo/makeinfo/makeinfo ; \
129 else echo makeinfo ; fi`
131 # This just becomes part of the MAKEINFO definition passed down to
132 # sub-makes. It lets flags be given on the command line while still
133 # using the makeinfo from the object tree.
134 MAKEINFOFLAGS =
136 EXPECT = `if [ -f $$r/expect/expect ] ; \
137 then echo $$r/expect/expect ; \
138 else echo expect ; fi`
140 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
141 then echo $$s/dejagnu/runtest ; \
142 else echo runtest ; fi`
145 # compilers to use to create programs which must be run in the build
146 # environment.
147 CC_FOR_BUILD = $(CC)
148 CXX_FOR_BUILD = $(CXX)
150 SUBDIRS = "this is set via configure, don't edit this"
151 OTHERS =
153 # This is set by the configure script to the list of directories which
154 # should be built using the target tools.
155 TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ libf2c winsup
157 # Target libraries are put under this directory:
158 # Changed by configure to $(target_alias) if cross.
159 TARGET_SUBDIR = .
161 # This is set by the configure script to the arguments passed to configure.
162 CONFIG_ARGUMENTS =
164 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
165 # was used.
166 SET_LIB_PATH =
168 # This is the name of the environment variable used for the path to
169 # the libraries. This may be changed by configure.in.
170 RPATH_ENVVAR = LD_LIBRARY_PATH
172 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
173 REALLY_SET_LIB_PATH = \
174 $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
175 export $(RPATH_ENVVAR);
177 ALL = all.normal
178 INSTALL_TARGET = installdirs \
179 install-gcc \
180 $(INSTALL_MODULES) \
181 $(INSTALL_TARGET_MODULES) \
182 $(INSTALL_X11_MODULES) \
183 $(INSTALL_DOSREL)
185 INSTALL_TARGET_CROSS = installdirs \
186 install-gcc-cross \
187 $(INSTALL_MODULES) \
188 $(INSTALL_TARGET_MODULES) \
189 $(INSTALL_X11_MODULES) \
190 $(INSTALL_DOSREL)
192 CC_FOR_TARGET = ` \
193 if [ -f $$r/gcc/xgcc ] ; then \
194 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
195 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
196 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; \
197 else \
198 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
199 fi; \
200 else \
201 echo $$r/gcc/xgcc -B$$r/gcc/; \
202 fi; \
203 else \
204 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
205 echo $(CC); \
206 else \
207 t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
208 fi; \
211 # If CC_FOR_TARGET is not overriden on the command line, then this
212 # variable is passed down to the gcc Makefile, where it is used to
213 # build libgcc2.a. We define it here so that it can itself be
214 # overridden on the command line.
215 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
218 CXX_FOR_TARGET = ` \
219 if [ -f $$r/gcc/xgcc ] ; then \
220 if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
221 if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
222 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; \
223 else \
224 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
225 fi; \
226 else \
227 echo $$r/gcc/xgcc -B$$r/gcc/; \
228 fi; \
229 else \
230 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
231 echo $(CXX); \
232 else \
233 t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
234 fi; \
237 AS_FOR_TARGET = ` \
238 if [ -f $$r/gas/as-new ] ; then \
239 echo $$r/gas/as-new ; \
240 else \
241 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
242 echo $(AS); \
243 else \
244 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
245 fi; \
248 LD_FOR_TARGET = ` \
249 if [ -f $$r/ld/ld-new ] ; then \
250 echo $$r/ld/ld-new ; \
251 else \
252 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
253 echo $(LD); \
254 else \
255 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
256 fi; \
259 DLLTOOL_FOR_TARGET = ` \
260 if [ -f $$r/binutils/dlltool ] ; then \
261 echo $$r/binutils/dlltool ; \
262 else \
263 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
264 echo $(DLLTOOL); \
265 else \
266 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
267 fi; \
270 WINDRES_FOR_TARGET = ` \
271 if [ -f $$r/binutils/windres ] ; then \
272 echo $$r/binutils/windres ; \
273 else \
274 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
275 echo $(WINDRES); \
276 else \
277 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
278 fi; \
281 AR_FOR_TARGET = ` \
282 if [ -f $$r/binutils/ar ] ; then \
283 echo $$r/binutils/ar ; \
284 else \
285 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
286 echo $(AR); \
287 else \
288 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
289 fi; \
292 RANLIB_FOR_TARGET = ` \
293 if [ -f $$r/binutils/ranlib ] ; then \
294 echo $$r/binutils/ranlib ; \
295 else \
296 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
297 echo $(RANLIB); \
298 else \
299 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
300 fi; \
303 NM_FOR_TARGET = ` \
304 if [ -f $$r/binutils/nm-new ] ; then \
305 echo $$r/binutils/nm-new ; \
306 else \
307 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
308 echo $(NM); \
309 else \
310 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
311 fi; \
314 #### host and target specific makefile fragments come in here.
317 # Flags to pass down to all sub-makes.
318 # Please keep these in alphabetical order.
319 BASE_FLAGS_TO_PASS = \
320 "AR_FLAGS=$(AR_FLAGS)" \
321 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
322 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
323 "BISON=$(BISON)" \
324 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
325 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
326 "CFLAGS=$(CFLAGS)" \
327 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
328 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
329 "CXXFLAGS=$(CXXFLAGS)" \
330 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
331 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
332 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
333 "INSTALL=$(INSTALL)" \
334 "INSTALL_DATA=$(INSTALL_DATA)" \
335 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
336 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
337 "LDFLAGS=$(LDFLAGS)" \
338 "LEX=$(LEX)" \
339 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
340 "LIBCFLAGS=$(LIBCFLAGS)" \
341 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
342 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
343 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
344 "M4=$(M4)" \
345 "MAKE=$(MAKE)" \
346 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
347 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
348 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
349 "SHELL=$(SHELL)" \
350 "EXPECT=$(EXPECT)" \
351 "RUNTEST=$(RUNTEST)" \
352 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
353 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
354 "YACC=$(YACC)" \
355 "exec_prefix=$(exec_prefix)" \
356 "prefix=$(prefix)" \
357 "tooldir=$(tooldir)" \
358 "gxx_include_dir=$(gxx_include_dir)"
360 # Flags to pass down to most sub-makes, in which we're building with
361 # the host environment.
362 # If any variables are added here, they must be added to do-*, below.
363 EXTRA_HOST_FLAGS = \
364 'AR=$(AR)' \
365 'AS=$(AS)' \
366 'CC=$(CC)' \
367 'CXX=$(CXX)' \
368 'DLLTOOL=$(DLLTOOL)' \
369 'LD=$(LD)' \
370 'NM=$(NM)' \
371 'RANLIB=$(RANLIB)' \
372 'WINDRES=$(WINDRES)'
374 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
376 # Flags that are concerned with the location of the X11 include files
377 # and library files
379 # NOTE: until the top-level is getting the values via autoconf, it only
380 # causes problems to have this top-level Makefile overriding the autoconf-set
381 # values in child directories. Only variables that don't conflict with
382 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
384 X11_FLAGS_TO_PASS = \
385 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
386 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
388 # Flags to pass down to makes which are built with the target environment.
389 # The double $ decreases the length of the command line; the variables
390 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
391 # If any variables are added here, they must be added to do-*, below.
392 EXTRA_TARGET_FLAGS = \
393 'AR=$$(AR_FOR_TARGET)' \
394 'AS=$$(AS_FOR_TARGET)' \
395 'CC=$$(CC_FOR_TARGET)' \
396 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
397 'CXX=$$(CXX_FOR_TARGET)' \
398 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
399 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
400 'LD=$$(LD_FOR_TARGET)' \
401 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
402 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
403 'NM=$$(NM_FOR_TARGET)' \
404 'RANLIB=$$(RANLIB_FOR_TARGET)' \
405 'WINDRES=$$(WINDRES_FOR_TARGET)'
407 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
409 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
410 # unfortunately needs the native compiler and the target ar and
411 # ranlib.
412 # If any variables are added here, they must be added to do-*, below.
413 # The HOST_* variables are a special case, which are used for the gcc
414 # cross-building scheme.
415 EXTRA_GCC_FLAGS = \
416 'AR=$$(AR_FOR_TARGET)' \
417 'AS=$(AS)' \
418 'CC=$(CC)' \
419 'CXX=$(CXX)' \
420 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
421 'HOST_CC=$(CC_FOR_BUILD)' \
422 'HOST_PREFIX=$(HOST_PREFIX)' \
423 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
424 'NM=$(NM)' \
425 'RANLIB=$$(RANLIB_FOR_TARGET)' \
426 'WINDRES=$$(WINDRES_FOR_TARGET)' \
427 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
428 "`if test x'$(LANGUAGES)' != x; then echo 'LANGUAGES=$(LANGUAGES)'; else echo 'XFOO=bar'; fi`" \
429 "`if test x'$(STMP_FIXPROTO)' != x; then echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)'; else echo 'XFOO=bar'; fi`" \
430 "`if test x'$(LIMITS_H_TEST)' != x; then echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)'; else echo 'XFOO=bar'; fi`" \
431 "`if test x'$(LIBGCC1_TEST)' != x; then echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)'; else echo 'XFOO=bar'; fi`" \
432 "`if test x'$(LIBGCC2_CFLAGS)' != x; then echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
433 "`if test x'$(LIBGCC2_DEBUG_CFLAGS)' != x; then echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
434 "`if test x'$(LIBGCC2_INCLUDES)' != x; then echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)'; else echo 'XFOO=bar'; fi`" \
435 "`if test x'$(ENQUIRE)' != x; then echo 'ENQUIRE=$(ENQUIRE)'; else echo 'XFOO=bar'; fi`" \
436 "`if test x'$(BOOT_CFLAGS)' != x; then echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)'; else echo 'XFOO=bar'; fi`"
438 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
440 # This is a list of the targets for all of the modules which are compiled
441 # using $(FLAGS_TO_PASS).
442 ALL_MODULES = \
443 all-apache \
444 all-autoconf \
445 all-automake \
446 all-bash \
447 all-bfd \
448 all-binutils \
449 all-bison \
450 all-byacc \
451 all-cvs \
452 all-db \
453 all-dejagnu \
454 all-diff \
455 all-dosutils \
456 all-etc \
457 all-fileutils \
458 all-findutils \
459 all-find \
460 all-flex \
461 all-gas \
462 all-gawk \
463 all-gnuserv \
464 all-gprof \
465 all-grep \
466 all-grez \
467 all-gzip \
468 all-hello \
469 all-indent \
470 all-inet \
471 all-ispell \
472 all-itcl \
473 all-ld \
474 all-libiberty \
475 all-m4 \
476 all-make \
477 all-mmalloc \
478 all-opcodes \
479 all-patch \
480 all-perl \
481 all-prms \
482 all-rcs \
483 all-readline \
484 all-release \
485 all-recode \
486 all-sed \
487 all-send-pr \
488 all-shellutils \
489 all-sim \
490 all-sn \
491 all-tar \
492 all-tcl \
493 all-texinfo \
494 all-textutils \
495 all-tgas \
496 all-time \
497 all-uudecode \
498 all-wdiff
500 # This is a list of the check targets for all of the modules which are
501 # compiled using $(FLAGS_TO_PASS).
503 # The list is in two parts. The first lists those tools which
504 # are tested as part of the host's native tool-chain, and not
505 # tested in a cross configuration.
506 NATIVE_CHECK_MODULES = \
507 check-bison \
508 check-byacc \
509 check-flex
511 CROSS_CHECK_MODULES = \
512 check-apache \
513 check-autoconf \
514 check-automake \
515 check-bash \
516 check-bfd \
517 check-binutils \
518 check-cvs \
519 check-db \
520 check-dejagnu \
521 check-diff \
522 check-etc \
523 check-fileutils \
524 check-findutils \
525 check-find \
526 check-gas \
527 check-gawk \
528 check-gnuserv \
529 check-gprof \
530 check-grep \
531 check-gzip \
532 check-hello \
533 check-indent \
534 check-inet \
535 check-ispell \
536 check-itcl \
537 check-ld \
538 check-libiberty \
539 check-m4 \
540 check-make \
541 check-mmcheckoc \
542 check-opcodes \
543 check-patch \
544 check-perl \
545 check-prms \
546 check-rcs \
547 check-readline \
548 check-recode \
549 check-sed \
550 check-send-pr \
551 check-shellutils \
552 check-sn \
553 check-sim \
554 check-tar \
555 check-tcl \
556 check-texinfo \
557 check-textutils \
558 check-tgas \
559 check-time \
560 check-uudecode \
561 check-wdiff
563 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
565 # This is a list of the install targets for all of the modules which are
566 # compiled using $(FLAGS_TO_PASS).
567 # We put install-opcodes before install-binutils because the installed
568 # binutils might be on PATH, and they might need the shared opcodes
569 # library.
570 INSTALL_MODULES = \
571 install-apache \
572 install-autoconf \
573 install-automake \
574 install-bash \
575 install-bfd \
576 install-opcodes \
577 install-binutils \
578 install-bison \
579 install-byacc \
580 install-cvs \
581 install-db \
582 install-dejagnu \
583 install-diff \
584 install-dosutils \
585 install-etc \
586 install-fileutils \
587 install-findutils \
588 install-find \
589 install-flex \
590 install-gas \
591 install-gawk \
592 install-gnuserv \
593 install-gprof \
594 install-grep \
595 install-grez \
596 install-gzip \
597 install-hello \
598 install-indent \
599 install-inet \
600 install-ispell \
601 install-itcl \
602 install-ld \
603 install-libiberty \
604 install-m4 \
605 install-make \
606 install-mmalloc \
607 install-patch \
608 install-perl \
609 install-prms \
610 install-rcs \
611 install-readline \
612 install-recode \
613 install-sed \
614 install-send-pr \
615 install-shellutils \
616 install-sim \
617 install-sn \
618 install-tar \
619 install-tcl \
620 install-textutils \
621 install-tgas \
622 install-time \
623 install-uudecode \
624 install-wdiff
626 # This is a list of the targets for all of the modules which are compiled
627 # using $(X11_FLAGS_TO_PASS).
628 ALL_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
639 # This is a list of the check targets for all of the modules which are
640 # compiled using $(X11_FLAGS_TO_PASS).
641 CHECK_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
651 # This is a list of the install targets for all the modules which are
652 # compiled using $(X11_FLAGS_TO_PASS).
653 INSTALL_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
664 # This is a list of the targets for all of the modules which are compiled
665 # using $(TARGET_FLAGS_TO_PASS).
666 ALL_TARGET_MODULES = \
667 all-target-libio \
668 all-target-libstdc++ \
669 all-target-librx \
670 all-target-libg++ \
671 all-target-newlib \
672 all-target-libf2c \
673 all-target-winsup \
674 all-target-libgloss \
675 all-target-libiberty \
676 all-target-gperf \
677 all-target-examples
679 # This is a list of the configure targets for all of the modules which
680 # are compiled using the target tools.
681 CONFIGURE_TARGET_MODULES = \
682 configure-target-libio \
683 configure-target-libstdc++ \
684 configure-target-librx \
685 configure-target-libg++ \
686 configure-target-newlib \
687 configure-target-libf2c \
688 configure-target-winsup \
689 configure-target-libgloss \
690 configure-target-libiberty \
691 configure-target-gperf \
692 configure-target-examples
694 # This is a list of the check targets for all of the modules which are
695 # compiled using $(TARGET_FLAGS_TO_PASS).
696 CHECK_TARGET_MODULES = \
697 check-target-libio \
698 check-target-libstdc++ \
699 check-target-libg++ \
700 check-target-newlib \
701 check-target-libf2c \
702 check-target-winsup \
703 check-target-libiberty \
704 check-target-gperf
706 # This is a list of the install targets for all of the modules which are
707 # compiled using $(TARGET_FLAGS_TO_PASS).
708 INSTALL_TARGET_MODULES = \
709 install-target-libio \
710 install-target-libstdc++ \
711 install-target-libg++ \
712 install-target-newlib \
713 install-target-libf2c \
714 install-target-winsup \
715 install-target-libgloss \
716 install-target-libiberty \
717 install-target-gperf
719 # This is a list of the targets for which we can do a clean-{target}.
720 CLEAN_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
778 # All of the target modules that can be cleaned
779 CLEAN_TARGET_MODULES = \
780 clean-target-libio \
781 clean-target-libstdc++ \
782 clean-target-librx \
783 clean-target-libg++ \
784 clean-target-newlib \
785 clean-target-libf2c \
786 clean-target-winsup \
787 clean-target-libgloss \
788 clean-target-libiberty \
789 clean-target-gperf \
790 clean-target-examples
792 # All of the x11 modules that can be cleaned
793 CLEAN_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
804 # The first rule in the file had better be this one. Don't put any above it.
805 all: all.normal
806 .PHONY: all
808 # The target built for a native build.
809 .PHONY: all.normal
810 all.normal: \
811 $(ALL_MODULES) \
812 $(ALL_X11_MODULES) \
813 $(ALL_TARGET_MODULES) \
814 all-gcc
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.
823 DO_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
883 # Here are the targets which correspond to the do-X targets.
885 .PHONY: info installcheck dvi install-info
886 .PHONY: clean distclean mostlyclean maintainer-clean realclean
887 .PHONY: local-clean local-distclean local-maintainer-clean
888 info: do-info
889 installcheck: do-installcheck
890 dvi: do-dvi
892 # Make sure makeinfo is built before we do a `make info'.
893 do-info: all-texinfo
895 install-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
901 local-clean:
902 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
904 local-distclean:
905 -rm -f Makefile config.status config.cache mh-frag mt-frag
906 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
907 rm -rf $(TARGET_SUBDIR); \
908 else true; fi
910 local-maintainer-clean:
911 @echo "This command is intended for maintainers to use;"
912 @echo "it deletes files that may require special tools to rebuild."
914 clean: do-clean local-clean
915 mostlyclean: do-mostlyclean local-clean
916 distclean: do-distclean local-clean local-distclean
917 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
918 maintainer-clean: local-distclean
919 realclean: maintainer-clean
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; \
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; \
947 clean-target: $(CLEAN_TARGET_MODULES)
949 # Check target.
951 .PHONY: check
952 check: $(CHECK_MODULES) \
953 $(CHECK_TARGET_MODULES) \
954 $(CHECK_X11_MODULES) \
955 check-gcc
957 # Installation targets.
959 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
960 install: $(INSTALL_TARGET)
961 install-cross: $(INSTALL_TARGET_CROSS)
963 uninstall:
964 @echo "the uninstall target is not supported in this tree"
966 source-vault:
967 $(MAKE) -f ./release/Build-A-Release \
968 host=$(host_alias) source-vault
970 binary-vault:
971 $(MAKE) -f ./release/Build-A-Release \
972 host=$(host_alias) target=$(target_alias)
974 vault-install:
975 @if [ -f ./release/vault-install ] ; then \
976 ./release/vault-install $(host_alias) $(target_alias) ; \
977 else \
978 true ; \
981 .PHONY: install.all
982 install.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 ; \
992 # inet-install is used because the I*Net wants DejaGNU installed but
993 # not built. Similarly, gzip is built but not installed.
994 inet-install:
995 $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
997 # install-no-fixedincludes is used because Cygnus can not distribute
998 # the fixed header files.
999 .PHONY: install-no-fixedincludes
1000 install-no-fixedincludes: \
1001 installdirs \
1002 $(INSTALL_MODULES) \
1003 $(INSTALL_TARGET_MODULES) \
1004 $(INSTALL_X11_MODULES) \
1005 gcc-no-fixedincludes
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
1011 gcc-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
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.
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; \
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.
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; \
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; \
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; \
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 \
1170 rm -f no-such-file; \
1171 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1172 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1173 --with-target-subdir="$(TARGET_SUBDIR)"; \
1174 else \
1175 rm -f no-such-file; \
1176 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1177 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1178 --with-target-subdir="$(TARGET_SUBDIR)"; \
1179 fi; \
1180 else \
1181 true; \
1182 fi; \
1183 else \
1184 true; \
1187 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1188 # To build a target all-X means to cd to X and make all.
1189 .PHONY: $(ALL_TARGET_MODULES)
1190 $(ALL_TARGET_MODULES):
1191 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1192 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1193 r=`pwd`; export r; \
1194 s=`cd $(srcdir); pwd`; export s; \
1195 $(SET_LIB_PATH) \
1196 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1197 else \
1198 true; \
1201 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1202 # To build a target install-X means to cd to X and make install.
1203 .PHONY: $(CHECK_TARGET_MODULES)
1204 $(CHECK_TARGET_MODULES):
1205 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1206 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1207 r=`pwd`; export r; \
1208 s=`cd $(srcdir); pwd`; export s; \
1209 $(SET_LIB_PATH) \
1210 (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1211 else \
1212 true; \
1215 # This rule is used to install the modules which use
1216 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1217 # and make install.
1218 .PHONY: $(INSTALL_TARGET_MODULES)
1219 $(INSTALL_TARGET_MODULES): installdirs
1220 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1221 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1222 r=`pwd`; export r; \
1223 s=`cd $(srcdir); pwd`; export s; \
1224 $(SET_LIB_PATH) \
1225 (cd $(TARGET_SUBDIR)/$${dir}; \
1226 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1227 else \
1228 true; \
1231 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1232 # To build a target all-X means to cd to X and make all.
1233 .PHONY: $(ALL_X11_MODULES)
1234 $(ALL_X11_MODULES):
1235 @dir=`echo $@ | sed -e 's/all-//'`; \
1236 if [ -f ./$${dir}/Makefile ] ; then \
1237 r=`pwd`; export r; \
1238 s=`cd $(srcdir); pwd`; export s; \
1239 $(SET_LIB_PATH) \
1240 (cd $${dir}; \
1241 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1242 else \
1243 true; \
1246 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1247 # To build a target check-X means to cd to X and make all.
1248 .PHONY: $(CHECK_X11_MODULES)
1249 $(CHECK_X11_MODULES):
1250 @dir=`echo $@ | sed -e 's/check-//'`; \
1251 if [ -f ./$${dir}/Makefile ] ; then \
1252 r=`pwd`; export r; \
1253 s=`cd $(srcdir); pwd`; export s; \
1254 $(SET_LIB_PATH) \
1255 (cd $${dir}; \
1256 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1257 else \
1258 true; \
1261 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1262 # To build a target install-X means to cd to X and make install.
1263 .PHONY: $(INSTALL_X11_MODULES)
1264 $(INSTALL_X11_MODULES): installdirs
1265 @dir=`echo $@ | sed -e 's/install-//'`; \
1266 if [ -f ./$${dir}/Makefile ] ; then \
1267 r=`pwd`; export r; \
1268 s=`cd $(srcdir); pwd`; export s; \
1269 $(SET_LIB_PATH) \
1270 (cd $${dir}; \
1271 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1272 else \
1273 true; \
1276 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1277 .PHONY: all-gcc
1278 all-gcc:
1279 @if [ -f ./gcc/Makefile ] ; then \
1280 r=`pwd`; export r; \
1281 s=`cd $(srcdir); pwd`; export s; \
1282 $(SET_LIB_PATH) \
1283 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1284 else \
1285 true; \
1288 # Building GCC uses some tools for rebuilding "source" files
1289 # like texinfo, bison/byacc, etc. So we must depend on those.
1291 # While building GCC, it may be necessary to run various target
1292 # programs like the assembler, linker, etc. So we depend on
1293 # those too.
1295 # In theory, on an SMP all those dependencies can be resolved
1296 # in parallel.
1298 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1299 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1300 @r=`pwd`; export r; \
1301 s=`cd $(srcdir); pwd`; export s; \
1302 $(SET_LIB_PATH) \
1303 echo "Bootstrapping the compiler"; \
1304 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1305 @r=`pwd`; export r; \
1306 s=`cd $(srcdir); pwd`; export s; \
1307 case "$@" in \
1308 *bootstrap4-lean ) \
1309 msg="Comparing stage3 and stage4 of the compiler"; \
1310 compare=compare3-lean ;; \
1311 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1312 compare=compare3 ;; \
1313 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1314 compare=compare-lean ;; \
1315 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1316 compare=compare ;; \
1317 esac; \
1318 $(SET_LIB_PATH) \
1319 echo "$$msg"; \
1320 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1321 @echo "Building runtime libraries"; \
1322 $(MAKE) all
1324 .PHONY: cross
1325 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1326 @r=`pwd`; export r; \
1327 s=`cd $(srcdir); pwd`; export s; \
1328 $(SET_LIB_PATH) \
1329 echo "Building the C and C++ compiler"; \
1330 cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1331 @echo "Building runtime libraries"; \
1332 $(MAKE) all LANGUAGES="c c++"
1334 .PHONY: check-gcc
1335 check-gcc:
1336 @if [ -f ./gcc/Makefile ] ; then \
1337 r=`pwd`; export r; \
1338 s=`cd $(srcdir); pwd`; export s; \
1339 $(SET_LIB_PATH) \
1340 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1341 else \
1342 true; \
1345 .PHONY: install-gcc
1346 install-gcc:
1347 @if [ -f ./gcc/Makefile ] ; then \
1348 r=`pwd`; export r; \
1349 s=`cd $(srcdir); pwd`; export s; \
1350 $(SET_LIB_PATH) \
1351 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1352 else \
1353 true; \
1356 .PHONY: install-gcc-cross
1357 install-gcc-cross:
1358 @if [ -f ./gcc/Makefile ] ; then \
1359 r=`pwd`; export r; \
1360 s=`cd $(srcdir); pwd`; export s; \
1361 $(SET_LIB_PATH) \
1362 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1363 else \
1364 true; \
1366 # EXPERIMENTAL STUFF
1367 # This rule is used to install the modules which use FLAGS_TO_PASS.
1368 # To build a target install-X means to cd to X and make install.
1369 .PHONY: install-dosrel
1370 install-dosrel: installdirs info
1371 @dir=`echo $@ | sed -e 's/install-//'`; \
1372 if [ -f ./$${dir}/Makefile ] ; then \
1373 r=`pwd`; export r; \
1374 s=`cd $(srcdir); pwd`; export s; \
1375 $(SET_LIB_PATH) \
1376 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1377 else \
1378 true; \
1381 install-dosrel-fake:
1384 # This is a list of inter-dependencies among modules.
1385 all-apache:
1386 all-autoconf: all-m4 all-texinfo
1387 all-automake:
1388 all-bash:
1389 all-bfd:
1390 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc
1391 all-bison: all-texinfo
1392 all-byacc:
1393 all-cvs:
1394 all-db:
1395 all-dejagnu: all-tcl all-expect all-tk
1396 all-diff: all-libiberty
1397 all-emacs:
1398 all-emacs19: all-bison all-byacc
1399 all-etc:
1400 configure-target-examples: $(ALL_GCC)
1401 all-target-examples: configure-target-examples
1402 all-expect: all-tcl all-tk
1403 all-fileutils: all-libiberty
1404 all-findutils:
1405 all-find:
1406 all-flex: all-libiberty all-bison all-byacc
1407 all-gas: all-libiberty all-opcodes all-bfd
1408 all-gash: all-tcl
1409 all-gawk:
1410 ALL_GCC = all-gcc
1411 all-gcc: all-bison all-byacc all-binutils all-gas all-ld
1412 GDB_TK = all-tk all-tcl all-itcl all-tix
1413 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1414 all-gnuserv:
1415 configure-target-gperf: $(ALL_GCC)
1416 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libg++
1417 all-gprof: all-libiberty all-bfd all-opcodes
1418 all-grep: all-libiberty
1419 all-grez: all-libiberty all-bfd all-opcodes
1420 all-gui: all-gdb all-libproc all-target-librx
1421 all-guile:
1422 all-gzip: all-libiberty
1423 all-hello: all-libiberty
1424 all-indent:
1425 all-inet: all-tcl all-send-pr all-perl
1426 all-ispell: all-emacs19
1427 all-itcl: all-tcl all-tk
1428 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex
1429 configure-target-libg++: $(ALL_GCC) configure-target-librx
1430 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++
1431 configure-target-libgloss: $(ALL_GCC)
1432 all-target-libgloss: configure-target-libgloss configure-target-newlib
1433 configure-target-libio: $(ALL_GCC)
1434 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1435 check-target-libio: all-target-libstdc++
1436 all-libiberty:
1437 configure-target-librx: $(ALL_GCC) configure-target-newlib
1438 all-target-librx: configure-target-librx
1439 configure-target-libstdc++: $(ALL_GCC)
1440 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1441 all-target-libf2c: configure-target-libf2c all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1442 all-m4: all-libiberty
1443 all-make: all-libiberty
1444 all-mmalloc:
1445 configure-target-newlib: $(ALL_GCC)
1446 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1447 all-opcodes: all-bfd all-libiberty
1448 all-patch: all-libiberty
1449 all-perl:
1450 all-prms: all-libiberty
1451 all-rcs:
1452 all-readline:
1453 all-recode: all-libiberty
1454 all-sed: all-libiberty
1455 all-send-pr: all-prms
1456 all-shellutils:
1457 all-sim: all-libiberty all-bfd all-opcodes
1458 all-sn: all-tcl all-tk all-itcl all-db all-grep
1459 all-tar: all-libiberty
1460 all-tcl:
1461 all-tclX: all-tcl all-tk
1462 all-tk: all-tcl
1463 all-texinfo: all-libiberty
1464 all-textutils:
1465 all-tgas: all-libiberty all-bfd all-opcodes
1466 all-time:
1467 all-tix: all-tcl all-tk
1468 all-wdiff:
1469 all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup
1470 configure-target-winsup: configure-target-newlib
1471 all-uudecode: all-libiberty
1472 configure-target-libiberty: $(ALL_GCC)
1473 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1474 all-target: $(ALL_TARGET_MODULES)
1475 install-target: $(INSTALL_TARGET_MODULES)
1477 ### other supporting targets
1479 MAKEDIRS= \
1480 $(prefix) \
1481 $(exec_prefix)
1482 .PHONY: installdirs
1483 installdirs: mkinstalldirs
1484 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1486 dir.info: do-install-info
1487 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1488 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1489 mv -f dir.info.new dir.info ; \
1490 else true ; \
1493 dist:
1494 @echo "Building a full distribution of this tree isn't done"
1495 @echo "via 'make dist'. Check out the etc/ subdirectory"
1497 etags tags: TAGS
1499 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1500 # ability to use several tags files at once, so there is probably no need
1501 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1502 # (if we felt like it) have this Makefile write a piece of elisp which
1503 # the user could load to tell emacs19 where all the TAGS files we just
1504 # built are.
1505 TAGS: do-TAGS
1507 # with the gnu make, this is done automatically.
1509 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1510 $(SHELL) ./config.status
1513 # Support for building net releases
1515 # Files in devo used in any net release.
1516 # ChangeLog omitted because it may refer to files which are not in this
1517 # distribution (perhaps it would be better to include it anyway).
1518 DEVO_SUPPORT= README Makefile.in configure configure.in \
1519 config.guess config.sub config move-if-change \
1520 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1521 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1522 mkinstalldirs ltconfig ltmain.sh missing ylwrap
1524 # Files in devo/etc used in any net release.
1525 # ChangeLog omitted because it may refer to files which are not in this
1526 # distribution (perhaps it would be better to include it anyway).
1527 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1528 make-stds.texi standards.info*
1530 # When you use `make setup-dirs' or `make taz' you should always redefine
1531 # this macro.
1532 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1534 .PHONY: taz
1536 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1537 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1538 # Take out texinfo from a few places; make simple BISON=bison line.
1539 sed -e '/^all\.normal: /s/\all-texinfo //' \
1540 -e '/^ install-texinfo /d' \
1541 <Makefile.in >tmp
1542 mv -f tmp Makefile.in
1544 ./configure sun4
1545 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1546 || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1547 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1548 # Make links, and run "make diststuff" or "make info" when needed.
1549 rm -rf proto-toplev ; mkdir proto-toplev
1550 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1551 for d in $$dirs ; do \
1552 if [ -d $$d ]; then \
1553 if [ ! -f $$d/Makefile ] ; then true ; \
1554 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1555 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1556 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1557 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1558 fi ; \
1559 if [ -d $$d/proto-$$d.dir ]; then \
1560 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1561 else \
1562 ln -s ../$$d proto-toplev/$$d ; \
1563 fi ; \
1564 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1565 done
1566 cd etc ; $(MAKE) info
1567 $(MAKE) distclean
1569 mkdir proto-toplev/etc
1570 (cd proto-toplev/etc; \
1571 for i in $(ETC_SUPPORT); do \
1572 ln -s ../../etc/$$i . ; \
1573 done)
1575 # Take out texinfo from configurable dirs
1576 rm proto-toplev/configure.in
1577 sed -e '/^host_tools=/s/texinfo //' \
1578 <configure.in >proto-toplev/configure.in
1580 mkdir proto-toplev/texinfo
1581 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1582 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1583 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1584 if test -r texinfo/util/tex3patch ; then \
1585 mkdir proto-toplev/texinfo/util && \
1586 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1587 else true; fi
1588 chmod og=u `find . -print`
1589 if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1590 ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
1591 else \
1592 ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1593 fi; \
1594 $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
1596 do-tar-gz:
1597 echo "==> Making $(TOOL)-$(VER).tar.gz"
1598 -rm -f $(TOOL)-$(VER)
1599 ln -s proto-toplev $(TOOL)-$(VER)
1600 tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1601 $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1603 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1604 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1606 .PHONY: gas.tar.gz
1607 GAS_SUPPORT_DIRS= bfd include libiberty opcodes setup.com makefile.vms
1608 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1609 $(MAKE) -f Makefile.in taz TOOL=gas \
1610 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1612 # The FSF "binutils" release includes gprof and ld.
1613 .PHONY: binutils.tar.gz
1614 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof setup.com makefile.vms
1615 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1616 $(MAKE) -f Makefile.in taz TOOL=binutils \
1617 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1619 .PHONY: gas+binutils.tar.gz
1620 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1621 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1622 $(MAKE) -f Makefile.in taz TOOL=gas \
1623 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1625 .PHONY: libg++.tar.gz
1626 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1627 libg++.tar.gz: $(DIST_SUPPORT) libg++
1628 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1629 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1631 GNATS_SUPPORT_DIRS=include libiberty send-pr
1632 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1633 $(MAKE) -f Makefile.in taz TOOL=gnats \
1634 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1636 .PHONY: gdb.tar.gz
1637 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1638 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1639 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1640 $(MAKE) -f Makefile.in taz TOOL=gdb \
1641 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1643 .PHONY: newlib.tar.gz
1644 NEWLIB_SUPPORT_DIRS=libgloss
1645 # taz configures for the sun4 target which won't configure newlib.
1646 # We need newlib configured so that the .info files are made.
1647 # Unfortunately, it is not enough to just configure newlib separately:
1648 # taz will build the .info files but since SUBDIRS won't contain newlib,
1649 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1650 # used in building the .info files, eg: *.def, *.ref).
1651 # The problem isn't solvable however without a lot of extra work because
1652 # target libraries are built in subdir $(target_alias) which gets nuked during
1653 # the make distclean. For now punt on the issue of shipping newlib info files
1654 # with newlib net releases and wait for a day when some native target (sun4?)
1655 # supports newlib (if only minimally).
1656 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1657 $(MAKE) -f Makefile.in taz TOOL=newlib \
1658 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1659 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1661 .NOEXPORT:
1662 MAKEOVERRIDES=
1665 # end of Makefile.in