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