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