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