OSDN Git Service

(REAL_LD_NAME): New variable.
[pf3gnuchains/gcc-fork.git] / gcc / Makefile.in
1 # Makefile for GNU C compiler.
2 #   Copyright (C) 1987, 1988, 1990, 1991, 1992 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 # Selection of languages to be made.
32 LANGUAGES = c c++ objective-c proto
33
34 ALLOCA =
35 ALLOCA_FLAGS =
36 ALLOCA_FINISH = true
37
38 # Various ways of specifying flags for compilations:  
39 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
40 # BOOT_CFLAGS is the value of CFLAGS to pass
41 # to the stage2 and stage3 compilations
42 # XCFLAGS is used for most compilations but not when using the GCC just built.
43 XCFLAGS =
44 CFLAGS = -g
45 BOOT_CFLAGS = -O $(CFLAGS)
46 # These exists to be overridden by the x-* and t-* files, respectively.
47 X_CFLAGS =
48 T_CFLAGS =
49
50 X_CPPFLAGS =
51 T_CPPFLAGS =
52
53 CC = cc
54 BISON = bison
55 BISONFLAGS =
56 AR = ar
57 OLDAR_FLAGS = qc
58 AR_FLAGS = rc
59 SHELL = /bin/sh
60 # on sysV, define this as cp.
61 INSTALL = install -c
62 # These permit overriding just for certain files.
63 INSTALL_PROGRAM = $(INSTALL)
64 INSTALL_DATA = $(INSTALL)
65 SYMLINK = ln -s
66 MAKEINFO = makeinfo
67
68 # Define this as & to perform parallel make on a Sequent.
69 # Note that this has some bugs, and it seems currently necessary 
70 # to compile all the gen* files first by hand to avoid erroneous results.
71 P =
72
73 # How to invoke ranlib.
74 RANLIB = ranlib
75 # Test to use to see whether ranlib exists on the system.
76 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
77
78 # Compiler to use for compiling libgcc1.a.
79 # OLDCC should not be the GNU C compiler,
80 # since that would compile typical libgcc1.a functions such as mulsi3
81 # into infinite recursions.
82 OLDCC = cc
83
84 # CFLAGS for use with OLDCC, for compiling libgcc1.a.
85 # NOTE: -O does not work on some Unix systems!
86 CCLIBFLAGS = -O
87
88 # Version of ar to use when compiling libgcc1.a.
89 OLDAR = ar
90
91 # The GCC to use for compiling libgcc2.a, enquire, and cross-test.
92 # Usually the one we just built.
93 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
94 GCC_FOR_TARGET = ./xgcc -B./
95
96 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
97 # It omits XCFLAGS, and specifies -B./.
98 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
99 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(CROSS_GCC_CFLAGS)
100
101 # Special flags for compiling enquire.
102 # We disable optimization to make floating point more reliable.
103 ENQUIRE_CFLAGS = -DNO_MEM -DNO_STDDEF -DNO_LONG_DOUBLE_IO -O0
104 ENQUIRE_LDFLAGS = $(LDFLAGS)
105
106 # Tools to use when building a cross-compiler.
107 # These are used because `configure' appends `cross-make'
108 # to the makefile when making a cross-compiler.
109
110 TARGET_TOOLPREFIX = $(tooldir)/bin/
111 AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
112 AR_FOR_TARGET_FLAGS = rc
113 RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
114 RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
115 CROSS_TOOLS =
116
117 # Dir to search for system headers.  Overridden by cross-make.
118 SYSTEM_HEADER_DIR = /usr/include
119
120 # There may be a premade insn-attrtab.c for this machine.
121 # (You could rebuild it with genattrtab as usual, but it takes a long time.)
122 # PREMADE_ATTRTAB is the file name of the file to use.
123 # PREMADE_ATTRTAB_MD is the md file it corresponds to.
124 PREMADE_ATTRTAB_MD = Makefile  # Guaranteed not to cmp equal to md.
125 PREMADE_ATTRTAB = 
126
127 target= ... `configure' substitutes actual target name here.
128 xmake_file= ... `configure' substitutes actual x- file name here.
129 tmake_file= ... `configure' substitutes actual t- file name here.
130 version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
131
132 # Directory where sources are, from where we are.
133 srcdir = .
134 # Common prefix for installation directories.
135 # NOTE: This directory must exist when you start installation.
136 prefix = /usr/local
137 # Directory in which to put host dependent programs and libraries
138 exec_prefix = $(prefix)
139 # Directory in which to put the executable for the command `gcc'
140 bindir = $(exec_prefix)/bin
141 # Directory in which to put the directories used by the compiler.
142 libdir = $(exec_prefix)/lib
143 # Directory in which the compiler finds executables, libraries, etc.
144 libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
145 # Directory for header file assert.h.
146 includedir = $(prefix)/include
147 # assertdir is overridden in cross-make.
148 assertdir = $(includedir)
149 # Extension (if any) to put in installed man-page filename.
150 manext = .1
151 # Directory in which to put man pages.
152 mandir = $(prefix)/man/man1
153 # Directory in which to find other cross-compilation tools and headers.
154 # Used in install-cross.
155 tooldir = $(prefix)/$(target)
156 # Dir for temp files.
157 tmpdir = /tmp
158
159 # Additional system libraries to link with.
160 CLIB=
161
162 # Change this to a null string if obstacks are installed in the
163 # system library.
164 OBSTACK=obstack.o
165
166 # Specify the rule for actually making libgcc1.a.
167 # The value may be empty; that means to do absolutely nothing
168 # with or for libgcc1.a.
169 LIBGCC1 = libgcc1.a
170
171 # Specify the rule for actually making libgcc2.a.
172 LIBGCC2 = libgcc2.a
173
174 # Options to use when compiling libgcc2.a.
175 # -g1 causes output of debug info only for file-scope entities.
176 # we use this here because that should be enough, and also
177 # so that -g1 will be tested.
178 LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS) -g1
179
180 # List of extra executables that should be compiled for this target machine
181 # that are used for compiling from source code to object code.
182 # The rules for compiling them should be in the t-* file for the machine.
183 EXTRA_PASSES =
184
185 # Like EXTRA_PASSES, but these are used when linking.
186 EXTRA_PROGRAMS = 
187
188 # List of extra object files that should be compiled for this target machine.
189 # The rules for compiling them should be in the t-* file for the machine.
190 EXTRA_PARTS =
191
192 # List of extra object files that should be compiled and linked with
193 # compiler proper (cc1, cc1obj, cc1plus).
194 EXTRA_OBJS =
195
196 # List of additional header files to install.
197 # Often this is edited directly by `configure'.
198 EXTRA_HEADERS =
199
200 # Set this to `ld' to enable use of collect2.
201 # USE_COLLECT2 =
202 # It is convenient for configure to add the assignment at the beginning,
203 # so don't override it here.
204
205 # List of extra C and assembler files to add to libgcc1.a.
206 # Assembler files should have names ending in `.asm'.
207 LIB1FUNCS_EXTRA = 
208
209 # List of extra C and assembler files to add to libgcc2.a.
210 # Assembler files should have names ending in `.asm'.
211 LIB2FUNCS_EXTRA = 
212
213 # Program to convert libraries.
214 LIBCONVERT = 
215
216 # Control whether header files are installed.
217 # We will change this to install-fixincludes eventually.
218 # It would be useful for people to try this now.
219 INSTALL_HEADERS=install-headers
220
221 # Select which version of fixincludes to use (I.E. regular versus SVR4)
222 FIXINCLUDES=fixincludes
223
224 # Additional directories of header files to run fixincludes on.
225 # On most systems, this is empty.
226 OTHER_FIXINCLUDES_DIRS=
227
228 # List of things which should already be built whenever we try to use xgcc
229 # to compile anything (without linking).
230 GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)
231
232 # List of things which should already be built whenever we try to use xgcc
233 # to link anything.
234 GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
235
236 # Name of `ld' to link into the binary directory for a cross-compiler.
237 # If we are using collect2, this will be `gld', since `ld' is collect2.
238 # Otherwise it is `ld'.
239 REAL_LD_NAME=`if [ x$(USE_COLLECT2) = xld ]; then echo "gld"; else echo "ld"; fi` 
240
241 # Directory to link to, when using the target `maketest'.
242 DIR = ../gcc
243
244 # Flags to use when cross-building GCC.
245 # Prefix to apply to names of object files when using them
246 # to run on the machine we are compiling on.
247 HOST_PREFIX=
248 # Prefix to apply to names of object files when compiling them
249 # to run on the machine we are compiling on.
250 # The default for this variable is chosen to keep these rules 
251 # out of the way of the other rules for compiling the same source files.
252 HOST_PREFIX_1=loser-
253 HOST_CC=$(CC)
254 HOST_CFLAGS=$(ALL_CFLAGS)
255 HOST_CLIB=$(CLIB)
256 HOST_LDFLAGS=$(LDFLAGS)
257 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
258 HOST_ALLOCA=$(ALLOCA)
259 HOST_MALLOC=$(MALLOC)
260 HOST_OBSTACK=$(OBSTACK)
261
262 # Choose the real default target.
263 ALL=all.internal
264
265 # Choose the real install target.
266 INSTALL_TARGET=install-native
267
268 # End of variables for you to override.
269
270 # Definition of `all' is here so that new rules inserted by sed
271 # do not specify the default target.
272 # The real definition is under `all.internal' (for native compilers)
273 # or `all.cross' (for cross compilers).
274 all: all.indirect
275
276 # This tells GNU Make version 3 not to put all variables in the environment.
277 .NOEXPORT:
278
279 # sed inserts variable overrides after the following line.
280 ####target overrides
281 ####host overrides
282 ####cross overrides
283 ####build overrides
284 \f
285 # Now figure out from those variables how to compile and link.
286
287 all.indirect: $(ALL)
288
289 # IN_GCC tells obstack.h to use gstddef.h.
290 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
291
292 # This is the variable actually used when we compile.
293 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
294
295 # Likewise.
296 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
297
298 # Even if ALLOCA is set, don't use it if compiling with GCC.
299 USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac `
300 USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
301 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
302 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
303
304 # Dependency on obstack, alloca, malloc or whatever library facilities
305 # are not installed in the system libraries.
306 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
307 LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
308
309 # Likewise, for use in the tools that must run on this machine
310 # even if we are cross-building GCC.
311 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
312 HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
313
314 # How to link with both our special library facilities
315 # and the system's installed libraries.
316 LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
317
318 # Likewise, for use in the tools that must run on this machine
319 # even if we are cross-building GCC.
320 HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
321             $(HOST_CLIB)
322
323 HOST_RTL = $(HOST_PREFIX)rtl.o
324 HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
325 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
326
327 # Specify the directories to be searched for header files.
328 # Both . and srcdir are used, in that order,
329 # so that tm.h and config.h will be found in the compilation
330 # subdirectory rather than in the source directory.
331 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
332 SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
333
334 # Always use -I$(srcdir)/config when compiling.
335 .c.o:
336         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
337
338 # This tells GNU make version 3 not to export all the variables
339 # defined in this file into the environment.
340 .NOEXPORT:
341 \f
342 # Lists of files for various purposes.
343
344 # A list of all the language-specific executables.
345 COMPILERS = cc1 cc1plus cc1obj
346
347 # Language-specific object files for C.
348 C_OBJS = c-parse.o c-lang.o c-lex.o \
349    c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-pragma.o
350
351 # Language-specific object files for Objectionable C.
352 OBJC_OBJS = objc-parse.o objc-actions.o \
353    c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-pragma.o
354
355 # Language-specific object files for C++.
356 CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
357    cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \
358    cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \
359    cp-class.o cp-init.o cp-method.o cp-except.o \
360    cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
361    $(CPLUS_INPUT) cp-spew.o c-common.o
362
363 # Language-independent object files.
364 OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
365  function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
366  rtl.o print-rtl.o rtlanal.o emit-rtl.o \
367  dbxout.o sdbout.o dwarfout.o xcoffout.o \
368  integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
369  regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
370  insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
371  insn-recog.o insn-extract.o insn-output.o insn-emit.o \
372  insn-attrtab.o aux-output.o getpwd.o $(EXTRA_OBJS)
373
374 # GEN files are listed separately, so they can be built before doing parallel
375 #  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
376 #  them before rtl.o is compiled.
377 GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
378
379 # Files to be copied away after each stage in building.
380 STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
381  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
382  insn-attr.h insn-attrtab.c \
383  stamp-flags stamp-config stamp-codes \
384  stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
385  stamp-attr stamp-attrtab stamp-proto \
386  genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
387  genattrtab genattr \
388  $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
389  cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2)
390
391 # Members of libgcc1.a.
392 LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
393    _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
394    _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
395    _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
396    _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
397    _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
398    _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
399
400 # Library members defined in libgcc2.c.
401 LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
402      _lshrdi3 _lshldi3 _ashldi3 _ashrdi3  \
403     _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
404     _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
405     __gcc_bcmp _varargs _eprintf _op_new _new_handler _op_delete \
406     _bb _shtab _clear_cache _trampoline __main _exit _ctors
407
408 # Header files that are made available under the same name
409 # to programs compiled with GCC.
410 USER_H = va-alpha.h va-i860.h va-i960.h va-mips.h va-m88k.h \
411     va-pa.h va-pyr.h va-sparc.h va-spur.h proto.h $(EXTRA_HEADERS)
412
413 # All the header files that are installed for users from GCC itself.
414 INSTALLED_H = float.h stddef.h stdarg.h varargs.h $(USER_H) limits.h \
415     syslimits.h
416
417 # The files that "belong" in CONFIG_H are deliberately omitted
418 # because having them there would not be useful in actual practice.
419 # All they would do is cause complete recompilation every time
420 # one of the machine description files is edited.
421 # That may or may not be what one wants to do.
422 # If it is, rm *.o is an easy way to do it.
423 # CONFIG_H = config.h tm.h
424 CONFIG_H =
425 RTL_H = rtl.h rtl.def machmode.h machmode.def
426 TREE_H = tree.h real.h tree.def machmode.h machmode.def
427 CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
428 \f
429 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
430 .SUFFIXES: .in .def
431
432 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
433    $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file)
434         sh config.status
435
436 all.internal: start.encap rest.encap
437 # This is what to compile if making a cross-compiler.
438 all.cross: native gcc-cross specs libgcc.a cross-test $(EXTRA_PARTS)
439 # This is what to compile if making gcc with a cross-compiler.
440 all.build: native xgcc $(EXTRA_PARTS)
441 # This is what must be made before installing GCC and converting libraries.
442 start.encap: native xgcc specs $(LIBGCC1) xlimits.h
443 # Use this to make a GCC that will be used only to recompile GCC.
444 for-bootstrap: start.encap libgcc.a
445 # These can't be made, with COFF encapsulation, until after GCC can run.
446 rest.encap: libgcc.a float.h  $(EXTRA_PARTS)
447 # This is what is made with the host's compiler
448 # whether making a cross compiler or not.
449 native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
450
451 # Define the names for selecting languages in LANGUAGES.
452 C c: cc1
453 C++ c++: cc1plus
454 OBJC objc: cc1obj objc-runtime
455 OBJECTIVE-C objective-c: cc1obj objc-runtime
456 PROTO: proto
457
458 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
459 # a target to build even if it is up-to-date.  So we must verify that
460 # config.status does not exist before failing.
461 config.status:
462         @if [ ! -f config.status ] ; then \
463           echo You must configure gcc.  Look at the INSTALL file for details.; \
464           false; \
465         else \
466           true; \
467         fi
468
469 # On the target machine, finish building a cross compiler.
470 # This does the things that can't be done on the host machine.
471 rest.cross: libgcc.a float.h specs
472
473 # Verify that it works to compile and link cross-test.
474 # If it does, then there are sufficient replacements for libgcc1.a.
475 cross-test: cross-test.o native gcc-cross libgcc.a
476         $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@
477 cross-test.o: cross-test.c native gcc-cross
478         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
479
480 # Recompile all the language-independent object files.
481 # This is used only if the user explicitly asks for it.
482 compilations: ${OBJS}
483
484 # We call this executable `xgcc' rather than `gcc'
485 # to avoid confusion if the current directory is in the path
486 # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
487 xgcc: gcc.o version.o $(LIBDEPS)
488         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgcc gcc.o version.o $(LIBS)
489
490 # Dump a specs file to make -B./ read these specs over installed ones.
491 specs: xgcc
492         ./xgcc -dumpspecs > specs
493
494 # We do want to create an executable named `xgcc', so we can use it to
495 # compile libgcc2.a.
496 # Also create gcc-cross, so that install-common will install properly.
497 gcc-cross: xgcc
498         cp xgcc gcc-cross
499
500 cc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
501         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
502
503 cc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
504         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
505
506 cc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
507         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
508
509 float.h: enquire
510         -./enquire -f > tmp-float.h
511         mv tmp-float.h float.h
512
513 # Used to compile enquire with standard cc, but have forgotten why.
514 # Let's try with GCC.
515 enquire: enquire.o $(GCC_PARTS)
516         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
517 enquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
518 #       -if [ "$(srcdir)" != "." ]; then rm -f ./enquire.c; else true; fi
519 #       -cp $(srcdir)/enquire.c . > /dev/null 2>&1
520 # Breaking this line caused a problem with one version of GNU make.
521         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
522
523 # Build the version of limits.h that we will install.
524 xlimits.h: glimits.h limitx.h limity.h
525         if [ -f $(SYSTEM_HEADER_DIR)/limits.h ] ; then \
526           cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > xlimits.h; \
527         else \
528           cat $(srcdir)/glimits.h > xlimits.h; \
529         fi
530 \f
531 # Build libgcc.a.
532 # This is done in two parts because some functions, in libgcc1.c,
533 # must be compiled with something other than GCC,
534 # while the rest, in libgcc2.c, must be compiled with xgcc.
535 # That means we can't do libgcc2.c until after xgcc, cc1, etc.
536
537 # Use this as value of LIBGCC1 to cause conversion to GNU library format.
538 # LIBCONVERT should put its output in libgcc1.conv.
539 libgcc1.conv: libgcc1.a
540         $(LIBCONVERT) libgcc1.a libgcc1.conv
541
542 # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
543 # Make an empty file instead.
544 libgcc1.null: $(CROSS_TOOLS) $(GCC_PASSES)
545         echo "__foo () {}" > dummy.c
546         $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
547         $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
548         rm -f dummy.o dummy.c
549
550 # This is $(LIBGCC1) for a cross-compiler.
551 # We have no automatic way of building libgcc1.a, 
552 # so it's up to the installer to find a way to do that.
553 # This rule deliberately does not depend on libgcc1.a
554 # so that it will fail if the installer hasn't provided it.
555 libgcc1.cross:
556         mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
557
558 # Compile the library of arithmetic subroutines with the native compiler.
559 # Don't compile it with GCC!
560 # (That would cause most arithmetic functions to call themselves.)
561 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
562         -rm -f tmplibgcc1.a
563 # Actually build it in tmplibgcc1.a, then rename at end,
564 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
565 # -e causes any failing command to make this rule fail.
566 # -e doesn't work in certain shells, so we test $$? as well.
567         set -e; \
568         for name in $(LIB1FUNCS); \
569         do \
570           echo $${name}; \
571           rm -f $${name}.o; \
572           $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
573           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
574           mv libgcc1.o $${name}.o; \
575           $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
576           rm -f $${name}.o; \
577         done
578 # Some shells crash when a loop has no items.
579 # So make sure there is always at least one--`..'.
580 # Then ignore it.
581 # We don't use -e here because there are if statements
582 # that should not make the command give up when the if condition is false.
583 # Instead, we test for failure after each command where it matters.
584         -for file in .. $(LIB1FUNCS_EXTRA); \
585         do \
586           if [ x$${file} != x.. ]; then \
587             name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
588             echo $${name}; \
589             if [ $${name}.asm = $${file} ]; then \
590               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
591             else true; fi; \
592             $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
593             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
594             $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
595             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
596             rm -f $${name}.[so]; \
597           else true; \
598           fi; \
599         done
600         mv tmplibgcc1.a libgcc1.a
601
602 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
603 # But recompiling cc1 should not force recompilation of libgcc2.a.
604 # If you want to force recompilation, delete libgcc2.a.
605 # Depend on install-cross-tools to make sure we set up properly 
606 # to run the assembler before we try compiling anything.
607 # install-cross-tools does nothing if not cross compiling.
608 libgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
609         -if [ -f libgcc2.ready ] ; then \
610                 true; \
611         else \
612                 touch libgcc2.ready; \
613         fi
614
615 libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
616    machmode.h longlong.h gbl-ctors.h config.status
617 # Actually build it in tmplibgcc2.a, then rename at end,
618 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
619         -rm -f tmplibgcc2.a
620 # -e causes any failing command to make this rule fail.
621 # -e doesn't work in certain shells, so we test $$? as well.
622         set -e; \
623         for name in $(LIB2FUNCS); \
624         do \
625           echo $${name}; \
626           $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
627               $(srcdir)/libgcc2.c -o $${name}.o; \
628           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
629           $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
630           rm -f $${name}.o; \
631         done
632 # Some shells crash when a loop has no items.
633 # So make sure there is always at least one--`..'.
634 # Then ignore it.
635 # We don't use -e here because there are if statements
636 # that should not make the command give up when the if condition is false.
637 # Instead, we test for failure after each command where it matters.
638         -for file in .. $(LIB2FUNCS_EXTRA); \
639         do \
640           if [ x$${file} != x.. ]; then \
641             name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
642             echo $${name}; \
643             if [ $${name}.asm = $${file} ]; then \
644               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
645             else true; fi; \
646             $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
647             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
648             $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
649             rm -f $${name}.[so]; \
650           else true; \
651           fi; \
652         done
653         mv tmplibgcc2.a libgcc2.a
654 # These lines were deleted from above the mv command
655 # because ranlibing libgcc.a itself should suffice.
656 #       -if [ x${HPUX_GAS} = x ] ; then \
657 #         if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
658 #       else true; fi
659
660 # Combine the various libraries into a single library, libgcc.a.
661 libgcc.a: $(LIBGCC1) $(LIBGCC2)
662         -rm -rf tmplibgcc.a libgcc.a tmpcopy
663         mkdir tmpcopy
664         -if [ x$(LIBGCC1) != x ];                       \
665         then (cd tmpcopy; $(AR) x ../$(LIBGCC1));       \
666         else true;                                      \
667         fi
668         (cd tmpcopy; $(AR) x ../$(LIBGCC2))
669         (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
670         rm -rf tmpcopy
671         -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
672 # Actually build it in tmplibgcc.a, then rename at end,
673 # so that libgcc.a itself remains nonexistent if compilation is aborted.
674         mv tmplibgcc.a libgcc.a
675
676 objc-runtime: libobjc.a
677
678 # Build the Objective C runtime library.
679 libobjc.a: cc1obj libgcc2.ready
680         if [ -d objc ]; then true; else mkdir objc; fi
681         thisdir1=`pwd`; \
682         srcdir1=`cd $(srcdir); pwd`; \
683         cd objc; \
684         $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
685           srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
686           GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
687           GCC_CFLAGS="$(GCC_CFLAGS)"
688         -rm -f libobjc.a
689         ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
690         -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
691
692 # This is used by objc/Makefile if the user runs that directly.
693 sublibobjc.a: cc1obj libgcc2.ready
694         thisdir1=`pwd`; \
695         srcdir1=`cd $(srcdir); pwd`; \
696         cd objc; \
697         $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
698           srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
699           GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
700           GCC_CFLAGS="$(GCC_CFLAGS)"
701
702 # Compile two additional files that are linked with every program
703 # linked using GCC on system V, for the sake of C++ constructors.
704 crtbegin.o:     crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
705         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
706           -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
707
708 crtend.o:       crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
709         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
710           -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
711 \f
712 # Compiling object files from source files.
713
714 # Note that dependencies on obstack.h are not written
715 # because that file is not part of GCC.
716 # Dependencies on gvarargs.h are not written
717 # because all that file does, when not compiling with GCC,
718 # is include the system varargs.h.
719
720 # C language specific files.
721
722 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \
723     c-tree.h input.h flags.h
724         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
725 $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
726         cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
727 $(srcdir)/c-parse.y: $(srcdir)/c-parse.in $(srcdir)/cond.awk
728         cd $(srcdir); awk -f cond.awk objc=0 c-parse.in > c-parse.y
729
730 c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
731 c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
732 c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
733 c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
734     input.h flags.h
735 c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(TREE_H) c-tree.h flags.h
736 c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
737 c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H)
738
739 # C++ language specific files.
740
741 cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
742         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
743   `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
744
745 $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
746         @echo expect 29 shift/reduce conflicts and 14 reduce/reduce conflicts
747         cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
748         cd $(srcdir); grep '^#define[   ]*YYEMPTY' cp-parse.c >>cp-parse.h
749
750 cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
751    $(srcdir)/cp-parse.h flags.h
752 cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
753    $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
754 cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
755   cp-lex.h cp-decl.h stack.h
756 cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
757   cp-lex.h cp-decl.h
758 cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
759 cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
760 cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h \
761     cp-class.h flags.h
762 cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h cp-class.h \
763     flags.h
764 cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
765 cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
766 cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
767 cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
768 cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
769 cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
770 cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
771 cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
772 cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
773   expr.h insn-codes.h
774 cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
775 cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H)
776 cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
777
778 # To make a configuration always use collect2, set USE_COLLECT2 to ld.
779 ld: collect2
780         rm -f ld
781         ln collect2 ld
782
783 collect2 : collect2.o version.o $(LIBDEPS)
784 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
785         -rm -f collect2
786         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
787
788 collect2.o : collect2.c $(CONFIG_H) gstab.h
789         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)  \
790         -DTARGET_MACHINE=\"$(target)\" \
791         -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
792
793 # Objectionable C language specific files.
794
795 objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
796    c-tree.h input.h flags.h objc-actions.h
797         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
798 $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
799         cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
800 $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in $(srcdir)/cond.awk
801         cd $(srcdir); awk -f cond.awk objc=1 c-parse.in > objc-parse.y
802
803 objc-actions.o : objc-actions.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h \
804    flags.h objc-actions.h
805
806 # A file used by all variants of C.
807
808 c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
809
810 # Language-independent files.
811
812 gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
813         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
814   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
815   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
816   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
817   -DTOOLDIR=\"$(tooldir)/\" \
818   $(MAYBE_TARGET_DEFAULT) \
819   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
820
821 dumpvers: dumpvers.c
822
823 version.o: version.c
824 obstack.o: obstack.c
825
826 tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
827 print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
828 stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
829 fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h 
830 toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
831    insn-attr.h xcoffout.h
832         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
833           $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \
834           -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
835
836 rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
837
838 print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
839 rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
840
841 varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
842    defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
843 function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
844    insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
845    recog.h output.h
846 stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
847    insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
848 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h function.h  \
849    insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
850 calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
851    insn-flags.h
852 expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
853    insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
854 explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
855    insn-config.h expr.h recog.h insn-flags.h insn-codes.h
856 optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
857    insn-flags.h insn-config.h insn-codes.h expr.h recog.h
858 dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
859    insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
860 sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
861    insn-config.h reload.h
862 dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
863    insn-config.h reload.h output.h defaults.h
864 xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
865 emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h  \
866    regs.h insn-config.h insn-codes.h real.h expr.h
867 getpwd.o : getpwd.c $(CONFIG_H)
868
869 integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
870    insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
871
872 jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
873    insn-config.h insn-flags.h insn-codes.h expr.h real.h
874 stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
875
876 cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
877    insn-config.h recog.h
878 loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
879    insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
880 unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
881    integrate.h regs.h flags.h expr.h loop.h
882 flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
883    basic-block.h regs.h hard-reg-set.h output.h
884 combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h  \
885    insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
886    basic-block.h recog.h real.h
887 regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
888    basic-block.h regs.h insn-config.h recog.h reload.h real.h
889 local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
890    regs.h hard-reg-set.h insn-config.h recog.h output.h
891 global.o : global.c $(CONFIG_H) $(RTL_H) flags.h  \
892    basic-block.h regs.h hard-reg-set.h insn-config.h output.h
893
894 reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
895    reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
896 reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
897    reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
898    basic-block.h recog.h output.h
899 caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
900    regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
901 reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
902    basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
903    flags.h output.h
904 sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
905    flags.h insn-config.h insn-attr.h
906 final.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
907    recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
908    hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
909 recog.o : recog.c $(CONFIG_H) $(RTL_H)  \
910    regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
911    insn-flags.h insn-codes.h real.h
912 reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
913    regs.h hard-reg-set.h flags.h insn-config.h
914
915 aux-output.o : aux-output.c $(CONFIG_H) \
916    $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
917    insn-flags.h output.h insn-attr.h insn-codes.h
918
919 # Normally this target is not used; but it is used if you
920 # define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
921 # from the GNU Emacs distribution.
922 alloca.o:       alloca.c
923         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
924           -Demacs -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
925         $(ALLOCA_FINISH)
926 \f
927 # Generate header and source files from the machine description, 
928 # and compile them.
929
930 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
931   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
932   insn-attr.h insn-attrtab.c
933
934 # The following pair of rules has this effect:
935 # genconfig is run only if the md has changed since genconfig was last run;
936 # but the file insn-config.h is touched only when its contents actually change.
937
938 # Each of the other insn-* files is handled by a similar pair of rules.
939
940 # This causes an anomaly in the results of make -n
941 # because insn-* is older than stamp-*
942 # and thus make -n thinks that insn-* will be updated
943 # and force recompilation of things that depend on it.
944 # We use move-if-changed precisely to avoid such recompilation.
945 # But there is no way to teach make -n that it will be avoided.
946
947 # Each of the insn-*.[ch] rules has a semicolon at the end,
948 # for otherwise the system Make on SunOS 4.1 never tries
949 # to recompile insn-*.o.
950
951 insn-config.h: stamp-config ;
952 stamp-config : md genconfig $(srcdir)/move-if-change
953         ./genconfig md > tmp-config.h
954         $(srcdir)/move-if-change tmp-config.h insn-config.h
955         touch stamp-config
956
957 insn-flags.h: stamp-flags ;
958 stamp-flags : md genflags $(srcdir)/move-if-change
959         ./genflags md > tmp-flags.h
960         $(srcdir)/move-if-change tmp-flags.h insn-flags.h
961         touch stamp-flags
962
963 insn-codes.h: stamp-codes ;
964 stamp-codes : md gencodes $(srcdir)/move-if-change
965         ./gencodes md > tmp-codes.h
966         $(srcdir)/move-if-change tmp-codes.h insn-codes.h
967         touch stamp-codes
968
969 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
970   insn-config.h insn-flags.h insn-codes.h
971         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
972
973 insn-emit.c: stamp-emit ;
974 stamp-emit : md genemit $(srcdir)/move-if-change
975         ./genemit md > tmp-emit.c
976         $(srcdir)/move-if-change tmp-emit.c insn-emit.c
977         touch stamp-emit
978
979 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
980   real.h output.h flags.h
981         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
982
983 insn-recog.c: stamp-recog ;
984 stamp-recog : md genrecog $(srcdir)/move-if-change
985         ./genrecog md > tmp-recog.c
986         $(srcdir)/move-if-change tmp-recog.c insn-recog.c
987         touch stamp-recog
988
989 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
990         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
991
992 insn-extract.c: stamp-extract ;
993 stamp-extract : md genextract $(srcdir)/move-if-change
994         ./genextract md > tmp-extract.c
995         $(srcdir)/move-if-change tmp-extract.c insn-extract.c
996         touch stamp-extract
997
998 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
999         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1000
1001 insn-peep.c: stamp-peep ;
1002 stamp-peep : md genpeep $(srcdir)/move-if-change
1003         ./genpeep md > tmp-peep.c
1004         $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1005         touch stamp-peep
1006
1007 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
1008      insn-attr.h insn-config.h
1009         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1010
1011 insn-attr.h: stamp-attr ;
1012 stamp-attr : md genattr $(srcdir)/move-if-change
1013         ./genattr md > tmp-attr.h
1014         $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1015         touch stamp-attr
1016
1017 insn-attrtab.c: stamp-attrtab ;
1018 stamp-attrtab : md genattrtab $(srcdir)/move-if-change
1019         if cmp -s $(PREMADE_ATTRTAB_MD) md;     \
1020         then                                    \
1021           echo Using $(PREMADE_ATTRTAB);        \
1022           cp $(PREMADE_ATTRTAB) tmp-attrtab.c;  \
1023         else                                    \
1024           ./genattrtab md > tmp-attrtab.c;      \
1025         fi
1026         $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1027         touch stamp-attrtab
1028
1029 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
1030     hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
1031     insn-codes.h
1032         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1033
1034 insn-output.c: stamp-output ;
1035 stamp-output : md genoutput $(srcdir)/move-if-change
1036         ./genoutput md > tmp-output.c
1037         $(srcdir)/move-if-change tmp-output.c insn-output.c
1038         touch stamp-output
1039 \f
1040 # Compile the programs that generate insn-* from the machine description.
1041 # They are compiled with $(HOST_CC), and associated libraries,
1042 # since they need to run on this machine
1043 # even if GCC is being compiled to run on some other machine.
1044
1045 # $(CONFIG_H) is omitted from the deps of the gen*.o
1046 # because these programs don't really depend on anything 
1047 # about the target machine.  They do depend on config.h itself,
1048 # since that describes the host machine.
1049
1050 genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
1051         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
1052           genconfig.o $(HOST_RTL) $(HOST_LIBS)
1053
1054 genconfig.o : genconfig.c $(RTL_H) hconfig.h
1055         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1056
1057 genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
1058         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
1059          genflags.o $(HOST_RTL) $(HOST_LIBS)
1060
1061 genflags.o : genflags.c $(RTL_H) hconfig.h
1062         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1063
1064 gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
1065         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
1066          gencodes.o $(HOST_RTL) $(HOST_LIBS)
1067
1068 gencodes.o : gencodes.c $(RTL_H) hconfig.h
1069         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1070
1071 genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
1072         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
1073          genemit.o $(HOST_RTL) $(HOST_LIBS)
1074
1075 genemit.o : genemit.c $(RTL_H) hconfig.h
1076         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1077
1078 genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
1079         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
1080          genrecog.o $(HOST_RTL) $(HOST_LIBS)
1081
1082 genrecog.o : genrecog.c $(RTL_H) hconfig.h
1083         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1084
1085 genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
1086         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
1087          genextract.o $(HOST_RTL) $(HOST_LIBS)
1088
1089 genextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h
1090         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1091
1092 genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
1093         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
1094          genpeep.o $(HOST_RTL) $(HOST_LIBS)
1095
1096 genpeep.o : genpeep.c $(RTL_H) hconfig.h
1097         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1098
1099 genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
1100         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
1101          genattr.o $(HOST_RTL) $(HOST_LIBS)
1102
1103 genattr.o : genattr.c $(RTL_H) hconfig.h
1104         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1105
1106 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
1107         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
1108          genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
1109
1110 genattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h
1111         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1112
1113 genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
1114         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
1115          genoutput.o $(HOST_RTL) $(HOST_LIBS)
1116
1117 genoutput.o : genoutput.c $(RTL_H) hconfig.h
1118         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1119 \f
1120 # Compile the libraries to be used by gen*.
1121 # If we are not cross-building, gen* use the same .o's that cc1 will use,
1122 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1123 # with the rules for rtl.o, alloca.o, etc.
1124 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1125         rm -f $(HOST_PREFIX)rtl.c
1126         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
1127         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1128
1129 $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1130         rm -f $(HOST_PREFIX)print-rtl.c
1131         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
1132         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1133
1134 $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1135         rm -f $(HOST_PREFIX)rtlanal.c
1136         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
1137         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1138
1139 $(HOST_PREFIX_1)alloca.o: alloca.c
1140         rm -f $(HOST_PREFIX)alloca.c
1141         cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1142         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1143
1144 $(HOST_PREFIX_1)obstack.o: obstack.c
1145         rm -f $(HOST_PREFIX)obstack.c
1146         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
1147         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1148
1149 $(HOST_PREFIX_1)malloc.o: malloc.c
1150         rm -f $(HOST_PREFIX)malloc.c
1151         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
1152         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1153
1154 # This satisfies the dependency that we get if you cross-compile a compiler
1155 # that does not need to compile alloca, malloc or whatever.
1156 $(HOST_PREFIX_1): 
1157         touch $(HOST_PREFIX_1)
1158 \f
1159 # Remake cpp and protoize.
1160
1161 # Making the preprocessor
1162 cpp: cccp
1163         -rm -f cpp
1164         ln cccp cpp
1165 cccp: cccp.o cexp.o version.o $(LIBDEPS)
1166         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1167 cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
1168         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1169 $(srcdir)/cexp.c: $(srcdir)/cexp.y
1170         cd $(srcdir); $(BISON) -o cexp.c cexp.y
1171 cccp.o: cccp.c $(CONFIG_H) pcp.h version.c
1172 # The reason we use $(libdir)/g++-include rather than using libsubdir
1173 # is for compatibility with the current version of libg++.
1174         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1175           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1176           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1177           -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1178           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1179           -DTOOLDIR=\"$(tooldir)/\" \
1180           -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1181
1182 proto: config.status protoize unprotoize SYSCALLS.c.X
1183
1184 protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1185         $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1186           protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1187 protoize.o: stamp-proto ;
1188
1189 unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1190         $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1191           unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1192 unprotoize.o:   stamp-proto ;
1193
1194 stamp-proto:    $(srcdir)/protoize.c getopt.h $(CONFIG_H)
1195         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1196           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1197           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1198           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1199           -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1200           -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1201           -DUNPROTOIZE $(srcdir)/protoize.c
1202         mv protoize.o unprotoize.o
1203         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1204           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1205           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1206           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1207           -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1208           -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1209           $(srcdir)/protoize.c
1210         touch stamp-proto
1211
1212 getopt.o: $(srcdir)/getopt.c getopt.h
1213         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
1214 getopt1.o: $(srcdir)/getopt1.c getopt.h
1215         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1216
1217 # This info describes the target machine, so compile with GCC just built.
1218 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
1219         -rm -f SYSCALLS.c tmp-SYSCALLS.s
1220         cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
1221         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1222           -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1223         -rm -f SYSCALLS.c tmp-SYSCALLS.s
1224
1225 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
1226         -rm -f tmp-proto.[cso]
1227         cp $(srcdir)/protoize.c tmp-proto.c
1228         chmod u+w tmp-proto.c
1229         ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1230           $(CFLAGS) $(INCLUDES) \
1231           -DGCC_INCLUDE_DIR=0 \
1232           -DGPLUSPLUS_INCLUDE_DIR=0 \
1233           -DCROSS_INCLUDE_DIR=0 \
1234           -DSTD_PROTO_DIR=0" tmp-proto.c
1235         @echo '**********' Expect 400 lines of differences.
1236         -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1237         -wc -l tmp-proto.diff
1238         ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1239           $(CFLAGS) $(INCLUDES) \
1240           -DGCC_INCLUDE_DIR=0 \
1241           -DGPLUSPLUS_INCLUDE_DIR=0 \
1242           -DCROSS_INCLUDE_DIR=0 \
1243           -DSTD_PROTO_DIR=0" tmp-proto.c
1244         @echo Expect zero differences.
1245         diff $(srcdir)/protoize.c tmp-proto.c | cat
1246         -rm -f tmp-proto.[cso]
1247 \f
1248 # Remake the info files.
1249
1250 doc: $(srcdir)/cpp.info $(srcdir)/gcc.info
1251
1252 $(srcdir)/cpp.info: cpp.texi
1253         $(MAKEINFO) `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
1254
1255 #$(srcdir)/gplus.info: gplus.texi
1256 #       $(MAKEINFO) `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
1257
1258 $(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1259                 md.texi rtl.texi tm.texi 
1260         $(MAKEINFO) `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
1261
1262 # This works with GNU Make's default rule.
1263 $(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \
1264                 md.texi rtl.texi tm.texi 
1265
1266 # This works with GNU Make's default rule.
1267 $(srcdir)/cpp.dvi: cpp.texi
1268
1269 $(srcdir)/INSTALL: install1.texi install.texi
1270         $(MAKEINFO) -D INSTALLONLY --no-header `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
1271 \f
1272 # Deletion of files made during compilation.
1273 # There are four levels of this:
1274 #   `mostlyclean', `clean', `distclean' and `realclean'.
1275 # `mostlyclean' is useful while working on a particular type of machine.
1276 # It deletes most, but not all, of the files made by compilation.
1277 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
1278 # `clean' deletes everything made by running `make all'.
1279 # `distclean' also deletes the files made by config.
1280 # `realclean' also deletes everything that could be regenerated automatically.
1281
1282
1283 mostlyclean:
1284         -rm -f $(STAGESTUFF)
1285 # Clean the objc subdir if we created one.
1286         if [ -d objc ]; then \
1287           srcdir1=`cd $(srcdir); pwd`; \
1288           cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \
1289         else true; fi
1290         -rm -f libobjc.a
1291 # Delete the temporary source copies for cross compilation.
1292         -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
1293         -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
1294         -rm -f $(HOST_PREFIX_1)obstack.c 
1295 # Delete the temp files made in the course of building libgcc.a.
1296         -rm -f tmplibgcc* tmpcopy xlimits.h
1297         for name in $(LIB1FUNCS); do rm -f $${name}.c; done
1298 # Delete other temporary files.
1299         -rm -f tmp-float.h tmp-gcc.xtar.Z
1300         -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s
1301 # Delete the stamp files.
1302         -rm -f stamp-* tmp-*
1303 # Delete debugging dump files.
1304         -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
1305         -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
1306 # Delete some files made during installation.
1307         -rm -f specs float.h enquire SYSCALLS.c.X SYSCALLS.c
1308         -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
1309 # Delete unwanted output files from TeX.
1310         -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
1311 # Delete sorted indices we don't actually use.
1312         -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
1313 # Delete core dumps.
1314         -rm -f core config/core
1315
1316 # Delete all files made by compilation
1317 # that don't exist in the distribution.
1318 clean: mostlyclean
1319 # It may not be quite desirable to delete unprotoize.c here,
1320 # but the spec for `make clean' requires it.
1321 # Using unprotoize.c is not quite right in the first place, 
1322 # but what better way is there?
1323         -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready libgcc1.null
1324         -rm -f *.dvi
1325
1326 # Delete all files that users would normally create
1327 # while building and installing GCC.
1328 distclean: clean
1329         -rm -f tm.h aux-output.c config.h md config.status tconfig.h hconfig.h
1330         -rm -f Makefile *.oaux
1331         -rm -fr stage1 stage2 stage3 stage4
1332
1333 # Delete anything likely to be found in the source directory
1334 # that shouldn't be in the distribution.
1335 extraclean: distclean
1336         -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
1337         -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
1338         -rm -f *.dvi *.oaux *.d *.Z *.tar *.xtar *diff
1339         -rm -f *lose config/*lose
1340         -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog
1341
1342 # Get rid of every file that's generated from some other file.
1343 # Most of these files ARE PRESENT in the GCC distribution.
1344 realclean: distclean
1345         -rm -f c-parse.y objc-parse.y
1346         -rm -f cp-parse.c cp-parse.h cp-parse.output
1347         -rm -f objc-parse.c objc-parse.output
1348         -rm -f c-parse.c c-parse.h c-parse.output
1349         -rm -f cexp.c cexp.output TAGS 
1350         -rm -f cpp.info* cpp.??s cpp.*aux
1351         -rm -f gcc.info* gcc.??s gcc.*aux
1352         -rm -f gplus.info* gplus.??s gplus.*aux
1353 \f
1354 # Entry points `install' and `uninstall'.
1355 # Also temporarily `install-fixincludes' could replace `install-headers'.
1356 # Also use `install-collect2' to install collect2 when the config files don't.
1357
1358 # The semicolon is to prevent the install.sh -> install default rule
1359 # from doing anything.
1360 install: $(INSTALL_TARGET) ;
1361
1362 # Copy the files of native compiler into directories where they will be run.
1363 install-native: install-common install-libgcc $(INSTALL_HEADERS) \
1364    install-man
1365
1366 # Copy the files of cross compiler into directories where they will be run.
1367 install-cross: install-common install-common-headers \
1368    install-man install-cross-tools install-libgcc
1369
1370 # Do nothing while making gcc with a cross-compiler. The person who
1371 # makes gcc for the target machine has to know how to put a complete
1372 # gcc together by hand.
1373 install-build: force
1374         @echo You have to install gcc on your target machine by hand.
1375
1376 # Install the tools, libraries and header files for the target machine
1377 # where cross-compilation will look for them.
1378 # Use tooldir to find them.
1379 install-cross-tools: install-dir
1380 # The first if makes this a no-op except for a cross compiler.
1381 # The /. after the dirname causes test to follow symlinks.
1382 # Before making a link or an indirection script, 
1383 # we verify the desired file does not already exist.
1384 # If a symlink does exist, then making a symlink would certainly fail, 
1385 # leading us to overwrite the real file through the symlink.
1386         -if [ -f gcc-cross ] ; \
1387         then \
1388           if [ -d $(tooldir)/. ] ; \
1389           then \
1390             for file in as $(REAL_LD_NAME) ar nm ranlib; do \
1391               if [ -f $(libsubdir)/$$file ] ; \
1392               then true; \
1393               else  \
1394                 rm -rf $(libsubdir)/$$file; \
1395                 $(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \
1396                 || (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \
1397               fi; \
1398             done; \
1399             for file in $(tooldir)/lib/*; do \
1400               if [ -f $$file ] ; \
1401               then \
1402                 if [ -f $(libsubdir)/`basename $$file` ] ; \
1403                 then true; \
1404                 else  \
1405                   rm -rf $(libsubdir)/`basename $$file`; \
1406                   $(SYMLINK) $$file $(libsubdir)/`basename $$file` \
1407                   || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \
1408                 fi; \
1409               else true; \
1410               fi; \
1411             done; \
1412             if [ -d $(tooldir)/include/. ] ; then \
1413               rm -rf $(libsubdir)/sys-include; \
1414               $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \
1415               || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \
1416                   (cd $(tooldir)/include; tar cf - .) | (cd $(libsubdir)/sys-include; tar xpf -)); \
1417             else true; fi; \
1418           else true; \
1419           fi; \
1420         else true; \
1421         fi;
1422
1423 # Run this on the target machine
1424 # to finish installation of cross compiler.
1425 install-cross-rest: install-float-h-cross
1426
1427 # Install float.h for cross compiler.
1428 # Run this on the target machine!
1429 install-float-h-cross:
1430 # I don't see what this line is for.
1431 # If you see what good it does, please tell me.  -- rms.
1432         if [ -f enquire ] ; then true; else false; fi
1433         -./enquire -f > $(tmpdir)/float.h
1434         -rm -f $(libsubdir)/include/float.h
1435         $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
1436         -rm -f $(tmpdir)/float.h
1437         chmod a-x $(libsubdir)/include/float.h
1438
1439 # Create the installation directory.
1440 install-dir:
1441         -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
1442         -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
1443         -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi
1444         -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
1445         -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
1446         -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
1447         -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
1448         -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi
1449         -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi
1450         -if [ -f gcc-cross ] ; \
1451         then \
1452           if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; fi ; \
1453           if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; fi ; \
1454         else true; \
1455         fi
1456 # We don't use mkdir -p to create the parents of mandir,
1457 # because some systems don't support it.
1458 # Instead, we use this technique to create the immediate parent of mandir.
1459         -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
1460         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1461         -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
1462
1463 # Install the compiler executables built during cross compilation.
1464 # Deps on  $(srcdir)/g++ $(srcdir)/c++  would be natural here,
1465 # but the latter would get confused with the target `c++'.
1466 install-common: native install-dir xgcc $(EXTRA_PARTS)
1467         for file in $(COMPILERS); do \
1468           if [ -f $$file ] ; then \
1469             rm -f $(libsubdir)/$$file; \
1470             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1471           else true; \
1472           fi; \
1473         done
1474         for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
1475           if [ x"$$file" != x.. ]; then \
1476             rm -f $(libsubdir)/$$file; \
1477             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1478           else true; fi; \
1479         done
1480 # Don't mess with specs if it doesn't exist yet.
1481         -if [ -f specs ] ; then \
1482           rm -f $(libsubdir)/specs; \
1483           $(INSTALL_DATA) specs $(libsubdir)/specs; \
1484         fi
1485 # Install the driver program as gcc-$(target)
1486 # and also as either gcc (if native) or $(tooldir)/bin/gcc.
1487         -if [ -f gcc-cross ] ; then \
1488           $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$(target); \
1489           if [ -d $(tooldir)/bin/. ] ; then \
1490             rm -f $(tooldir)/bin/gcc; \
1491             $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
1492           else true; fi; \
1493         else \
1494           rm -f $(bindir)/gcc; \
1495           $(INSTALL_PROGRAM) xgcc $(bindir)/gcc; \
1496           rm -f $(bindir)/gcc-$(target)-1; \
1497           ln $(bindir)/gcc $(bindir)/gcc-$(target)-1; \
1498           mv $(bindir)/gcc-$(target)-1 $(bindir)/gcc-$(target); \
1499         fi
1500 # Install protoize if it was compiled.
1501         -if [ -f protoize ]; \
1502         then \
1503             rm -f $(bindir)/protoize; \
1504             $(INSTALL_PROGRAM) protoize $(bindir)/protoize; \
1505             rm -f $(bindir)/unprotoize; \
1506             $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize; \
1507             rm -f $(libsubdir)/SYSCALLS.c.X; \
1508             $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
1509             chmod a-x $(libsubdir)/SYSCALLS.c.X; \
1510         fi
1511         -rm -f $(bindir)/c++
1512         $(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++
1513         -rm -f $(bindir)/g++
1514         $(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++
1515         -rm -f $(libsubdir)/cpp
1516         $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
1517
1518 # Install the man pages.
1519 install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 $(srcdir)/g++.1
1520         -rm -f $(mandir)/gcc$(manext)
1521         -$(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext)
1522         -chmod a-x $(mandir)/gcc$(manext)
1523         -rm -f $(mandir)/cccp$(manext)
1524         -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
1525         -chmod a-x $(mandir)/cccp$(manext)
1526         -$(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext)
1527         -chmod a-x $(mandir)/g++$(manext)
1528
1529 # Install the library.
1530 install-libgcc: libgcc.a install-dir
1531         -if [ -f libgcc.a ] ; then \
1532           rm -f $(libsubdir)/libgcc.a; \
1533           $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
1534           if $(RANLIB_TEST) ; then \
1535             (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
1536           chmod a-x $(libsubdir)/libgcc.a; \
1537         else true; fi
1538
1539 # Install the objc run time library.
1540 install-libobjc: libobjc.a install-dir
1541         -if [ -f libobjc.a ] ; then \
1542           rm -f $(libsubdir)/libobjc.a; \
1543           $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
1544           if $(RANLIB_TEST) ; then \
1545             (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
1546           chmod a-x $(libsubdir)/libobjc.a; \
1547         else true; fi
1548
1549 # Install all the header files for native compiler.
1550 install-headers: install-common-headers install-float-h install-limits-h
1551
1552 # Install float.h for native compiler.
1553 install-float-h: float.h install-dir
1554         -rm -f $(libsubdir)/include/float.h
1555         $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
1556         chmod a-x $(libsubdir)/include/float.h
1557
1558 # Install limits.h.
1559 install-limits-h: xlimits.h install-dir
1560         -rm -f $(libsubdir)/include/limits.h
1561         $(INSTALL_DATA) xlimits.h $(libsubdir)/include/limits.h
1562         chmod a-x $(libsubdir)/include/limits.h
1563
1564 # Install the fixed headers that are the same for all machines.
1565 install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h gsyslimits.h assert.h
1566         -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
1567         -chmod ugo+rx $(libsubdir)/include
1568 # Must compute $(libsubdir) before the cd; the awk script won't work after.
1569         shelllibsubdir=$(libsubdir); \
1570         cd $(srcdir); \
1571         for file in $(USER_H); do \
1572            rm -f $$shelllibsubdir/include/`basename $$file`; \
1573            $(INSTALL_DATA) `basename $$file` $$shelllibsubdir/include/`basename $$file`; \
1574            chmod a-x $$shelllibsubdir/include/`basename $$file`; \
1575         done
1576 # Put assert.h in /usr/local/include, so it won't override GNU libc's assert.h.
1577 # Don't replace the assert.h already there if it is not from GCC.
1578 # This code would be simpler if it tested for -f ... && ! grep ...
1579 # but supposedly the ! operator is missing in sh on some systems.
1580         if [ -f $(assertdir)/assert.h ]; \
1581         then \
1582           if grep "__eprintf" $(assertdir)/assert.h; \
1583             then \
1584             rm -f $(assertdir)/assert.h; \
1585             $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
1586             chmod a-x $(assertdir)/assert.h; \
1587           else true; \
1588           fi; \
1589         else \
1590           rm -f $(assertdir)/assert.h; \
1591           $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
1592           chmod a-x $(assertdir)/assert.h; \
1593         fi
1594         -rm -f $(libsubdir)/include/syslimits.h
1595         $(INSTALL_DATA) $(srcdir)/gsyslimits.h $(libsubdir)/include/syslimits.h
1596         chmod a-x $(libsubdir)/include/syslimits.h
1597         -rm -f $(libsubdir)/include/varargs.h
1598         $(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h
1599         chmod a-x $(libsubdir)/include/varargs.h
1600         -rm -f $(libsubdir)/include/stdarg.h
1601         $(INSTALL_DATA) $(srcdir)/gstdarg.h $(libsubdir)/include/stdarg.h
1602         chmod a-x $(libsubdir)/include/stdarg.h
1603         -rm -f $(libsubdir)/include/stddef.h
1604         $(INSTALL_DATA) $(srcdir)/gstddef.h $(libsubdir)/include/stddef.h
1605         chmod a-x $(libsubdir)/include/stddef.h
1606 # This is turned off because fixinc.svr4 can now get it directly from srcdir.
1607 ## Copy byteorder.h into the object file directory 
1608 ## so that fixinc.svr4 can get at it if necessary.
1609 ## If the dirs are the same, this won't do anything.
1610 ## Delete file first in case it is read-only
1611 #       -if [ x`cd $(srcdir);pwd` != x`pwd` ]; then rm -f byteorder.h; else true; fi
1612 #       -cp $(srcdir)/byteorder.h . > /dev/null 2>&1
1613
1614 # $(libsubdir)/include:
1615 #       -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
1616 #       -chmod ugo+rx $(libsubdir)/include
1617
1618 # This appears not to work.  It isn't clear how to fix it.
1619 # $(libsubdir)/include/README: $(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
1620 #       LIB=$(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
1621 #       $(INSTALL_DATA) $(srcdir)/fixincludes-README $@
1622 #       chmod a-x $@
1623
1624 # Run fixincludes in the proper directory.
1625 install-fixincludes: install-headers
1626         rm -rf $(libsubdir)/tmp
1627         mkdir $(libsubdir)/tmp
1628 # Move aside the headers that come from GCC; delete all else.
1629 # The sed command gets just the last file name component;
1630 # this is necessary because VPATH could add a dirname.
1631 # Using basename would be simpler, but some systems don't have it.
1632         cd $(libsubdir)/include; \
1633         for file in $(INSTALLED_H); do \
1634           realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
1635           mv $$realfile ../tmp; \
1636         done; \
1637         rm -rf *
1638 # Install fixed copies of system files.
1639         for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
1640           if [ -d $$dir ]; \
1641           then \
1642             $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include $$dir $(srcdir); \
1643           else true; fi; \
1644         done
1645         -cd $(libsubdir)/include; \
1646         if [ -f limits.h ]; then \
1647           rm -f ../tmp/syslimits.h; \
1648           cp limits.h ../tmp/syslimits.h; \
1649         else true; fi
1650 # Bring back gcc's header files.
1651         cd $(libsubdir)/include; mv ../tmp/* .; rmdir ../tmp
1652 # Install the README
1653         $(INSTALL_DATA) $(srcdir)/README-fixinc $(libsubdir)/include/README
1654         chmod a-x $(libsubdir)/include/README
1655
1656 # Use this target to install the program `collect2' under the name `ld'.
1657 install-collect2: collect2
1658         $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
1659 # Install the driver program as $(libsubdir)/gcc for collect2.
1660         $(INSTALL_PROGRAM) xgcc $(libsubdir)/gcc
1661
1662 # Cancel installation by deleting the installed files.
1663 uninstall:
1664         -rm -rf $(libsubdir)
1665         -rm -rf $(bindir)/gcc
1666         -rm -rf $(bindir)/protoize
1667         -rm -rf $(bindir)/unprotoize
1668         -rm -rf $(mandir)/gcc$(manext)
1669         -rm -rf $(mandir)/cccp$(manext)
1670         -rm -rf $(mandir)/protoize$(manext)
1671         -rm -rf $(mandir)/unprotoize$(manext)
1672 \f
1673 # These exist for maintenance purposes.
1674
1675 # Update the tags table.
1676 TAGS: force
1677         cd $(srcdir);                                                   \
1678         mkdir temp;                                                     \
1679         mv -f c-parse.[ch] cp-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \
1680         etags *.y *.h *.c;                                              \
1681         mv temp/* .;                                                    \
1682         rmdir temp
1683
1684 # Create the distribution tar file.
1685 #dist: gcc-$(version).tar.Z
1686 dist: gcc.xtar.Z
1687
1688 gcc.xtar.Z: gcc.xtar
1689         compress < gcc.xtar > tmp-gcc.xtar.Z
1690         mv tmp-gcc.xtar.Z gcc.xtar.Z
1691
1692 #gcc-$(version).tar.Z: gcc-$(version).tar
1693 #       compress < gcc-$(version).tar > gcc-$(version).tar.Z
1694
1695 #gcc-$(version).tar:
1696 gcc.xtar: distdir
1697 # Make the distribution.
1698         tar chf gcc.xtar gcc-$(version)
1699
1700 distdir: doc $(srcdir)/INSTALL c-parse.y objc-parse.y
1701         if grep -s "for version ${version}" gcc.texi; \
1702         then true; \
1703         else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
1704         fi
1705 # Update the version number in README
1706         awk '$$1 " " $$2 " " $$3 == "This directory contains" \
1707                 { $$6 = version; print $$0 } \
1708              $$1 " " $$2 " " $$3 != "This directory contains"' \
1709           version=$(version) README > tmp.README
1710         mv tmp.README README
1711         -rm -rf gcc-$(version) tmp      
1712 # Put all the files in a temporary subdirectory
1713 # which has the name that we want to have in the tar file.
1714         mkdir tmp
1715         mkdir tmp/config
1716         mkdir tmp/objc
1717         for file in *[0-9a-zA-Z+]; do \
1718           ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
1719         done
1720         cd config; \
1721         for file in *[0-9a-zA-Z+]; do \
1722           ln $$file ../tmp/config >/dev/null 2>&1 || cp $$file ../tmp/config; \
1723         done
1724         cd objc; \
1725         for file in *[0-9a-zA-Z+]; do \
1726           ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
1727         done
1728         ln .gdbinit tmp
1729         mv tmp gcc-$(version)
1730 # Get rid of everything we don't want in the distribution.
1731         cd gcc-$(version); make -f Makefile.in extraclean
1732
1733 # do make -f ../gcc/Makefile maketest DIR=../gcc
1734 # in the intended test directory to make it a suitable test directory.
1735 # THIS IS OBSOLETE; use the -srcdir operand in configure instead. 
1736 maketest:
1737         ln -s $(DIR)/*.[chy] .
1738         ln -s $(DIR)/configure .
1739         ln -s $(DIR)/*.def .
1740         -rm -f =*
1741         ln -s $(DIR)/.gdbinit .
1742         ln -s $(DIR)/$(FIXINCLUDES) .
1743         -ln -s $(DIR)/bison.simple .
1744         ln -s $(DIR)/config .
1745         ln -s $(DIR)/move-if-change .
1746 # The then and else were swapped to avoid a problem on Ultrix.
1747         if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
1748         -rm tm.h aux-output.c config.h md
1749         make clean
1750 # You must then run config to set up for compilation.
1751
1752 bootstrap: force
1753 # Only build the C compiler for stage1, because that is the only one that
1754 # we can guarantee will build with the native compiler, and also it is the
1755 # only thing useful for building stage2.
1756         $(MAKE) LANGUAGES=c
1757         $(MAKE) stage1
1758 # This used to define ALLOCA as empty, but that would lead to bad results
1759 # for a subsequent `make install' since that would not have ALLOCA empty.
1760 # To prevent `make install' from compiling alloca.o and then relinking cc1
1761 # because alloca.o is newer, we permit these recursive makes to compile
1762 # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
1763         $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1764         $(MAKE) stage2
1765         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1766
1767 bootstrap2: force
1768         $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1769         $(MAKE) stage2
1770         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1771
1772 bootstrap3: force
1773         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1774
1775 # Compare the object files in the current directory with those in the
1776 # stage2 directory.
1777
1778 compare: force
1779         for file in *.o; do \
1780           tail +16c $$file > tmp-foo1; \
1781           tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
1782             && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
1783         done
1784         -rm -f tmp-foo*
1785
1786 # Similar, but compare with stage3 directory
1787 compare3: force
1788         for file in *.o; do \
1789           tail +16c $$file > tmp-foo1; \
1790           tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
1791             && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
1792         done
1793         -rm -f tmp-foo*
1794
1795 # Copy the object files from a particular stage into a subdirectory.
1796 stage1: force
1797         -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
1798         -mv $(STAGESTUFF) stage1
1799         -rm -f stage1/libgcc.a
1800         -cp libgcc.a stage1
1801         -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
1802
1803 stage2: force
1804         -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
1805         -mv $(STAGESTUFF) stage2
1806         -rm -f stage2/libgcc.a
1807         -cp libgcc.a stage2
1808         -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
1809
1810 stage3: force
1811         -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
1812         -mv $(STAGESTUFF) stage3
1813         -rm -f stage3/libgcc.a
1814         -cp libgcc.a stage3
1815         -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
1816
1817 stage4: force
1818         -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
1819         -mv $(STAGESTUFF) stage4
1820         -rm -f stage4/libgcc.a
1821         -cp libgcc.a stage4
1822         -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
1823
1824 # Copy just the executable files from a particular stage into a subdirectory,
1825 # and delete the object files.  Use this if you're just verifying a version
1826 # that is pretty sure to work, and you are short of disk space.
1827 risky-stage1: force
1828         -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
1829         -mv cc1 cpp cccp gcc stage1
1830         -rm -f stage1/libgcc.a
1831         -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
1832         -make clean
1833
1834 risky-stage2: force
1835         -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
1836         -mv cc1 cpp cccp gcc stage2
1837         -rm -f stage2/libgcc.a
1838         -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
1839         -make clean
1840
1841 risky-stage3: force
1842         -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
1843         -mv cc1 cpp cccp gcc stage3
1844         -rm -f stage3/libgcc.a
1845         -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
1846         -make clean
1847
1848 risky-stage4: force
1849         -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
1850         -mv cc1 cpp cccp gcc stage4
1851         -rm -f stage4/libgcc.a
1852         -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
1853         -make clean
1854
1855 #In GNU Make, ignore whether `stage*' exists.
1856 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
1857 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
1858
1859 force: