(install-common): Fix typo in installation of cpp.
[gcc.git] / gcc / Makefile.in
1 # Makefile for GNU C compiler.
2 # Copyright (C) 1987, 88, 90-94, 1995 Free Software Foundation, Inc.
3
4 #This file is part of GNU CC.
5
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
10
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING. If not, write to
18 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # The targets for external use include:
21 # all, doc, proto, install, install-cross, install-cross-rest,
22 # uninstall, TAGS, mostlyclean, clean, distclean, realclean,
23 # stage1, stage2, stage3, stage4.
24
25 # Suppress smart makes who think they know how to automake Yacc files
26 .y.c:
27
28 # Variables that exist for you to override.
29 # See below for how to change them for certain systems.
30
31 # List of language subdirectories.
32 # This is overridden by configure.
33 SUBDIRS =
34
35 # Selection of languages to be made.
36 # This is overridden by configure.
37 LANGUAGES = c objective-c proto
38
39 ALLOCA =
40 ALLOCA_FLAGS =
41 ALLOCA_FINISH = true
42
43 # Various ways of specifying flags for compilations:
44 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
45 # BOOT_CFLAGS is the value of CFLAGS to pass
46 # to the stage2 and stage3 compilations
47 # XCFLAGS is used for most compilations but not when using the GCC just built.
48 XCFLAGS =
49 CFLAGS = -g
50 BOOT_CFLAGS = -O $(CFLAGS)
51 # These exists to be overridden by the x-* and t-* files, respectively.
52 X_CFLAGS =
53 T_CFLAGS =
54
55 X_CPPFLAGS =
56 T_CPPFLAGS =
57
58 CC = cc
59 BISON = bison
60 BISONFLAGS =
61 LEX = flex
62 LEXFLAGS =
63 AR = ar
64 OLDAR_FLAGS = qc
65 AR_FLAGS = rc
66 SHELL = /bin/sh
67 # on sysV, define this as cp.
68 INSTALL = install -c
69 # These permit overriding just for certain files.
70 INSTALL_PROGRAM = $(INSTALL)
71 INSTALL_DATA = $(INSTALL)
72 SYMLINK = ln -s
73 MAKEINFO = makeinfo
74 TEXI2DVI = texi2dvi
75 # For GNUmake: let us decide what gets passed to recursive makes.
76 MAKEOVERRIDES =
77
78 # Define this as & to perform parallel make on a Sequent.
79 # Note that this has some bugs, and it seems currently necessary
80 # to compile all the gen* files first by hand to avoid erroneous results.
81 P =
82
83 # How to invoke ranlib.
84 RANLIB = ranlib
85 # Test to use to see whether ranlib exists on the system.
86 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
87
88 # Compiler to use for compiling libgcc1.a.
89 # OLDCC should not be the GNU C compiler,
90 # since that would compile typical libgcc1.a functions such as mulsi3
91 # into infinite recursions.
92 OLDCC = cc
93
94 # CFLAGS for use with OLDCC, for compiling libgcc1.a.
95 # NOTE: -O does not work on some Unix systems!
96 CCLIBFLAGS = -O
97
98 # Version of ar to use when compiling libgcc1.a.
99 OLDAR = ar
100
101 # Target to use when installing include directory. Either
102 # install-headers-tar or install-headers-cpio.
103 INSTALL_HEADERS_DIR = install-headers-tar
104
105 # The GCC to use for compiling libgcc2.a, enquire, and cross-test.
106 # Usually the one we just built.
107 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
108 GCC_FOR_TARGET = ./xgcc -B./
109
110 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
111 # It omits XCFLAGS, and specifies -B./.
112 # It also specifies -I./include to find, e.g., stddef.h.
113 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include
114
115 # Special flags for compiling enquire.
116 # We disable optimization to make floating point more reliable.
117 ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
118 ENQUIRE_LDFLAGS = $(LDFLAGS)
119
120 # Sed command to transform gcc to installed name. Overwritten by configure.
121 program_transform_name = -e s,x,x,
122 program_transform_cross_name = -e s,^,$(target)-,
123
124 # Tools to use when building a cross-compiler.
125 # These are used because `configure' appends `cross-make'
126 # to the makefile when making a cross-compiler.
127
128 TARGET_TOOLPREFIX = $(tooldir)/bin/
129 AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
130 AR_FOR_TARGET_FLAGS = rc
131 RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
132 RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
133
134 # Dir to search for system headers. Overridden by cross-make.
135 SYSTEM_HEADER_DIR = /usr/include
136
137 # Control whether to run fixproto.
138 STMP_FIXPROTO = stmp-fixproto
139
140 # Test to see whether <limits.h> exists in the system header files.
141 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
142
143 # There may be a premade insn-attrtab.c for this machine.
144 # (You could rebuild it with genattrtab as usual, but it takes a long time.)
145 # PREMADE_ATTRTAB is the file name of the file to use.
146 # PREMADE_ATTRTAB_MD is the md file it corresponds to.
147 PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md.
148 PREMADE_ATTRTAB =
149
150 target= ... `configure' substitutes actual target name here.
151 xmake_file= ... `configure' substitutes actual x- file name here.
152 tmake_file= ... `configure' substitutes actual t- file name here.
153 version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
154 mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
155
156 # Directory where sources are, from where we are.
157 srcdir = .
158 # Common prefix for installation directories.
159 # NOTE: This directory must exist when you start installation.
160 prefix = /usr/local
161 # Directory in which to put localized header files. On the systems with
162 # gcc as the native cc, `local_prefix' may not be `prefix' which is
163 # `/usr'.
164 # NOTE: local_prefix *should not* default from prefix.
165 local_prefix = /usr/local
166 # Directory in which to put host dependent programs and libraries
167 exec_prefix = $(prefix)
168 # Directory in which to put the executable for the command `gcc'
169 bindir = $(exec_prefix)/bin
170 # Directory in which to put the directories used by the compiler.
171 libdir = $(exec_prefix)/lib
172 # Directory in which the compiler finds executables, libraries, etc.
173 libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
174 # Directory in which the compiler finds g++ includes.
175 gxx_include_dir= $(libdir)/g++-include
176 # Directory to search for site-specific includes.
177 includedir = $(local_prefix)/include
178 # assertdir is overridden in cross-make.
179 # (But this currently agrees with what is in cross-make.)
180 assertdir = $(tooldir)/include
181 # where the info files go
182 infodir = $(prefix)/info
183 # Extension (if any) to put in installed man-page filename.
184 manext = .1
185 exeext =
186 objext = .o
187 oldobjext = .o
188
189 # Directory in which to put man pages.
190 mandir = $(prefix)/man/man1
191 # Directory in which to find other cross-compilation tools and headers.
192 # Used in install-cross.
193 tooldir = $(exec_prefix)/$(target)
194 # Dir for temp files.
195 tmpdir = /tmp
196
197 # Additional system libraries to link with.
198 CLIB=
199
200 # Change this to a null string if obstacks are installed in the
201 # system library.
202 OBSTACK=obstack.o
203
204 # Specify the rule for actually making libgcc.a,
205 LIBGCC = libgcc.a
206 # and the rule for installing it.
207 INSTALL_LIBGCC = install-libgcc
208
209 # Specify the rule for actually making libgcc1.a.
210 # The value may be empty; that means to do absolutely nothing
211 # with or for libgcc1.a.
212 LIBGCC1 = libgcc1.a
213
214 # Specify the rule for making libgcc1.a for a cross-compiler.
215 # The default rule assumes that libgcc1.a is supplied by the user.
216 CROSS_LIBGCC1 = libgcc1.cross
217
218 # Specify the rule for actually making libgcc2.a.
219 LIBGCC2 = libgcc2.a
220
221 # Options to use when compiling libgcc2.a.
222 # -g1 causes output of debug info only for file-scope entities.
223 # we use this here because that should be enough, and also
224 # so that -g1 will be tested.
225 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -g1
226
227 # Additional options to use when compiling libgcc2.a.
228 # Some targets override this to -Iinclude
229 LIBGCC2_INCLUDES =
230
231 # Things which must be built before building libgcc2.a.
232 # Some targets override this to stmp-int-hdrs
233 LIBGCC2_DEPS =
234
235 # Enquire target (This is a variable so that a target can choose not to
236 # build it.)
237 ENQUIRE = enquire
238
239 # Cross-test target (must also be overridable for a target)
240 CROSS_TEST = cross-test
241
242 # List of extra executables that should be compiled for this target machine
243 # that are used for compiling from source code to object code.
244 # The rules for compiling them should be in the t-* file for the machine.
245 EXTRA_PASSES =
246
247 # Like EXTRA_PASSES, but these are used when linking.
248 EXTRA_PROGRAMS =
249
250 # List of extra object files that should be compiled for this target machine.
251 # The rules for compiling them should be in the t-* file for the machine.
252 EXTRA_PARTS =
253
254 # List of extra object files that should be compiled and linked with
255 # compiler proper (cc1, cc1obj, cc1plus).
256 EXTRA_OBJS =
257
258 # List of additional header files to install.
259 # Often this is edited directly by `configure'.
260 EXTRA_HEADERS =
261
262 # Set this to `ld' to enable use of collect2.
263 # USE_COLLECT2 =
264 # It is convenient for configure to add the assignment at the beginning,
265 # so don't override it here.
266
267 # List of extra C and assembler files to add to libgcc1.a.
268 # Assembler files should have names ending in `.asm'.
269 LIB1FUNCS_EXTRA =
270
271 # List of extra C and assembler files to add to libgcc2.a.
272 # Assembler files should have names ending in `.asm'.
273 LIB2FUNCS_EXTRA =
274
275 # Default float.h source to use for cross-compiler.
276 CROSS_FLOAT_H=float.h-cross
277
278 # Program to convert libraries.
279 LIBCONVERT =
280
281 # Control whether header files are installed.
282 INSTALL_HEADERS=install-headers
283
284 # Options for tar when copying trees. So HPUX can override it.
285 TAROUTOPTS = xpBf
286
287 # Select which version of fixincludes to use (I.E. regular versus SVR4)
288 # This value is overridden directly by configure.
289 FIXINCLUDES=fixincludes
290
291 # Additional directories of header files to run fixincludes on.
292 # These should be directories searched automatically by default
293 # just as /usr/include is.
294 # *Do not* use this for directories that happen to contain
295 # header files, but are not searched automatically by default.
296 # On most systems, this is empty.
297 OTHER_FIXINCLUDES_DIRS=
298
299 # List of things which should already be built whenever we try to use xgcc
300 # to compile anything (without linking).
301 GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)
302
303 # List of things which should already be built whenever we try to use xgcc
304 # to link anything.
305 GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
306
307 # Directory to link to, when using the target `maketest'.
308 DIR = ../gcc
309
310 # Guaranteed to not exist when not passing md through cpp.
311 # This value is overridden directly by configure.
312 MD_FILE = md-cpp-not-used
313
314 # Flags to use when cross-building GCC.
315 # Prefix to apply to names of object files when using them
316 # to run on the machine we are compiling on.
317 HOST_PREFIX=
318 # Prefix to apply to names of object files when compiling them
319 # to run on the machine we are compiling on.
320 # The default for this variable is chosen to keep these rules
321 # out of the way of the other rules for compiling the same source files.
322 HOST_PREFIX_1=loser-
323 HOST_CC=$(CC)
324 HOST_CFLAGS=$(ALL_CFLAGS)
325 HOST_CLIB=$(CLIB)
326 HOST_LDFLAGS=$(LDFLAGS)
327 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
328 HOST_ALLOCA=$(ALLOCA)
329 HOST_MALLOC=$(MALLOC)
330 HOST_OBSTACK=$(OBSTACK)
331
332 # Actual name to use when installing a native compiler.
333 GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed $$t`
334
335 # Actual name to use when installing a cross-compiler.
336 GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed $$t`
337
338 # Choose the real default target.
339 ALL=all.internal
340
341 # Choose the real install target.
342 INSTALL_TARGET=install-normal
343
344 # Source for float.h. Overridden by cross-make.
345 FLOAT_H=float.h-nat
346
347 # Extra symbols for fixproto to define when parsing headers.
348 FIXPROTO_DEFINES =
349
350 # Extra flags to use when compiling crt{begin,end}.o.
351 CRTSTUFF_T_CFLAGS =
352
353 # End of variables for you to override.
354
355 # Definition of `all' is here so that new rules inserted by sed
356 # do not specify the default target.
357 # The real definition is under `all.internal' (for native compilers)
358 # or `all.cross' (for cross compilers).
359 all: all.indirect
360
361 # This tells GNU Make version 3 not to put all variables in the environment.
362 .NOEXPORT:
363
364 # sed inserts variable overrides after the following line.
365 ####target overrides
366 ####host overrides
367 ####cross overrides
368 ####build overrides
369 \f
370 # Now figure out from those variables how to compile and link.
371
372 all.indirect: $(ALL)
373
374 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
375 # ??? IN_GCC should be obsolete now.
376 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
377
378 # This is the variable actually used when we compile.
379 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
380
381 # Likewise.
382 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
383
384 # Even if ALLOCA is set, don't use it if compiling with GCC.
385 USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo "${ALLOCA}" ;; esac `
386 USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
387 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
388 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
389
390 # Dependency on obstack, alloca, malloc or whatever library facilities
391 # are not installed in the system libraries.
392 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
393 LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
394
395 # Likewise, for use in the tools that must run on this machine
396 # even if we are cross-building GCC.
397 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
398 HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
399
400 # How to link with both our special library facilities
401 # and the system's installed libraries.
402 LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
403
404 # Likewise, for use in the tools that must run on this machine
405 # even if we are cross-building GCC.
406 HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
407 $(HOST_CLIB)
408
409 HOST_RTL = $(HOST_PREFIX)rtl.o
410 HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
411 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
412
413 # Specify the directories to be searched for header files.
414 # Both . and srcdir are used, in that order,
415 # so that tm.h and config.h will be found in the compilation
416 # subdirectory rather than in the source directory.
417 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
418
419 # Always use -I$(srcdir)/config when compiling.
420 .c.o:
421 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
422
423 # This tells GNU make version 3 not to export all the variables
424 # defined in this file into the environment.
425 .NOEXPORT:
426 \f
427 # Support for additional languages (other than c and objc).
428 # ??? objc can be supported this way too (leave for later).
429
430 # These next lines are overridden by configure.
431 LANG_MAKEFILES =
432 LANG_STAGESTUFF =
433 LANG_DIFF_EXCLUDES =
434
435 # Flags to pass to recursive makes.
436 # CC is set by configure. Hosts without symlinks need special handling
437 # because we need CC="stage1/xgcc -Bstage1/" to work in the language
438 # subdirectories.
439 # ??? The choices here will need some experimenting with.
440 FLAGS_TO_PASS = \
441 "AR_FLAGS=$(AR_FLAGS)" \
442 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
443 "BISON=$(BISON)" \
444 "BISONFLAGS=$(BISONFLAGS)" \
445 "CC=set-by-configure" \
446 "CFLAGS=$(CFLAGS)" \
447 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
448 "LDFLAGS=$(LDFLAGS)" \
449 "LEX=$(LEX)" \
450 "LEXFLAGS=$(LEXFLAGS)" \
451 "MAKEINFO=$(MAKEINFO)" \
452 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
453 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
454 "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
455 "SHELL=$(SHELL)" \
456 "exec_prefix=$(exec_prefix)" \
457 "prefix=$(prefix)" \
458 "tooldir=$(tooldir)" \
459 "bindir=$(bindir)" \
460 "libsubdir=$(libsubdir)"
461 \f
462 # Lists of files for various purposes.
463
464 # A list of all the language-specific executables.
465 # This is overridden by configure.
466 COMPILERS = cc1$(exeext) cc1obj$(exeext)
467
468 # Language-specific object files for C.
469 C_OBJS = c-parse.o c-lang.o c-lex.o c-pragma.o \
470 c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
471
472 # Language-specific object files for Objective C.
473 OBJC_OBJS = objc-parse.o objc-act.o c-lex.o c-pragma.o \
474 c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
475
476 # Files specific to the C interpreter bytecode compiler(s).
477 BC_OBJS = bc-emit.o bc-optab.o
478
479 # Language-independent object files.
480 OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
481 function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
482 rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
483 dbxout.o sdbout.o dwarfout.o xcoffout.o \
484 integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
485 regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
486 insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
487 insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
488 insn-attrtab.o aux-output.o getpwd.o convert.o $(EXTRA_OBJS)
489
490 # GEN files are listed separately, so they can be built before doing parallel
491 # makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
492 # them before rtl.o is compiled.
493 GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
494
495 # Files to be copied away after each stage in building.
496 STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
497 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
498 insn-attr.h insn-attrtab.c insn-opinit.c \
499 stamp-flags stamp-config stamp-codes \
500 stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
501 stamp-attr stamp-attrtab stamp-opinit stamp-proto \
502 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
503 genattrtab genattr genopinit \
504 bc-arity.h bc-opcode.h bc-opname.h \
505 stamp-bcarity stamp-bcopcode stamp-bcopname \
506 bi-arity bi-opcode bi-opname \
507 $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
508 cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2) \
509 $(LANG_STAGESTUFF)
510
511 # Members of libgcc1.a.
512 LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
513 _lshrsi3 _ashrsi3 _ashlsi3 \
514 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
515 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
516 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
517 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
518 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
519
520 # Library members defined in libgcc2.c.
521 LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
522 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
523 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
524 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
525 _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
526 _fixtfdi _fixunstfdi _floatditf \
527 __gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler _op_delete \
528 _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh \
529 _pure
530
531 # Header files that are made available under the same name
532 # to programs compiled with GCC.
533 USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
534 $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \
535 $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \
536 $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \
537 $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-pa.h \
538 $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \
539 $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \
540 $(srcdir)/ginclude/iso646.h \
541 $(srcdir)/ginclude/proto.h $(EXTRA_HEADERS)
542
543 # The files that "belong" in CONFIG_H are deliberately omitted
544 # because having them there would not be useful in actual practice.
545 # All they would do is cause complete recompilation every time
546 # one of the machine description files is edited.
547 # That may or may not be what one wants to do.
548 # If it is, rm *.o is an easy way to do it.
549 # CONFIG_H = config.h tm.h
550 CONFIG_H =
551 RTL_H = rtl.h rtl.def machmode.h machmode.def
552 TREE_H = tree.h real.h tree.def machmode.h machmode.def
553 BYTECODE_H = bytecode.h bc-emit.h bc-optab.h
554 \f
555 # Language makefile fragments.
556
557 # The following targets define the interface between us and the languages.
558 #
559 # all.build, all.cross, start.encap, rest.encap,
560 # info, dvi,
561 # install-normal, install-common, install-info, install-man,
562 # uninstall, distdir,
563 # mostlyclean, clean, distclean, extraclean, realclean,
564 # stage1, stage2, stage3, stage4
565 #
566 # Each language is linked in with a series of hooks (since we can't use `::'
567 # targets). The name of each hooked is "lang.${target_name}" (eg: lang.info).
568 # Configure computes and adds these here.
569
570 ####language hooks
571
572 # sed inserts language fragments after the following line.
573 ####language fragments
574
575 # End of language makefile fragments.
576 \f
577 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
578 .SUFFIXES: .in .def
579
580 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
581 $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) \
582 $(LANG_MAKEFILES)
583 cp config.status config.run
584 $(SHELL) config.run
585 rm -f config.run
586
587 all.internal: start.encap rest.encap
588 # This is what to compile if making a cross-compiler.
589 # Note that we can compile enquire using the cross-compiler just built,
590 # although we can't run it on this machine.
591 all.cross: native gcc-cross specs stmp-headers $(LIBGCC) $(STMP_FIXPROTO) \
592 $(CROSS_TEST) $(ENQUIRE) $(EXTRA_PARTS) lang.all.cross
593 # This is what to compile if making gcc with a cross-compiler.
594 all.build: native xgcc $(EXTRA_PARTS) lang.all.build
595 # This is what must be made before installing GCC and converting libraries.
596 start.encap: native xgcc specs $(LIBGCC1) xlimits.h lang.start.encap
597 # These can't be made until after GCC can run.
598 rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap
599 # This is what is made with the host's compiler
600 # whether making a cross compiler or not.
601 native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
602
603 # Define the names for selecting languages in LANGUAGES.
604 C c: cc1
605 OBJC objc: cc1obj objc-runtime
606 OBJECTIVE-C objective-c: cc1obj objc-runtime
607 PROTO: proto
608
609 # Tell GNU make these are phony targets.
610 .PHONY: C c OBJC objc OBJECTIVE-C objective-c PROTO proto
611
612 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
613 # a target to build even if it is up-to-date. So we must verify that
614 # config.status does not exist before failing.
615 config.status:
616 @if [ ! -f config.status ] ; then \
617 echo You must configure gcc. Look at the INSTALL file for details.; \
618 false; \
619 else \
620 true; \
621 fi
622
623 # On the target machine, finish building a cross compiler.
624 # This does the things that can't be done on the host machine.
625 rest.cross: $(LIBGCC) gfloat.h specs
626
627 # Verify that it works to compile and link cross-test.
628 # If it does, then there are sufficient replacements for libgcc1.a.
629 cross-test: cross-test.o native gcc-cross $(LIBGCC) $(GCC_PARTS)
630 $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o cross-test
631 cross-test.o: cross-test.c native gcc-cross
632 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
633
634 # Recompile all the language-independent object files.
635 # This is used only if the user explicitly asks for it.
636 compilations: ${OBJS}
637
638 # Create a list of the language-independent object files so the language
639 # subdirectories needn't mention their names explicitly.
640 stamp-objlist: Makefile $(OBJS) $(BC_OBJS)
641 echo " $(OBJS) $(BC_OBJS)" | sed -e 's, \([a-z]\), ../\1,g' >stamp-objlist
642
643 # We call this executable `xgcc' rather than `gcc'
644 # to avoid confusion if the current directory is in the path
645 # and CC is `gcc'. It is renamed to `gcc' when it is installed.
646 xgcc: gcc.o version.o $(LIBDEPS)
647 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgcc gcc.o version.o $(LIBS)
648
649 # Dump a specs file to make -B./ read these specs over installed ones.
650 specs: xgcc
651 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
652 mv tmp-specs specs
653
654 # We do want to create an executable named `xgcc', so we can use it to
655 # compile libgcc2.a.
656 # Also create gcc-cross, so that install-common will install properly.
657 gcc-cross: xgcc
658 cp xgcc gcc-cross
659
660 cc1: $(P) $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
661 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBS)
662
663 cc1obj: $(P) $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
664 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBS)
665
666 # Copy float.h from its source.
667 gfloat.h: $(FLOAT_H)
668 cp $(FLOAT_H) gfloat.h
669
670 # Create float.h source for the native machine.
671 float.h-nat: enquire
672 -./enquire -f > tmp-float.h
673 mv tmp-float.h float.h-nat
674
675 # Create a dummy float.h source for a cross-compiler.
676 float.h-cross:
677 echo "#error float.h values not known for cross-compiler" > t-float.h-cross
678 mv t-float.h-cross float.h-cross
679
680 # Used to compile enquire with standard cc, but have forgotten why.
681 # Let's try with GCC.
682 enquire: enquire.o $(GCC_PARTS)
683 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o enquire
684 enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
685 # -if [ "$(srcdir)" != "." ]; then rm -f ./enquire.c; else true; fi
686 # -cp $(srcdir)/enquire.c . > /dev/null 2>&1
687 # Breaking this line caused a problem with one version of GNU make.
688 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
689
690 # Build the version of limits.h that we will install.
691 xlimits.h: glimits.h limitx.h limity.h
692 if $(LIMITS_H_TEST) ; then \
693 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
694 else \
695 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
696 fi
697 mv tmp-xlimits.h xlimits.h
698 \f
699 # Build libgcc.a.
700 # This is done in two parts because some functions, in libgcc1.c,
701 # must be compiled with something other than GCC,
702 # while the rest, in libgcc2.c, must be compiled with xgcc.
703 # That means we can't do libgcc2.c until after xgcc, cc1, etc.
704
705 # Use this as value of LIBGCC1 to cause conversion to GNU library format.
706 # LIBCONVERT should put its output in libgcc1.conv.
707 libgcc1.conv: libgcc1.a
708 $(LIBCONVERT) libgcc1.a libgcc1.conv
709
710 # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
711 # Make an empty file instead.
712 libgcc1.null: $(GCC_PASSES)
713 echo "__foo () {}" > dummy.c
714 $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
715 $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
716 rm -f dummy.o dummy.c
717
718 # This is $(LIBGCC1) for a cross-compiler.
719 # We have no automatic way of building libgcc1.a,
720 # so it's up to the installer to find a way to do that.
721 # This rule deliberately does not depend on libgcc1.a
722 # so that it will fail if the installer hasn't provided it.
723 libgcc1.cross:
724 mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
725
726 # Compile the library of arithmetic subroutines with the native compiler.
727 # Don't compile it with GCC!
728 # (That would cause most arithmetic functions to call themselves.)
729 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
730 -rm -f tmplibgcc1.a
731 # Actually build it in tmplibgcc1.a, then rename at end,
732 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
733 # -e causes any failing command to make this rule fail.
734 # -e doesn't work in certain shells, so we test $$? as well.
735 # lynx has a broken ar, it always complains when the initial library is
736 # empty, thus this command works only if we don't do -e
737 # There is a trailing backslash (\) deleted from the following line.
738 # set -e;
739 for name in $(LIB1FUNCS); \
740 do \
741 echo $${name}; \
742 rm -f $${name}.o; \
743 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
744 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
745 mv libgcc1$(oldobjext) $${name}.o; \
746 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
747 rm -f $${name}.o; \
748 done
749 # Some shells crash when a loop has no items.
750 # So make sure there is always at least one--`..'.
751 # Then ignore it.
752 # We don't use -e here because there are if statements
753 # that should not make the command give up when the if condition is false.
754 # Instead, we test for failure after each command where it matters.
755 for file in .. $(LIB1FUNCS_EXTRA); \
756 do \
757 if [ x$${file} != x.. ]; then \
758 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
759 echo $${name}; \
760 if [ $${name}.asm = $${file} ]; then \
761 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
762 else true; fi; \
763 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
764 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
765 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
766 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
767 rm -f $${name}.[so]; \
768 else true; \
769 fi; \
770 done
771 $(RANLIB) tmplibgcc1.a
772 mv tmplibgcc1.a libgcc1.a
773
774 # Build libgcc1.a from assembler source. LIB1ASMFUNCS is the list of
775 # functions. LIB1ASMSRC is the name of the source file in the config
776 # subdirectory.
777 libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC)
778 -rm -f tmplibgcc1.a libgcc1.S
779 cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S
780 # Actually build it in tmplibgcc1.a, then rename at end,
781 # so that libgcc1-asm.a itself remains nonexistent if compilation is aborted.
782 # -e causes any failing command to make this rule fail.
783 # -e doesn't work in certain shells, so we test $$? as well.
784 # lynx has a broken ar, it always complains when the initial library is
785 # empty, thus this command works only if we don't do -e
786 # There is a trailing backslash (\) deleted from the following line.
787 # set -e;
788 for name in $(LIB1ASMFUNCS); \
789 do \
790 echo $${name}; \
791 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \
792 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
793 mv libgcc1.o $${name}.o; \
794 $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}.o; \
795 rm -f $${name}.o; \
796 done
797 -rm -f libgcc1.S
798 mv tmplibgcc1.a libgcc1-asm.a
799
800 # Generate assembly versions of the functions required for libgcc1.
801 # You'll still need to massage the code by hand (possibly hacking
802 # underscores and local labels) but this will get you started.
803 libgcc1.S: libgcc1.c $(CONFIG_H) config.status
804 -rm -f libgcc1.S
805 touch libgcc1.S
806 for name in $(LIB1FUNCS); \
807 do \
808 echo $${name}; \
809 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -S -DL$${name} $(srcdir)/libgcc1.c; \
810 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
811 echo '#ifdef ' L$${name} >> libgcc1.S; \
812 cat libgcc1.s >> libgcc1.S; \
813 echo '#endif /*' L$${name} '*/' >> libgcc1.S; \
814 echo "" >> libgcc1.S; \
815 done
816
817 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
818 # But recompiling cc1 should not force recompilation of libgcc2.a.
819 # If you want to force recompilation, delete libgcc2.a.
820 libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs
821 -if [ -f libgcc2.ready ] ; then \
822 true; \
823 else \
824 touch libgcc2.ready; \
825 fi
826
827 libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
828 machmode.h longlong.h gbl-ctors.h config.status
829 # Actually build it in tmplibgcc2.a, then rename at end,
830 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
831 -rm -f tmplibgcc2.a
832 # -e causes any failing command to make this rule fail.
833 # -e doesn't work in certain shells, so we test $$? as well.
834 # lynx has a broken ar, it always complains when the initial library is
835 # empty, thus this command works only if we don't do -e
836 # There is a trailing backslash (\) deleted from the following line.
837 # set -e;
838 for name in $(LIB2FUNCS); \
839 do \
840 echo $${name}; \
841 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
842 $(srcdir)/libgcc2.c -o $${name}.o; \
843 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
844 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
845 rm -f $${name}.o; \
846 done
847 # Some shells crash when a loop has no items.
848 # So make sure there is always at least one--`..'.
849 # Then ignore it.
850 # We don't use -e here because there are if statements
851 # that should not make the command give up when the if condition is false.
852 # Instead, we test for failure after each command where it matters.
853 for file in .. $(LIB2FUNCS_EXTRA); \
854 do \
855 if [ x$${file} != x.. ]; then \
856 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
857 echo $${name}; \
858 if [ $${name}.asm = $${file} ]; then \
859 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
860 else true; fi; \
861 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
862 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
863 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
864 rm -f $${name}.[so]; \
865 else true; \
866 fi; \
867 done
868 mv tmplibgcc2.a libgcc2.a
869 # These lines were deleted from above the mv command
870 # because ranlibing libgcc.a itself should suffice.
871 # -if [ x${HPUX_GAS} = x ] ; then \
872 # if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi; \
873 # else true; fi
874
875 # Combine the various libraries into a single library, libgcc.a.
876 libgcc.a: $(LIBGCC1) $(LIBGCC2)
877 -rm -rf tmplibgcc.a libgcc.a tmpcopy
878 mkdir tmpcopy
879 -if [ x$(LIBGCC1) != x ]; \
880 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
881 else true; \
882 fi
883 # Some versions of ar (specifically the one in RISC/os 5.x), create an
884 # unwritable table of contents file, and then print an error message when
885 # the second ar command tries to overwrite this file. To avoid the error
886 # message from ar, we make sure all files are writable.
887 -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
888 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
889 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
890 rm -rf tmpcopy
891 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
892 # Actually build it in tmplibgcc.a, then rename at end,
893 # so that libgcc.a itself remains nonexistent if compilation is aborted.
894 mv tmplibgcc.a libgcc.a
895
896 # Use the genmultilib shell script to generate the information the gcc
897 # driver program needs to select the library directory based on the
898 # switches.
899 multilib.h: $(srcdir)/genmultilib config.status
900 $(SHELL) $(srcdir)/genmultilib "$(MULTILIB_OPTIONS)" \
901 "$(MULTILIB_DIRNAMES)" "$(MULTILIB_MATCHES)" > multilib.h
902
903 # Build multiple copies of libgcc.a, one for each target switch.
904 stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
905 $(LIB2FUNCS_EXTRA) machmode.h longlong.h gbl-ctors.h config.status
906 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
907 dir=`echo $$i | sed -e 's/;.*$$//'`; \
908 flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
909 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
910 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
911 RANLIB="$(RANLIB)" RANLIB_TEST="$(RANLIB_TEST)" \
912 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
913 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
914 LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \
915 dir="$${dir}" stmp-multilib-sub; \
916 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
917 done
918 touch stmp-multilib
919
920 # Subroutine of stmp-multilib so make -n works.
921 stmp-multilib-sub:
922 rm -f $(dir)/libgcc.a $(LIBGCC2)
923 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
924 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
925 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
926 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC2)
927 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
928 then true; \
929 else rm -f $(LIBGCC1); \
930 fi
931 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
932 then true; \
933 else \
934 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
935 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
936 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
937 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC1); \
938 fi
939 rm -rf tmplibgcc.a tmpcopy
940 mkdir tmpcopy
941 if [ x$(LIBGCC1) != x ]; \
942 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
943 else true; \
944 fi
945 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
946 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
947 rm -rf libgcc2.a tmpcopy
948 if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
949 if [ -d $(dir) ]; then true; else mkdir $(dir); fi
950 mv tmplibgcc.a $(dir)/libgcc.a
951
952 objc-runtime: libobjc.a
953
954 # Build the Objective C runtime library.
955 libobjc.a: cc1obj stmp-int-hdrs libgcc2.ready $(USE_COLLECT2) $(EXTRA_PARTS)
956 if [ -d objc ]; then true; else mkdir objc; fi
957 thisdir1=`pwd`; \
958 srcdir1=`cd $(srcdir); pwd`; \
959 cd objc; \
960 $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
961 srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
962 GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
963 GCC_CFLAGS="$(GCC_CFLAGS)"
964 -rm -f libobjc.a
965 ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
966 -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
967
968 # This is used by objc/Makefile if the user runs that directly.
969 sublibobjc.a: cc1obj stmp-int-hdrs libgcc2.ready
970 thisdir1=`pwd`; \
971 srcdir1=`cd $(srcdir); pwd`; \
972 cd objc; \
973 $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
974 srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
975 GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
976 GCC_CFLAGS="$(GCC_CFLAGS)"
977
978 # Compile two additional files that are linked with every program
979 # linked using GCC on system V, for the sake of C++ constructors.
980 crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
981 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
982 -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
983 -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
984
985 crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
986 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
987 -DCRT_END -finhibit-size-directive -fno-inline-functions \
988 -g0 -c $(srcdir)/crtstuff.c -o crtend.o
989 \f
990 # Compiling object files from source files.
991
992 # Note that dependencies on obstack.h are not written
993 # because that file is not part of GCC.
994
995 # C language specific files.
996
997 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
998 $(srcdir)/c-parse.h c-tree.h input.h flags.h
999 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
1000 $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
1001 $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
1002 cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
1003 $(srcdir)/c-parse.y: $(srcdir)/c-parse.in
1004 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1005 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
1006 $(srcdir)/c-parse.in >tmp-c-parse.y
1007 $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
1008
1009 $(srcdir)/c-gperf.h: $(srcdir)/c-parse.gperf
1010 gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
1011 $(srcdir)/c-parse.gperf >tmp-gperf.h
1012 $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
1013
1014 c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h output.h
1015 c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h output.h
1016 c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
1017 c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h $(srcdir)/c-parse.h \
1018 input.h flags.h $(srcdir)/c-gperf.h
1019 c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
1020 c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
1021 c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H)
1022 c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h
1023
1024 # To make a configuration always use collect2, set USE_COLLECT2 to ld.
1025 ld: collect2
1026 rm -f ld$(exeext)
1027 ln collect2$(exeext) ld$(exeext) > /dev/null 2>&1 \
1028 || cp collect2$(exeext) ld$(exeext)
1029
1030 collect2 : collect2.o version.o $(LIBDEPS)
1031 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
1032 -rm -f collect2
1033 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
1034
1035 collect2.o : collect2.c $(CONFIG_H) gstab.h
1036 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1037 -DTARGET_MACHINE=\"$(target)\" \
1038 -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
1039
1040 # Objective C language specific files.
1041
1042 objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
1043 c-tree.h input.h flags.h objc-act.h
1044 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
1045 $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
1046 cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
1047 $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in
1048 sed -e "/^ifc$$/,/^end ifc$$/d" \
1049 -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
1050 $(srcdir)/c-parse.in >tmp-objc-prs.y
1051 $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc-parse.y
1052
1053 objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \
1054 flags.h objc-act.h input.h function.h $(srcdir)/c-parse.h
1055
1056 # A file used by all variants of C.
1057
1058 c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
1059
1060 # Language-independent files.
1061
1062 gcc.o: gcc.c $(CONFIG_H) multilib.h config.status
1063 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1064 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
1065 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
1066 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
1067 -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
1068 -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
1069 $(MAYBE_TARGET_DEFAULT) \
1070 -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
1071
1072 dumpvers: dumpvers.c
1073
1074 version.o: version.c
1075 obstack.o: obstack.c
1076
1077 convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
1078
1079 tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
1080 print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
1081 stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
1082 fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
1083 toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
1084 insn-attr.h xcoffout.h defaults.h output.h
1085 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1086 $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \
1087 -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
1088
1089 rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
1090
1091 print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
1092 rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
1093
1094 toplev.o: bytecode.h bc-emit.h
1095 varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
1096 defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h \
1097 output.h bytecode.h
1098 function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
1099 insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
1100 recog.h output.h bytecode.h
1101 stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
1102 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h \
1103 recog.h bytecode.h bc-typecd.h bc-typecd.def bc-opcode.h bc-optab.h \
1104 bc-emit.h
1105 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h regs.h \
1106 insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h \
1107 typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \
1108 bc-emit.h modemap.def
1109 calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
1110 insn-flags.h
1111 expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1112 insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
1113 explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
1114 insn-config.h expr.h recog.h insn-flags.h insn-codes.h
1115 optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1116 insn-flags.h insn-config.h insn-codes.h expr.h recog.h reload.h
1117 dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
1118 insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
1119 sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
1120 insn-config.h reload.h
1121 dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
1122 insn-config.h reload.h output.h defaults.h
1123 xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
1124 emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1125 function.h regs.h insn-config.h insn-codes.h real.h expr.h bytecode.h \
1126 bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h bc-opname.h
1127 real.o : real.c $(CONFIG_H) $(TREE_H)
1128 getpwd.o : getpwd.c $(CONFIG_H)
1129
1130 integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
1131 insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h \
1132 bytecode.h
1133
1134 jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
1135 insn-config.h insn-flags.h insn-codes.h expr.h real.h
1136 stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
1137
1138 cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
1139 insn-config.h recog.h
1140 loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
1141 insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
1142 unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
1143 integrate.h regs.h flags.h expr.h loop.h
1144 flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
1145 basic-block.h regs.h hard-reg-set.h output.h
1146 combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
1147 insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
1148 basic-block.h recog.h real.h hard-reg-set.h
1149 regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
1150 basic-block.h regs.h insn-config.h recog.h reload.h real.h bytecode.h
1151 local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
1152 regs.h hard-reg-set.h insn-config.h recog.h output.h
1153 global.o : global.c $(CONFIG_H) $(RTL_H) flags.h \
1154 basic-block.h regs.h hard-reg-set.h insn-config.h output.h
1155
1156 reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
1157 reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
1158 reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
1159 reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
1160 basic-block.h recog.h output.h
1161 caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
1162 regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
1163 reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
1164 basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
1165 flags.h output.h
1166 sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
1167 flags.h insn-config.h insn-attr.h
1168 final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h regs.h \
1169 recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
1170 hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
1171 recog.o : recog.c $(CONFIG_H) $(RTL_H) \
1172 regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
1173 insn-flags.h insn-codes.h real.h
1174 reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
1175 regs.h hard-reg-set.h flags.h insn-config.h
1176
1177 aux-output.o : aux-output.c $(CONFIG_H) \
1178 $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
1179 insn-flags.h output.h insn-attr.h insn-codes.h
1180 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1181 $(MAYBE_TARGET_DEFAULT) aux-output.c
1182
1183 # Build auxiliary files that support ecoff format.
1184 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
1185 $(CC) $(CFLAGS) $(LDFLAGS) -o mips-tfile mips-tfile.o version.o $(LIBS)
1186
1187 mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H)
1188
1189 mips-tdump: mips-tdump.o version.o $(LIBDEPS)
1190 $(CC) $(CFLAGS) $(LDFLAGS) -o mips-tdump mips-tdump.o version.o $(LIBS)
1191
1192 mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H)
1193
1194 # Build file to support OSF/rose half-pic format.
1195 halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H)
1196
1197 # Normally this target is not used; but it is used if you
1198 # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
1199 # from the GNU Emacs distribution.
1200 alloca.o: alloca.c
1201 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
1202 -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
1203 $(ALLOCA_FINISH)
1204 \f
1205 # Generate header and source files from the machine description,
1206 # and compile them.
1207
1208 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
1209 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1210 insn-attr.h insn-attrtab.c
1211
1212 # The following pair of rules has this effect:
1213 # genconfig is run only if the md has changed since genconfig was last run;
1214 # but the file insn-config.h is touched only when its contents actually change.
1215
1216 # Each of the other insn-* files is handled by a similar pair of rules.
1217
1218 # This causes an anomaly in the results of make -n
1219 # because insn-* is older than stamp-*
1220 # and thus make -n thinks that insn-* will be updated
1221 # and force recompilation of things that depend on it.
1222 # We use move-if-change precisely to avoid such recompilation.
1223 # But there is no way to teach make -n that it will be avoided.
1224
1225 # Each of the insn-*.[ch] rules has a semicolon at the end,
1226 # for otherwise the system Make on SunOS 4.1 never tries
1227 # to recompile insn-*.o. To avoid problems and extra noise from
1228 # versions of make which don't like empty commands (nothing after the
1229 # trailing `;'), we call true for each.
1230
1231 insn-config.h: stamp-config ; @true
1232 stamp-config : md genconfig $(srcdir)/move-if-change
1233 ./genconfig md > tmp-config.h
1234 $(srcdir)/move-if-change tmp-config.h insn-config.h
1235 touch stamp-config
1236
1237 insn-flags.h: stamp-flags ; @true
1238 stamp-flags : md genflags $(srcdir)/move-if-change
1239 ./genflags md > tmp-flags.h
1240 $(srcdir)/move-if-change tmp-flags.h insn-flags.h
1241 touch stamp-flags
1242
1243 insn-codes.h: stamp-codes ; @true
1244 stamp-codes : md gencodes $(srcdir)/move-if-change
1245 ./gencodes md > tmp-codes.h
1246 $(srcdir)/move-if-change tmp-codes.h insn-codes.h
1247 touch stamp-codes
1248
1249 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
1250 insn-config.h insn-flags.h insn-codes.h
1251 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1252
1253 insn-emit.c: stamp-emit ; @true
1254 stamp-emit : md genemit $(srcdir)/move-if-change
1255 ./genemit md > tmp-emit.c
1256 $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1257 touch stamp-emit
1258
1259 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
1260 real.h output.h flags.h
1261 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1262
1263 insn-recog.c: stamp-recog ; @true
1264 stamp-recog : md genrecog $(srcdir)/move-if-change
1265 ./genrecog md > tmp-recog.c
1266 $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1267 touch stamp-recog
1268
1269 insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
1270 insn-config.h flags.h rtl.h recog.h expr.h reload.h
1271 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1272
1273 insn-opinit.c: stamp-opinit ; @true
1274 stamp-opinit : md genopinit $(srcdir)/move-if-change
1275 ./genopinit md > tmp-opinit.c
1276 $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1277 touch stamp-opinit
1278
1279 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
1280 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1281
1282 insn-extract.c: stamp-extract ; @true
1283 stamp-extract : md genextract $(srcdir)/move-if-change
1284 ./genextract md > tmp-extract.c
1285 $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1286 touch stamp-extract
1287
1288 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
1289 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1290
1291 insn-peep.c: stamp-peep ; @true
1292 stamp-peep : md genpeep $(srcdir)/move-if-change
1293 ./genpeep md > tmp-peep.c
1294 $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1295 touch stamp-peep
1296
1297 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
1298 insn-attr.h insn-config.h
1299 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1300
1301 insn-attr.h: stamp-attr ; @true
1302 stamp-attr : md genattr $(srcdir)/move-if-change
1303 ./genattr md > tmp-attr.h
1304 $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1305 touch stamp-attr
1306
1307 insn-attrtab.c: stamp-attrtab ; @true
1308 stamp-attrtab : md genattrtab $(srcdir)/move-if-change
1309 if cmp -s $(PREMADE_ATTRTAB_MD) md; \
1310 then \
1311 echo Using $(PREMADE_ATTRTAB); \
1312 cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \
1313 else \
1314 ./genattrtab md > tmp-attrtab.c; \
1315 fi
1316 $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1317 touch stamp-attrtab
1318
1319 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
1320 hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
1321 insn-codes.h
1322 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1323
1324 insn-output.c: stamp-output ; @true
1325 stamp-output : md genoutput $(srcdir)/move-if-change
1326 ./genoutput md > tmp-output.c
1327 $(srcdir)/move-if-change tmp-output.c insn-output.c
1328 touch stamp-output
1329 \f
1330 # Compile the programs that generate insn-* from the machine description.
1331 # They are compiled with $(HOST_CC), and associated libraries,
1332 # since they need to run on this machine
1333 # even if GCC is being compiled to run on some other machine.
1334
1335 # $(CONFIG_H) is omitted from the deps of the gen*.o
1336 # because these programs don't really depend on anything
1337 # about the target machine. They do depend on config.h itself,
1338 # since that describes the host machine.
1339
1340 # Pass the md file through cpp if the target requests it.
1341 $(MD_FILE): $(MD_DEPS)
1342 rm -f $@
1343 $(MD_CPP) $(MD_CPPFLAGS) md.pre-cpp | sed 's/^# /; /g' > tmp-$@
1344 mv tmp-$@ $@
1345
1346 genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
1347 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
1348 genconfig.o $(HOST_RTL) $(HOST_LIBS)
1349
1350 genconfig.o : genconfig.c $(RTL_H) hconfig.h
1351 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1352
1353 genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
1354 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
1355 genflags.o $(HOST_RTL) $(HOST_LIBS)
1356
1357 genflags.o : genflags.c $(RTL_H) hconfig.h
1358 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1359
1360 gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
1361 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
1362 gencodes.o $(HOST_RTL) $(HOST_LIBS)
1363
1364 gencodes.o : gencodes.c $(RTL_H) hconfig.h
1365 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1366
1367 genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
1368 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
1369 genemit.o $(HOST_RTL) $(HOST_LIBS)
1370
1371 genemit.o : genemit.c $(RTL_H) hconfig.h
1372 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1373
1374 genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS)
1375 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genopinit \
1376 genopinit.o $(HOST_RTL) $(HOST_LIBS)
1377
1378 genopinit.o : genopinit.c $(RTL_H) hconfig.h
1379 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1380
1381 genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
1382 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
1383 genrecog.o $(HOST_RTL) $(HOST_LIBS)
1384
1385 genrecog.o : genrecog.c $(RTL_H) hconfig.h
1386 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1387
1388 genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
1389 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
1390 genextract.o $(HOST_RTL) $(HOST_LIBS)
1391
1392 genextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h
1393 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1394
1395 genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
1396 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
1397 genpeep.o $(HOST_RTL) $(HOST_LIBS)
1398
1399 genpeep.o : genpeep.c $(RTL_H) hconfig.h
1400 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1401
1402 genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
1403 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
1404 genattr.o $(HOST_RTL) $(HOST_LIBS)
1405
1406 genattr.o : genattr.c $(RTL_H) hconfig.h
1407 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1408
1409 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
1410 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
1411 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
1412
1413 genattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h
1414 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1415
1416 genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
1417 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
1418 genoutput.o $(HOST_RTL) $(HOST_LIBS)
1419
1420 genoutput.o : genoutput.c $(RTL_H) hconfig.h
1421 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1422 \f
1423 # Compile the libraries to be used by gen*.
1424 # If we are not cross-building, gen* use the same .o's that cc1 will use,
1425 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1426 # with the rules for rtl.o, alloca.o, etc.
1427 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1428 rm -f $(HOST_PREFIX)rtl.c
1429 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
1430 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1431
1432 $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1433 rm -f $(HOST_PREFIX)print-rtl.c
1434 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
1435 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1436
1437 $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1438 rm -f $(HOST_PREFIX)rtlanal.c
1439 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
1440 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1441
1442 $(HOST_PREFIX_1)alloca.o: alloca.c
1443 rm -f $(HOST_PREFIX)alloca.c
1444 cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1445 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1446
1447 $(HOST_PREFIX_1)obstack.o: obstack.c
1448 rm -f $(HOST_PREFIX)obstack.c
1449 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
1450 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1451
1452 $(HOST_PREFIX_1)malloc.o: malloc.c
1453 rm -f $(HOST_PREFIX)malloc.c
1454 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
1455 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1456
1457 # This satisfies the dependency that we get if you cross-compile a compiler
1458 # that does not need to compile alloca, malloc or whatever.
1459 $(HOST_PREFIX_1):
1460 touch $(HOST_PREFIX_1)
1461 \f
1462 # Remake bytecode files.
1463 # BI_ALL=bi-run.o
1464 BI_ALL=
1465 BC_ALL=bc-opname.h bc-opcode.h bc-arity.h
1466 BI_OBJ=bi-parser.o bi-lexer.o bi-reverse.o
1467
1468
1469 bc-emit.o : bc-emit.c $(CONFIG_H) $(RTL_H) real.h $(BYTECODE_H) \
1470 bc-arity.h bc-opcode.h bc-typecd.h bc-typecd.def bi-run.h bytetypes.h
1471 bc-optab.o : bc-optab.c $(CONFIG_H) $(REAL_H) $(BYTECODE_H) \
1472 bc-opcode.h bc-typecd.h bc-typecd.def
1473
1474
1475 bytecode: $(BI_ALL) $(BC_ALL)
1476
1477 bi-arity: bi-arity.o $(BI_OBJ) $(HOST_LIBDEPS)
1478 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-arity \
1479 bi-arity.o $(BI_OBJ) $(HOST_LIBS)
1480 bi-opcode: bi-opcode.o $(BI_OBJ) $(HOST_LIBDEPS)
1481 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-opcode \
1482 bi-opcode.o $(BI_OBJ) $(HOST_LIBS)
1483 bi-opname: bi-opname.o $(BI_OBJ) $(HOST_LIBDEPS)
1484 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-opname \
1485 bi-opname.o $(BI_OBJ) $(HOST_LIBS)
1486
1487 bi-run.o: $(srcdir)/bi-run.c $(srcdir)/bi-run.h $(srcdir)/bc-typecd.h \
1488 bc-opname.h bc-arity.h bc-opcode.h
1489 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/bi-run.c
1490 $(srcdir)/bi-parser.h: $(srcdir)/bi-parser.c
1491 $(srcdir)/bi-parser.c: $(srcdir)/bi-parser.y
1492 cd $(srcdir); $(BISON) $(BISONFLAGS) -d bi-parser.y -o bi-parser.c
1493 bi-parser.o: $(srcdir)/bi-parser.c $(srcdir)/bi-defs.h hconfig.h
1494 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1495 $(srcdir)/bi-parser.c
1496 bi-lexer.o: $(srcdir)/bi-lexer.c $(srcdir)/bi-parser.h hconfig.h
1497 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1498 $(srcdir)/bi-lexer.c
1499 bi-arity.o: bi-arity.c $(srcdir)/bi-defs.h hconfig.h
1500 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1501 $(srcdir)/bi-arity.c
1502 bi-opcode.o: bi-opcode.c $(srcdir)/bi-defs.h hconfig.h
1503 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1504 $(srcdir)/bi-opcode.c
1505 bi-opname.o: bi-opname.c $(srcdir)/bi-defs.h hconfig.h
1506 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1507 $(srcdir)/bi-opname.c
1508 bi-reverse.o: bi-reverse.c $(srcdir)/bi-defs.h
1509 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1510 $(srcdir)/bi-reverse.c
1511
1512
1513 bc-arity.h: stamp-bcarity ; @true
1514 stamp-bcarity : $(srcdir)/bytecode.def bi-arity $(srcdir)/move-if-change
1515 ./bi-arity < $(srcdir)/bytecode.def >tmp-bc-arity.h
1516 $(srcdir)/move-if-change tmp-bc-arity.h bc-arity.h
1517 touch stamp-bcarity
1518
1519 bc-opcode.h: stamp-bcopcode ; @true
1520 stamp-bcopcode : $(srcdir)/bytecode.def bi-opcode $(srcdir)/move-if-change
1521 ./bi-opcode < $(srcdir)/bytecode.def >tmp-bcopcd.h
1522 $(srcdir)/move-if-change tmp-bcopcd.h bc-opcode.h
1523 touch stamp-bcopcode
1524
1525 bc-opname.h: stamp-bcopname ; @true
1526 stamp-bcopname : $(srcdir)/bytecode.def bi-opname $(srcdir)/move-if-change
1527 ./bi-opname < $(srcdir)/bytecode.def >tmp-bcopnm.h
1528 $(srcdir)/move-if-change tmp-bcopnm.h bc-opname.h
1529 touch stamp-bcopname
1530
1531 bytecode.mostlyclean:
1532 -rm -f bc-arity.h bc-opcode.h bc-opname.h
1533
1534 bytecode.distclean bytecode.clean: bytecode.mostlyclean
1535 -rm -f bi-arity bi-opcode bi-opname bi-lexer
1536
1537 bytecode.realclean: bytecode.clean
1538 -rm -f bi-parser.c bi-parser.h
1539
1540 \f
1541 # Remake cpp and protoize.
1542
1543 # Making the preprocessor
1544 cpp: cccp
1545 -rm -f cpp$(exeext)
1546 ln cccp$(exeext) cpp$(exeext) > /dev/null 2>&1 \
1547 || cp cccp$(exeext) cpp$(exeext)
1548 cccp: cccp.o cexp.o version.o $(LIBDEPS)
1549 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1550 cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
1551 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1552 $(srcdir)/cexp.c: $(srcdir)/cexp.y
1553 cd $(srcdir); $(BISON) -o cexp.c cexp.y
1554 cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status
1555 # The reason we use $(libdir)/g++-include rather than using libsubdir
1556 # is for compatibility with the current version of libg++.
1557 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1558 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1559 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1560 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1561 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1562 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1563 -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1564
1565 # Note for the stamp targets, we run the program `true' instead of
1566 # having an empty command (nothing following the semicolon).
1567
1568 proto: config.status protoize unprotoize SYSCALLS.c.X
1569
1570 protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1571 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1572 protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o protoize
1573 protoize.o: stamp-proto ; @true
1574
1575 unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1576 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1577 unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) \
1578 -o unprotoize
1579 unprotoize.o: stamp-proto ; @true
1580
1581 stamp-proto: $(srcdir)/protoize.c getopt.h $(CONFIG_H)
1582 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1583 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1584 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1585 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1586 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1587 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1588 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1589 -DUNPROTOIZE $(srcdir)/protoize.c
1590 mv protoize.o unprotoize.o
1591 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1592 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1593 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1594 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1595 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1596 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1597 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1598 $(srcdir)/protoize.c
1599 touch stamp-proto
1600
1601 getopt.o: $(srcdir)/getopt.c getopt.h
1602 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
1603 getopt1.o: $(srcdir)/getopt1.c getopt.h
1604 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1605
1606 # This info describes the target machine, so compile with GCC just built.
1607 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) stmp-int-hdrs
1608 -rm -f SYSCALLS.c tmp-SYSCALLS.s
1609 cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
1610 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1611 -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1612 -rm -f SYSCALLS.c tmp-SYSCALLS.s
1613
1614
1615 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
1616 -rm -f tmp-proto.[cso]
1617 cp $(srcdir)/protoize.c tmp-proto.c
1618 chmod u+w tmp-proto.c
1619 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1620 $(CFLAGS) $(INCLUDES) \
1621 -DGCC_INCLUDE_DIR=0 \
1622 -DGPLUSPLUS_INCLUDE_DIR=0 \
1623 -DCROSS_INCLUDE_DIR=0 \
1624 -DTOOL_INCLUDE_DIR=0 \
1625 -DSTD_PROTO_DIR=0" tmp-proto.c
1626 @echo '**********' Expect 400 lines of differences.
1627 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1628 -wc -l tmp-proto.diff
1629 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1630 $(CFLAGS) $(INCLUDES) \
1631 -DGCC_INCLUDE_DIR=0 \
1632 -DGPLUSPLUS_INCLUDE_DIR=0 \
1633 -DCROSS_INCLUDE_DIR=0 \
1634 -DTOOL_INCLUDE_DIR=0 \
1635 -DSTD_PROTO_DIR=0" tmp-proto.c
1636 @echo Expect zero differences.
1637 diff $(srcdir)/protoize.c tmp-proto.c | cat
1638 -rm -f tmp-proto.[cso]
1639 \f
1640 # Build the include directory. The stamp files are stmp-* rather than
1641 # stamp-* so that mostlyclean does not force the include directory to
1642 # be rebuilt.
1643
1644 # Build the include directory except for float.h (which depends upon
1645 # enquire).
1646 stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h objc-headers
1647 # Copy in the headers provided with gcc.
1648 # The sed command gets just the last file name component;
1649 # this is necessary because VPATH could add a dirname.
1650 # Using basename would be simpler, but some systems don't have it.
1651 objdir=`pwd`; \
1652 cd $(srcdir); \
1653 for file in $(USER_H); do \
1654 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
1655 rm -f $$objdir/include/$$realfile; \
1656 cp ginclude/$$realfile $$objdir/include; \
1657 chmod a+r $$objdir/include/$$realfile; \
1658 done
1659 rm -f include/limits.h
1660 cp xlimits.h include/limits.h
1661 chmod a+r include/limits.h
1662 # Install the README
1663 rm -f include/README
1664 cp $(srcdir)/README-fixinc include/README
1665 chmod a+r include/README
1666 touch stmp-int-hdrs
1667
1668 # Build the complete include directory.
1669 stmp-headers: stmp-int-hdrs gfloat.h
1670 rm -f include/float.h
1671 cp gfloat.h include/float.h
1672 chmod a+r include/float.h
1673 touch stmp-headers
1674
1675 # Build fixed copies of system files.
1676 stmp-fixinc: $(srcdir)/$(FIXINCLUDES) gsyslimits.h
1677 rm -rf include
1678 mkdir include
1679 if [ x$(FIXINCLUDES) != xMakefile.in ]; \
1680 then \
1681 for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
1682 if [ -d $$dir ]; \
1683 then \
1684 $(SHELL) $(srcdir)/$(FIXINCLUDES) include $$dir; \
1685 else true; fi; \
1686 done; \
1687 else true; \
1688 fi
1689 rm -f include/syslimits.h
1690 if [ -f include/limits.h ]; then \
1691 mv include/limits.h include/syslimits.h; \
1692 else \
1693 cp $(srcdir)/gsyslimits.h include/syslimits.h; \
1694 fi
1695 chmod a+r include/syslimits.h
1696 touch stmp-fixinc
1697
1698 # copy objc header files into build directory
1699 objc-headers: stmp-fixinc
1700 if [ -d include ]; then true; else mkdir include; fi
1701 if [ -d objc ]; then true; else mkdir objc; fi
1702 thisdir1=`pwd`; \
1703 srcdir1=`cd $(srcdir); pwd`; \
1704 cd objc; \
1705 $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \
1706 srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
1707 GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
1708 GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include
1709 touch objc-headers
1710
1711 # Files related to the fixproto script.
1712
1713 deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
1714 CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
1715 export CC; \
1716 $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h
1717 mv tmp-deduced.h deduced.h
1718
1719 gen-protos: gen-protos.o scan.o $(HOST_LIBDEPS)
1720 ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gen-protos \
1721 gen-protos.o scan.o $(HOST_LIBS)
1722
1723 gen-protos.o: gen-protos.c scan.h hconfig.h
1724 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
1725
1726 scan.o: scan.c scan.h hconfig.h
1727 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
1728
1729 xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
1730 cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
1731 mv tmp-fixtmp.c fixtmp.c
1732 $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE_ -U__WCHAR_TYPE__ -E \
1733 | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
1734 | ./gen-protos >xsys-protos.hT
1735 mv xsys-protos.hT xsys-protos.h
1736 rm -rf fixtmp.c
1737
1738 fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS)
1739 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o fix-header \
1740 fix-header.o scan-decls.o scan.o $(HOST_LIBS)
1741
1742 fix-header.o: fix-header.c obstack.h scan.h xsys-protos.h hconfig.h
1743 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
1744
1745 scan-decls.o: scan-decls.c scan.h hconfig.h
1746 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
1747
1748 # stmp-fixproto depends on this, not on fix-header directly.
1749 # The idea is to make sure fix-header gets built,
1750 # but not rerun fixproto after each stage
1751 # just because fix-header's mtime has changed.
1752 fixhdr.ready: fix-header
1753 -if [ -f fixhdr.ready ] ; then \
1754 true; \
1755 else \
1756 touch fixhdr.ready; \
1757 fi
1758
1759 # stmp-headers is to make sure fixincludes has already finished.
1760 # The if statement is so that we don't run fixproto a second time
1761 # if it has already been run on the files in `include'.
1762 stmp-fixproto: fixhdr.ready fixproto stmp-headers
1763 @echo "Various warnings and error messages from fixproto are normal"
1764 -if [ -d include ] ; then true; else mkdir include; fi
1765 -if [ -f include/fixed ] ; then true; \
1766 else \
1767 : This line works around a 'make' bug in BSDI 1.1.; \
1768 CPP="$(GCC_FOR_TARGET) -E"; export CPP; \
1769 FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
1770 $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
1771 touch include/fixed; \
1772 fi
1773 touch stmp-fixproto
1774 \f
1775 # Remake the info files.
1776
1777 doc: info
1778 info: $(srcdir)/cpp.info $(srcdir)/gcc.info lang.info
1779
1780 $(srcdir)/cpp.info: cpp.texi
1781 cd $(srcdir); $(MAKEINFO) cpp.texi
1782
1783 $(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1784 md.texi rtl.texi tm.texi
1785 cd $(srcdir); $(MAKEINFO) gcc.texi
1786
1787 dvi: $(srcdir)/gcc.dvi $(srcdir)/cpp.dvi lang.dvi
1788
1789 # This works with GNU Make's default rule.
1790 $(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \
1791 md.texi rtl.texi tm.texi
1792 $(TEXI2DVI) $<
1793
1794 # This works with GNU Make's default rule.
1795 $(srcdir)/cpp.dvi: cpp.texi
1796 $(TEXI2DVI) $<
1797
1798 $(srcdir)/INSTALL: install1.texi install.texi
1799 $(MAKEINFO) -D INSTALLONLY --no-header --no-split \
1800 `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
1801 \f
1802 # Deletion of files made during compilation.
1803 # There are four levels of this:
1804 # `mostlyclean', `clean', `distclean' and `realclean'.
1805 # `mostlyclean' is useful while working on a particular type of machine.
1806 # It deletes most, but not all, of the files made by compilation.
1807 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
1808 # `clean' deletes everything made by running `make all'.
1809 # `distclean' also deletes the files made by config.
1810 # `realclean' also deletes everything that could be regenerated automatically.
1811 # We remove as much from the language subdirectories as we can
1812 # (less duplicated code).
1813
1814
1815 mostlyclean: bytecode.mostlyclean lang.mostlyclean
1816 -rm -f $(STAGESTUFF)
1817 # Clean the objc subdir if we created one.
1818 if [ -d objc ]; then \
1819 srcdir1=`cd $(srcdir); pwd`; \
1820 cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \
1821 else true; fi
1822 -rm -f libobjc.a
1823 # Delete the temporary source copies for cross compilation.
1824 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
1825 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
1826 -rm -f $(HOST_PREFIX_1)obstack.c
1827 # Delete the temp files made in the course of building libgcc.a.
1828 -rm -f tmplibgcc* tmpcopy xlimits.h
1829 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
1830 # Delete other temporary files.
1831 -rm -f tmp-float.h tmp-gcc.xtar.gz
1832 -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s
1833 -rm -f tmp-c-parse.y tmp-objc-prs.y tmp-gperf.h
1834 -rm -f tmp-specs t-float.h-cross tmp-xlimits.h
1835 -rm -f tmp-fixtmp.c xsys-protos.hT
1836 # Delete the stamp files.
1837 -rm -f stamp-* tmp-*
1838 -rm -f */stamp-* */tmp-*
1839 # Delete debugging dump files.
1840 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
1841 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
1842 -rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl
1843 -rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2
1844 -rm -f */*.sched2 */*.stack
1845 # Delete some files made during installation.
1846 -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
1847 -rm -f collect collect2 mips-tfile mips-tdump alloca.s
1848 # Delete files generated for fixproto
1849 -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
1850 gen-protos fixproto.list fixtmp.* fixhdr.ready
1851 # Delete unwanted output files from TeX.
1852 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
1853 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
1854 # Delete sorted indices we don't actually use.
1855 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
1856 # Delete core dumps.
1857 -rm -f core */core
1858
1859 # Delete all files made by compilation
1860 # that don't exist in the distribution.
1861 clean: mostlyclean bytecode.clean lang.clean
1862 # It may not be quite desirable to delete unprotoize.c here,
1863 # but the spec for `make clean' requires it.
1864 # Using unprotoize.c is not quite right in the first place,
1865 # but what better way is there?
1866 -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready
1867 -rm -f libgcc1.null $(LIB2FUNCS_EXTRA)
1868 -rm -f *.dvi
1869 -rm -f */*.dvi
1870 -if [ -f md.pre-cpp ]; then \
1871 rm -f md ; \
1872 fi
1873 # Delete the include directory.
1874 -rm -rf stmp-* include objc-headers
1875 -rm -f */stmp-*
1876 # Delete files used by the "multilib" facility (including libgcc subdirs).
1877 -rm -f multilib.h tmpmultilib*
1878 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
1879 rm -rf $(MULTILIB_DIRNAMES); \
1880 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
1881 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
1882 fi ; fi
1883
1884 # Delete all files that users would normally create
1885 # while building and installing GCC.
1886 distclean: clean bytecode.distclean lang.distclean
1887 -rm -f tm.h aux-output.c config.h tconfig.h hconfig.h
1888 -rm -f config.status config.run
1889 -rm -f md md.pre-cpp
1890 -rm -f Makefile *.oaux
1891 -rm -fr stage1 stage2 stage3 stage4
1892 -rm -f */stage1 */stage2 */stage3 */stage4 */include
1893 -rm -f objc-parse.output
1894 -rm -f c-parse.output
1895 -rm -f *.asm
1896
1897 # Delete anything likely to be found in the source directory
1898 # that shouldn't be in the distribution.
1899 extraclean: distclean lang.extraclean
1900 -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
1901 -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
1902 -rm -f config/*/=* config/*/"#"* config/*/*~*
1903 -rm -f config/*/*.orig config/*/*.rej
1904 -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
1905 -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
1906 -rm -f *lose config/*lose config/*/*lose
1907 -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog
1908 -rm -f */=* */"#"* */*~*
1909 -rm -f */patch* */*.orig */*.rej
1910 -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
1911 -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
1912 -rm -f */*lose */*.s */*.s[0-9] */*.i
1913
1914 # Get rid of every file that's generated from some other file.
1915 # Most of these files ARE PRESENT in the GCC distribution.
1916 realclean: distclean bytecode.realclean lang.realclean
1917 -rm -f c-parse.y c-gperf.h objc-parse.y
1918 -rm -f objc-parse.c objc-parse.output
1919 -rm -f c-parse.c c-parse.h c-parse.output
1920 -rm -f cexp.c cexp.output TAGS
1921 -rm -f cpp.info* cpp.??s cpp.*aux
1922 -rm -f gcc.info* gcc.??s gcc.*aux
1923 \f
1924 # Entry points `install' and `uninstall'.
1925 # Also use `install-collect2' to install collect2 when the config files don't.
1926
1927 # The semicolon is to prevent the install.sh -> install default rule
1928 # from doing anything. Having it run true helps avoid problems and
1929 # noise from versions of make which don't like to have null commands.
1930 install: $(INSTALL_TARGET) ; @true
1931
1932 # Copy the compiler files into directories where they will be run.
1933 install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
1934 install-man install-info lang.install-normal
1935
1936 # Do nothing while making gcc with a cross-compiler. The person who
1937 # makes gcc for the target machine has to know how to put a complete
1938 # gcc together by hand.
1939 install-build: force
1940 @echo You have to install gcc on your target machine by hand.
1941
1942 # Run this on the target machine
1943 # to finish installation of cross compiler.
1944 install-cross-rest: install-float-h-cross
1945
1946 # Install float.h for cross compiler.
1947 # Run this on the target machine!
1948 install-float-h-cross: install-dir
1949 # if [ -f enquire ] ; then true; else false; fi
1950 # Note: don't use -. We should fail right away if enquire was not made.
1951 ./enquire -f > $(tmpdir)/float.h
1952 -rm -f $(libsubdir)/include/float.h
1953 $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
1954 -rm -f $(tmpdir)/float.h
1955 chmod a-x $(libsubdir)/include/float.h
1956
1957 # Create the installation directory.
1958 install-dir:
1959 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
1960 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
1961 # This dir isn't currently searched by cpp.
1962 # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi
1963 -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
1964 -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
1965 -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
1966 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
1967 -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi
1968 -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; fi
1969 -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; fi
1970 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
1971 # We don't use mkdir -p to create the parents of mandir,
1972 # because some systems don't support it.
1973 # Instead, we use this technique to create the immediate parent of mandir.
1974 -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
1975 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1976 -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
1977
1978 # Install the compiler executables built during cross compilation.
1979 install-common: native install-dir xgcc $(EXTRA_PARTS) lang.install-common
1980 for file in $(COMPILERS); do \
1981 if [ -f $$file ] ; then \
1982 rm -f $(libsubdir)/$$file; \
1983 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1984 else true; \
1985 fi; \
1986 done
1987 for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
1988 if [ x"$$file" != x.. ]; then \
1989 rm -f $(libsubdir)/$$file; \
1990 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1991 else true; fi; \
1992 done
1993 for file in $(EXTRA_PARTS) ..; do \
1994 if [ x"$$file" != x.. ]; then \
1995 rm -f $(libsubdir)/$$file; \
1996 $(INSTALL_DATA) $$file $(libsubdir)/$$file; \
1997 else true; fi; \
1998 done
1999 # Don't mess with specs if it doesn't exist yet.
2000 -if [ -f specs ] ; then \
2001 rm -f $(libsubdir)/specs; \
2002 $(INSTALL_DATA) specs $(libsubdir)/specs; \
2003 fi
2004 # Install the driver program as $(target)-gcc
2005 # and also as either gcc (if native) or $(tooldir)/bin/gcc.
2006 -if [ -f gcc-cross$(exeext) ] ; then \
2007 rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2008 $(INSTALL_PROGRAM) gcc-cross$(exext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2009 if [ -d $(tooldir)/bin/. ] ; then \
2010 rm -f $(tooldir)/bin/gcc$(exeext); \
2011 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(tooldir)/bin/gcc$(exeext); \
2012 else true; fi; \
2013 else \
2014 rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2015 $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2016 rm -f $(bindir)/$(target)-gcc-1$(exeext); \
2017 ln $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target)-gcc-1$(exeext) \
2018 > /dev/null 2>&1 \
2019 || cp $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target)-gcc-1$(exeext); \
2020 mv $(bindir)/$(target)-gcc-1$(exeext) $(bindir)/$(target)-gcc$(exeext); \
2021 fi
2022 # Install protoize if it was compiled.
2023 -if [ -f protoize$(exeext) ]; \
2024 then \
2025 rm -f $(bindir)/protoize$(exeext); \
2026 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/protoize$(exeext); \
2027 rm -f $(bindir)/unprotoize$(exeext); \
2028 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/unprotoize$(exeext); \
2029 rm -f $(libsubdir)/SYSCALLS.c.X; \
2030 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
2031 chmod a-x $(libsubdir)/SYSCALLS.c.X; \
2032 fi
2033 -rm -f $(libsubdir)/cpp$(exeext)
2034 $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext)
2035
2036 # Install the info files.
2037 install-info: doc install-dir lang.install-info
2038 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2039 cd $(srcdir); for f in cpp.info* gcc.info*; \
2040 do $(INSTALL_DATA) $$f $(infodir)/$$f; done
2041 -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
2042
2043 # Install the man pages.
2044 install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man
2045 -if [ -f gcc-cross ] ; then \
2046 rm -f $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2047 $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2048 chmod a-x $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2049 else \
2050 rm -f $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2051 $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2052 chmod a-x $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2053 fi
2054 -rm -f $(mandir)/cccp$(manext)
2055 -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
2056 -chmod a-x $(mandir)/cccp$(manext)
2057
2058 # Install the library.
2059 install-libgcc: libgcc.a install-dir
2060 -if [ -f libgcc.a ] ; then \
2061 rm -f $(libsubdir)/libgcc.a; \
2062 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
2063 if $(RANLIB_TEST) ; then \
2064 (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
2065 chmod a-x $(libsubdir)/libgcc.a; \
2066 else true; fi
2067
2068 # Install multiple versions of libgcc.a.
2069 install-multilib: stmp-multilib install-dir
2070 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
2071 dir=`echo $$i | sed -e 's/;.*$$//'`; \
2072 if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \
2073 rm -f $(libsubdir)/$${dir}/libgcc.a; \
2074 $(INSTALL_DATA) $${dir}/libgcc.a $(libsubdir)/$${dir}/libgcc.a; \
2075 if $(RANLIB_TEST); then \
2076 (cd $(libsubdir)/$${dir}; $(RANLIB) libgcc.a); else true; fi; \
2077 chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
2078 done
2079
2080 # Install the objc run time library.
2081 install-libobjc: libobjc.a install-dir
2082 -if [ -f libobjc.a ] ; then \
2083 rm -f $(libsubdir)/libobjc.a; \
2084 $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
2085 if $(RANLIB_TEST) ; then \
2086 (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
2087 chmod a-x $(libsubdir)/libobjc.a; \
2088 else true; fi
2089
2090 # Install all the header files built in the include subdirectory.
2091 install-headers: install-include-dir $(INSTALL_HEADERS_DIR) install-assert-h
2092 # Fix symlinks to absolute paths in the installed include directory to
2093 # point to the installed directory, not the build directory.
2094 -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2095 if [ $$? -eq 0 ]; then \
2096 dir=`cd include; pwd`; \
2097 for i in $$files; do \
2098 dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2099 if expr "$$dest" : "$$dir.*" > /dev/null; then \
2100 rm -f $(libsubdir)/include/$$i; \
2101 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
2102 fi; \
2103 done; \
2104 fi
2105
2106 # Create or recreate the gcc private include file directory.
2107 install-include-dir: install-dir
2108 -rm -rf $(libsubdir)/include
2109 mkdir $(libsubdir)/include
2110 -chmod a+rx $(libsubdir)/include
2111
2112 # Install the include directory using tar.
2113 install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
2114 (cd include; \
2115 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
2116 # /bin/sh on some systems returns the status of the first tar,
2117 # and that can lose with GNU tar which always writes a full block.
2118 # So use `exit 0' to ignore its exit status.
2119
2120 # Install the include directory using cpio.
2121 install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir
2122 (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include)
2123
2124 # Put assert.h where it won't override GNU libc's assert.h.
2125 # It goes in a dir that is searched after GNU libc's headers;
2126 # thus, the following conditionals are no longer needed.
2127 # But it's not worth deleting them now.
2128 ## Don't replace the assert.h already there if it is not from GCC.
2129 ## This code would be simpler if it tested for -f ... && ! grep ...
2130 ## but supposedly the ! operator is missing in sh on some systems.
2131 install-assert-h: assert.h install-dir
2132 if [ -f $(assertdir)/assert.h ]; \
2133 then \
2134 if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
2135 then \
2136 rm -f $(assertdir)/assert.h; \
2137 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2138 chmod a-x $(assertdir)/assert.h; \
2139 else true; \
2140 fi; \
2141 else \
2142 rm -f $(assertdir)/assert.h; \
2143 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2144 chmod a-x $(assertdir)/assert.h; \
2145 fi
2146
2147 # Use this target to install the program `collect2' under the name `ld'.
2148 install-collect2: collect2 install-dir
2149 $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/ld$(exeext)
2150 # Install the driver program as $(libsubdir)/gcc for collect2.
2151 $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
2152
2153 # Cancel installation by deleting the installed files.
2154 uninstall: lang.uninstall
2155 -rm -rf $(libsubdir)
2156 -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2157 -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
2158 -rm -rf $(bindir)/protoize$(exeext)
2159 -rm -rf $(bindir)/unprotoize$(exeext)
2160 -rm -rf $(mandir)/$(GCC_INSTALL_NAME)$(manext)
2161 -rm -rf $(mandir)/$(GCC_CROSS_NAME)$(manext)
2162 -rm -rf $(mandir)/cccp$(manext)
2163 -rm -rf $(mandir)/protoize$(manext)
2164 -rm -rf $(mandir)/unprotoize$(manext)
2165 \f
2166 # These exist for maintenance purposes.
2167
2168 # Update the tags table.
2169 TAGS: force
2170 cd $(srcdir); \
2171 mkdir temp; \
2172 mv -f c-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \
2173 etags *.y *.h *.c; \
2174 mv temp/* .; \
2175 rmdir temp
2176
2177 # Create the distribution tar file.
2178 #dist: gcc-$(version).tar.gz
2179 dist: gcc.xtar.gz
2180
2181 gcc.xtar.gz: gcc.xtar
2182 gzip --best < gcc.xtar > tmp-gcc.xtar.gz
2183 mv tmp-gcc.xtar.gz gcc.xtar.gz
2184
2185 #gcc-$(version).tar.gz: gcc-$(version).tar
2186 # gzip < gcc-$(version).tar > gcc-$(version).tar.gz
2187
2188 #gcc-$(version).tar:
2189 gcc.xtar: distdir
2190 # Make the distribution.
2191 tar -chf gcc.xtar gcc-$(version)
2192
2193 # This target exists to do the initial work before the language specific
2194 # stuff gets done.
2195 distdir-start: doc $(srcdir)/INSTALL c-parse.y $(srcdir)/c-gperf.h objc-parse.y \
2196 c-parse.c objc-parse.c cexp.c
2197 @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \
2198 then true; \
2199 else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
2200 fi
2201 # Update the version number in README
2202 awk '$$1 " " $$2 " " $$3 == "This directory contains" \
2203 { $$6 = version; print $$0 } \
2204 $$1 " " $$2 " " $$3 != "This directory contains"' \
2205 version=$(version) README > tmp.README
2206 mv tmp.README README
2207 -rm -rf gcc-$(version) tmp
2208 # Put all the files in a temporary subdirectory
2209 # which has the name that we want to have in the tar file.
2210 mkdir tmp
2211 mkdir tmp/config
2212 mkdir tmp/ginclude
2213 mkdir tmp/objc
2214 for file in *[0-9a-zA-Z+]; do \
2215 ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
2216 done
2217 cd config; \
2218 for file in *[0-9a-zA-Z+]; do \
2219 if test -d $$file && test "$$file" != RCS; then \
2220 mkdir ../tmp/config/$$file; \
2221 cd $$file; \
2222 for subfile in *[0-9a-zA-Z+]; do \
2223 ln $$subfile ../../tmp/config/$$file >/dev/null 2>&1 \
2224 || cp $$subfile ../../tmp/config/$$file; \
2225 done; \
2226 cd ..; \
2227 else \
2228 ln $$file ../tmp/config >/dev/null 2>&1 \
2229 || cp $$file ../tmp/config; \
2230 fi; \
2231 done
2232 cd ginclude; \
2233 for file in *[0-9a-zA-Z+]; do \
2234 ln $$file ../tmp/ginclude >/dev/null 2>&1 \
2235 || cp $$file ../tmp/ginclude; \
2236 done
2237 cd objc; \
2238 for file in *[0-9a-zA-Z+]; do \
2239 ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
2240 done
2241 ln .gdbinit tmp
2242
2243 # Finish making `distdir', after the languages have done their thing.
2244 distdir-finish:
2245 mv tmp gcc-$(version)
2246 # Get rid of everything we don't want in the distribution. We'd want
2247 # this to use Makefile.in, but it doesn't have the `lang.foo' targets
2248 # expanded.
2249 cd gcc-$(version); make extraclean
2250
2251 distdir: distdir-start lang.distdir distdir-finish
2252
2253 # make diff oldversion=M.N
2254 # creates a diff file between an older distribution and this one.
2255 # The -P option assumes this is GNU diff.
2256 diff:
2257 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h \
2258 -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c \
2259 -x TAGS \
2260 -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \
2261 -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \
2262 $(LANG_DIFF_EXCLUDES) \
2263 gcc-$(oldversion) gcc-$(version) > diffs
2264
2265 # do make -f ../gcc/Makefile maketest DIR=../gcc
2266 # in the intended test directory to make it a suitable test directory.
2267 # THIS IS OBSOLETE; use the -srcdir operand in configure instead.
2268 maketest:
2269 ln -s $(DIR)/*.[chy] .
2270 ln -s $(DIR)/configure .
2271 ln -s $(DIR)/*.def .
2272 -rm -f =*
2273 ln -s $(DIR)/.gdbinit .
2274 ln -s $(DIR)/$(FIXINCLUDES) .
2275 -ln -s $(DIR)/bison.simple .
2276 ln -s $(DIR)/config .
2277 ln -s $(DIR)/move-if-change .
2278 # The then and else were swapped to avoid a problem on Ultrix.
2279 if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
2280 -rm tm.h aux-output.c config.h md
2281 make clean
2282 # You must then run config to set up for compilation.
2283
2284 bootstrap: force
2285 # Only build the C compiler for stage1, because that is the only one that
2286 # we can guarantee will build with the native compiler, and also it is the
2287 # only thing useful for building stage2.
2288 $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES=c
2289 $(MAKE) stage1
2290 # This used to define ALLOCA as empty, but that would lead to bad results
2291 # for a subsequent `make install' since that would not have ALLOCA empty.
2292 # To prevent `make install' from compiling alloca.o and then relinking cc1
2293 # because alloca.o is newer, we permit these recursive makes to compile
2294 # alloca.o. Then cc1 is newer, so it won't have to be relinked.
2295 $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
2296 $(MAKE) stage2
2297 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
2298
2299 bootstrap2: force
2300 $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
2301 $(MAKE) stage2
2302 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
2303
2304 bootstrap3: force
2305 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
2306
2307 # Compare the object files in the current directory with those in the
2308 # stage2 directory.
2309
2310 # ./ avoids bug in some versions of tail.
2311 compare: force
2312 for file in *.o; do \
2313 tail +16c ./$$file > tmp-foo1; \
2314 tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
2315 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
2316 done
2317 for dir in tmp-foo $(SUBDIRS); do \
2318 if [ "`echo $$dir/*.o`" != "$$dir/*.o" ] ; then \
2319 for file in $$dir/*.o; do \
2320 tail +16c ./$$file > tmp-foo1; \
2321 tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
2322 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
2323 done; \
2324 fi; \
2325 done
2326 -rm -f tmp-foo*
2327
2328 # Similar, but compare with stage3 directory
2329 compare3: force
2330 for file in *.o; do \
2331 tail +16c ./$$file > tmp-foo1; \
2332 tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
2333 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
2334 done
2335 for dir in tmp-foo $(SUBDIRS); do \
2336 if [ "`echo $$dir/*.o`" != "$$dir/*.o" ] ; then \
2337 for file in $$dir/*.o; do \
2338 tail +16c ./$$file > tmp-foo1; \
2339 tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
2340 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
2341 done; \
2342 fi; \
2343 done
2344 -rm -f tmp-foo*
2345
2346 # Compare the object files in the current directory with those in the
2347 # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
2348 # running tail and the overhead of twice copying each object file.
2349
2350 gnucompare: force
2351 for file in *.o; do \
2352 cmp --ignore-initial=16 $$file stage2/$$file || true ; \
2353 done
2354 for dir in tmp-foo $(SUBDIRS); do \
2355 if [ "`echo $$dir/*.o`" != "$$dir/*.o" ] ; then \
2356 for file in $$dir/*.o; do \
2357 cmp --ignore-initial=16 $$file stage2/$$file || true ; \
2358 done; \
2359 fi; \
2360 done
2361
2362 # Similar, but compare with stage3 directory
2363 gnucompare3: force
2364 for file in *.o; do \
2365 cmp --ignore-initial=16 $$file stage3/$$file || true ; \
2366 done
2367 for dir in tmp-foo $(SUBDIRS); do \
2368 if [ "`echo $$dir/*.o`" != "$$dir/*.o" ] ; then \
2369 for file in $$dir/*.o; do \
2370 cmp --ignore-initial=16 $$file stage3/$$file || true ; \
2371 done; \
2372 fi; \
2373 done
2374
2375 # Copy the object files from a particular stage into a subdirectory.
2376 stage1-start:
2377 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
2378 -for dir in . $(SUBDIRS) ; \
2379 do \
2380 if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
2381 done
2382 -mv $(STAGESTUFF) stage1
2383 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2384 # dir will work properly.
2385 -if [ -f as ] ; then cp as stage1 ; else true ; fi
2386 -if [ -f ld ] ; then cp ld stage1 ; else true ; fi
2387 -if [ -f real-ld ] ; then cp real-ld stage1 ; else true ; fi
2388 -rm -f stage1/libgcc.a
2389 -cp libgcc.a stage1
2390 -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
2391 stage1: force stage1-start lang.stage1
2392
2393 stage2-start:
2394 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
2395 -for dir in . $(SUBDIRS) ; \
2396 do \
2397 if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
2398 done
2399 -mv $(STAGESTUFF) stage2
2400 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2401 # dir will work properly.
2402 -if [ -f as ] ; then cp as stage2 ; else true ; fi
2403 -if [ -f ld ] ; then cp ld stage2 ; else true ; fi
2404 -if [ -f real-ld ] ; then cp real-ld stage2 ; else true ; fi
2405 -rm -f stage2/libgcc.a
2406 -cp libgcc.a stage2
2407 -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
2408 stage2: force stage2-start lang.stage2
2409
2410 stage3-start:
2411 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
2412 -for dir in . $(SUBDIRS) ; \
2413 do \
2414 if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
2415 done
2416 -mv $(STAGESTUFF) stage3
2417 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2418 # dir will work properly.
2419 -if [ -f as ] ; then cp as stage3 ; else true ; fi
2420 -if [ -f ld ] ; then cp ld stage3 ; else true ; fi
2421 -if [ -f real-ld ] ; then cp real-ld stage3 ; else true ; fi
2422 -rm -f stage3/libgcc.a
2423 -cp libgcc.a stage3
2424 -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
2425 stage3: force stage3-start lang.stage3
2426
2427 stage4-start:
2428 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
2429 -for dir in . $(SUBDIRS) ; \
2430 do \
2431 if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
2432 done
2433 -mv $(STAGESTUFF) stage4
2434 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2435 # dir will work properly.
2436 -if [ -f as ] ; then cp as stage4 ; else true ; fi
2437 -if [ -f ld ] ; then cp ld stage4 ; else true ; fi
2438 -if [ -f real-ld ] ; then cp real-ld stage4 ; else true ; fi
2439 -rm -f stage4/libgcc.a
2440 -cp libgcc.a stage4
2441 -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
2442 stage4: force stage4-start lang.stage4
2443
2444 # Copy just the executable files from a particular stage into a subdirectory,
2445 # and delete the object files. Use this if you're just verifying a version
2446 # that is pretty sure to work, and you are short of disk space.
2447 risky-stage1: force
2448 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
2449 -mv $(GCC_PARTS) stage1
2450 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2451 # dir will work properly.
2452 -if [ -f as ] ; then cp as stage1 ; else true ; fi
2453 -if [ -f ld ] ; then cp ld stage1 ; else true ; fi
2454 -if [ -f real-ld ] ; then cp real-ld stage1 ; else true ; fi
2455 -rm -f stage1/libgcc.a
2456 -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
2457 -make clean
2458
2459 risky-stage2: force
2460 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
2461 -mv $(GCC_PARTS) stage2
2462 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2463 # dir will work properly.
2464 -if [ -f as ] ; then cp as stage2 ; else true ; fi
2465 -if [ -f ld ] ; then cp ld stage2 ; else true ; fi
2466 -if [ -f real-ld ] ; then cp real-ld stage2 ; else true ; fi
2467 -rm -f stage2/libgcc.a
2468 -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
2469 -make clean
2470
2471 risky-stage3: force
2472 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
2473 -mv $(GCC_PARTS) stage3
2474 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2475 # dir will work properly.
2476 -if [ -f as ] ; then cp as stage3 ; else true ; fi
2477 -if [ -f ld ] ; then cp ld stage3 ; else true ; fi
2478 -if [ -f real-ld ] ; then cp real-ld stage3 ; else true ; fi
2479 -rm -f stage3/libgcc.a
2480 -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
2481 -make clean
2482
2483 risky-stage4: force
2484 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
2485 -mv $(GCC_PARTS) stage4
2486 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2487 # dir will work properly.
2488 -if [ -f as ] ; then cp as stage4 ; else true ; fi
2489 -if [ -f ld ] ; then cp ld stage4 ; else true ; fi
2490 -if [ -f real-ld ] ; then cp real-ld stage4 ; else true ; fi
2491 -rm -f stage4/libgcc.a
2492 -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
2493 -make clean
2494
2495 #In GNU Make, ignore whether `stage*' exists.
2496 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2497 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2498
2499 force: