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