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