]>
Commit | Line | Data |
---|---|---|
32e6d418 | 1 | # Makefile for GNU C compiler. |
61aeb438 | 2 | # Copyright (C) 1987, 88, 90, 91, 92, 1993 Free Software Foundation, Inc. |
32e6d418 | 3 | |
4 | #This file is part of GNU CC. | |
5 | ||
6 | #GNU CC is free software; you can redistribute it and/or modify | |
7 | #it under the terms of the GNU General Public License as published by | |
8 | #the Free Software Foundation; either version 2, or (at your option) | |
9 | #any later version. | |
10 | ||
11 | #GNU CC is distributed in the hope that it will be useful, | |
12 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | #GNU General Public License for more details. | |
15 | ||
16 | #You should have received a copy of the GNU General Public License | |
17 | #along with GNU CC; see the file COPYING. If not, write to | |
18 | #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
20 | # The targets for external use include: | |
21 | # all, doc, proto, install, install-cross, install-cross-rest, | |
c6396a0b | 22 | # uninstall, TAGS, mostlyclean, clean, distclean, realclean, |
32e6d418 | 23 | # stage1, stage2, stage3, stage4. |
24 | ||
c6396a0b | 25 | # Suppress smart makes who think they know how to automake Yacc files |
26 | .y.c: | |
27 | ||
32e6d418 | 28 | # Variables that exist for you to override. |
29 | # See below for how to change them for certain systems. | |
30 | ||
31 | # Selection of languages to be made. | |
32 | LANGUAGES = c c++ objective-c proto | |
33 | ||
34 | ALLOCA = | |
1ab99fde | 35 | ALLOCA_FLAGS = |
94c53b91 | 36 | ALLOCA_FINISH = true |
32e6d418 | 37 | |
38 | # Various ways of specifying flags for compilations: | |
39 | # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2. | |
40 | # BOOT_CFLAGS is the value of CFLAGS to pass | |
41 | # to the stage2 and stage3 compilations | |
42 | # XCFLAGS is used for most compilations but not when using the GCC just built. | |
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 | |
3f1608f3 | 55 | BISONFLAGS = |
32e6d418 | 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 | |
bc51108a | 66 | MAKEINFO = makeinfo |
f345940f | 67 | TEXI2DVI = texi2dvi |
32e6d418 | 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 | ||
c6396a0b | 89 | # Version of ar to use when compiling libgcc1.a. |
32e6d418 | 90 | OLDAR = ar |
91 | ||
2cfd79fe | 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 | ||
b3781cc4 | 96 | # The GCC to use for compiling libgcc2.a, enquire, and cross-test. |
97 | # Usually the one we just built. | |
32e6d418 | 98 | # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS). |
79613d1b | 99 | GCC_FOR_TARGET = ./xgcc -B./ |
32e6d418 | 100 | |
101 | # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. | |
102 | # It omits XCFLAGS, and specifies -B./. | |
b3781cc4 | 103 | # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler. |
66e9b81a | 104 | GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) |
32e6d418 | 105 | |
106 | # Special flags for compiling enquire. | |
107 | # We disable optimization to make floating point more reliable. | |
f06c46e6 | 108 | ENQUIRE_CFLAGS = -DNO_MEM -DNO_STDDEF -DNO_LONG_DOUBLE_IO -O0 |
32e6d418 | 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 ] | |
32e6d418 | 120 | |
3f69fed5 | 121 | # Dir to search for system headers. Overridden by cross-make. |
122 | SYSTEM_HEADER_DIR = /usr/include | |
123 | ||
61fad423 | 124 | # Control whether to run fixproto. |
125 | STMP_FIXPROTO = stmp-fixproto | |
a5889b74 | 126 | |
8bd8ea06 | 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 | ||
32e6d418 | 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. | |
18196d1e | 137 | version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c` |
32e6d418 | 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 | |
2ffdcadf | 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'. | |
a2aa0fc1 | 147 | # NOTE: local_prefix *should not* default from prefix. |
148 | local_prefix = /usr/local | |
c6396a0b | 149 | # Directory in which to put host dependent programs and libraries |
150 | exec_prefix = $(prefix) | |
32e6d418 | 151 | # Directory in which to put the executable for the command `gcc' |
c6396a0b | 152 | bindir = $(exec_prefix)/bin |
32e6d418 | 153 | # Directory in which to put the directories used by the compiler. |
c6396a0b | 154 | libdir = $(exec_prefix)/lib |
32e6d418 | 155 | # Directory in which the compiler finds executables, libraries, etc. |
c6396a0b | 156 | libsubdir = $(libdir)/gcc-lib/$(target)/$(version) |
35df828f | 157 | # Directory to search for site-specific includes. |
9671ce48 | 158 | includedir = $(local_prefix)/include |
db9a0b19 | 159 | # assertdir is overridden in cross-make. |
9d8314a9 | 160 | # (But this currently agrees with what is in cross-make.) |
161 | assertdir = $(tooldir)/include | |
a2aa0fc1 | 162 | # where the info files go |
163 | infodir = $(prefix)/info | |
32e6d418 | 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. | |
556d8d24 | 170 | tooldir = $(exec_prefix)/$(target) |
f32abccb | 171 | # Dir for temp files. |
172 | tmpdir = /tmp | |
32e6d418 | 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 | ||
2289acd7 | 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 | ||
32e6d418 | 186 | # Specify the rule for actually making libgcc1.a. |
c6396a0b | 187 | # The value may be empty; that means to do absolutely nothing |
188 | # with or for libgcc1.a. | |
32e6d418 | 189 | LIBGCC1 = libgcc1.a |
190 | ||
b0d230b7 | 191 | # Specify the rule for making libgcc1.a for a cross-compiler. |
192 | # The default rule assumes that libgcc1.a is supplied by the user. | |
193 | CROSS_LIBGCC1 = libgcc1.cross | |
194 | ||
32e6d418 | 195 | # Specify the rule for actually making libgcc2.a. |
196 | LIBGCC2 = libgcc2.a | |
197 | ||
198 | # Options to use when compiling libgcc2.a. | |
199 | # -g1 causes output of debug info only for file-scope entities. | |
200 | # we use this here because that should be enough, and also | |
201 | # so that -g1 will be tested. | |
690a93ea | 202 | LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -g1 |
203 | ||
204 | # Additional options to use when compiling libgcc2.a. | |
205 | # Some targets override this to -Iinclude | |
206 | LIBGCC2_INCLUDES = | |
207 | ||
208 | # Things which must be built before building libgcc2.a. | |
209 | # Some targets override this to stmp-int-hdrs | |
210 | LIBGCC2_DEPS = | |
32e6d418 | 211 | |
17886975 | 212 | # Enquire target (This is a variable so that a target can choose not to |
213 | # build it.) | |
214 | ENQUIRE = enquire | |
215 | ||
216 | # Cross-test target (must also be overridable for a target) | |
217 | CROSS_TEST = cross-test | |
218 | ||
32e6d418 | 219 | # List of extra executables that should be compiled for this target machine |
220 | # that are used for compiling from source code to object code. | |
221 | # The rules for compiling them should be in the t-* file for the machine. | |
222 | EXTRA_PASSES = | |
223 | ||
c6396a0b | 224 | # Like EXTRA_PASSES, but these are used when linking. |
225 | EXTRA_PROGRAMS = | |
226 | ||
227 | # List of extra object files that should be compiled for this target machine. | |
32e6d418 | 228 | # The rules for compiling them should be in the t-* file for the machine. |
229 | EXTRA_PARTS = | |
230 | ||
c6396a0b | 231 | # List of extra object files that should be compiled and linked with |
232 | # compiler proper (cc1, cc1obj, cc1plus). | |
233 | EXTRA_OBJS = | |
234 | ||
630c76ba | 235 | # List of additional header files to install. |
236 | # Often this is edited directly by `configure'. | |
237 | EXTRA_HEADERS = | |
238 | ||
79f818d0 | 239 | # Set this to `ld' to enable use of collect2. |
240 | # USE_COLLECT2 = | |
241 | # It is convenient for configure to add the assignment at the beginning, | |
242 | # so don't override it here. | |
243 | ||
32e6d418 | 244 | # List of extra C and assembler files to add to libgcc1.a. |
245 | # Assembler files should have names ending in `.asm'. | |
246 | LIB1FUNCS_EXTRA = | |
247 | ||
248 | # List of extra C and assembler files to add to libgcc2.a. | |
249 | # Assembler files should have names ending in `.asm'. | |
250 | LIB2FUNCS_EXTRA = | |
251 | ||
2cfd79fe | 252 | # Default float.h source to use for cross-compiler. |
253 | CROSS_FLOAT_H=float.h-cross | |
254 | ||
32e6d418 | 255 | # Program to convert libraries. |
256 | LIBCONVERT = | |
257 | ||
258 | # Control whether header files are installed. | |
32e6d418 | 259 | INSTALL_HEADERS=install-headers |
260 | ||
ed2f1f67 | 261 | # Options for tar when copying trees. So HPUX can override it. |
262 | TAROUTOPTS = xpBf | |
263 | ||
32e6d418 | 264 | # Select which version of fixincludes to use (I.E. regular versus SVR4) |
6848a9c6 | 265 | # This value is overridden directly by configure. |
32e6d418 | 266 | FIXINCLUDES=fixincludes |
267 | ||
106a27e5 | 268 | # Additional directories of header files to run fixincludes on. |
af731fc2 | 269 | # These should be directories searched automatically by default |
270 | # just as /usr/include is. | |
271 | # *Do not* use this for directories that happen to contain | |
272 | # header files, but are not searched automatically by default. | |
106a27e5 | 273 | # On most systems, this is empty. |
274 | OTHER_FIXINCLUDES_DIRS= | |
275 | ||
77a164d8 | 276 | # List of things which should already be built whenever we try to use xgcc |
32e6d418 | 277 | # to compile anything (without linking). |
77a164d8 | 278 | GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES) |
32e6d418 | 279 | |
77a164d8 | 280 | # List of things which should already be built whenever we try to use xgcc |
32e6d418 | 281 | # to link anything. |
2289acd7 | 282 | GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS) |
32e6d418 | 283 | |
32e6d418 | 284 | # Directory to link to, when using the target `maketest'. |
285 | DIR = ../gcc | |
286 | ||
89e36a04 | 287 | # Guaranteed to not exist when not passing md through cpp. |
288 | MD_FILE = md-cpp-not-used | |
289 | ||
32e6d418 | 290 | # Flags to use when cross-building GCC. |
291 | # Prefix to apply to names of object files when using them | |
292 | # to run on the machine we are compiling on. | |
293 | HOST_PREFIX= | |
294 | # Prefix to apply to names of object files when compiling them | |
295 | # to run on the machine we are compiling on. | |
296 | # The default for this variable is chosen to keep these rules | |
297 | # out of the way of the other rules for compiling the same source files. | |
298 | HOST_PREFIX_1=loser- | |
299 | HOST_CC=$(CC) | |
300 | HOST_CFLAGS=$(ALL_CFLAGS) | |
c6396a0b | 301 | HOST_CLIB=$(CLIB) |
32e6d418 | 302 | HOST_LDFLAGS=$(LDFLAGS) |
303 | HOST_CPPFLAGS=$(ALL_CPPFLAGS) | |
c6396a0b | 304 | HOST_ALLOCA=$(ALLOCA) |
305 | HOST_MALLOC=$(MALLOC) | |
306 | HOST_OBSTACK=$(OBSTACK) | |
32e6d418 | 307 | |
308 | # Choose the real default target. | |
309 | ALL=all.internal | |
310 | ||
311 | # Choose the real install target. | |
2cfd79fe | 312 | INSTALL_TARGET=install-normal |
313 | ||
314 | # Source for float.h. Overridden by cross-make. | |
315 | FLOAT_H=float.h-nat | |
32e6d418 | 316 | |
317 | # End of variables for you to override. | |
318 | ||
319 | # Definition of `all' is here so that new rules inserted by sed | |
320 | # do not specify the default target. | |
321 | # The real definition is under `all.internal' (for native compilers) | |
322 | # or `all.cross' (for cross compilers). | |
c6396a0b | 323 | all: all.indirect |
32e6d418 | 324 | |
131b361e | 325 | # This tells GNU Make version 3 not to put all variables in the environment. |
326 | .NOEXPORT: | |
327 | ||
32e6d418 | 328 | # sed inserts variable overrides after the following line. |
a0a99f10 | 329 | ####target overrides |
330 | ####host overrides | |
331 | ####cross overrides | |
e77fd588 | 332 | ####build overrides |
32e6d418 | 333 | \f |
334 | # Now figure out from those variables how to compile and link. | |
335 | ||
c6396a0b | 336 | all.indirect: $(ALL) |
337 | ||
34b1478f | 338 | # IN_GCC tells obstack.h to use gstddef.h. |
339 | INTERNAL_CFLAGS = $(CROSS) -DIN_GCC | |
32e6d418 | 340 | |
341 | # This is the variable actually used when we compile. | |
342 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) | |
343 | ||
344 | # Likewise. | |
345 | ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) | |
346 | ||
347 | # Even if ALLOCA is set, don't use it if compiling with GCC. | |
c6396a0b | 348 | USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac ` |
349 | USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac ` | |
350 | USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac ` | |
351 | USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac ` | |
32e6d418 | 352 | |
353 | # Dependency on obstack, alloca, malloc or whatever library facilities | |
354 | # are not installed in the system libraries. | |
355 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
356 | LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) | |
357 | ||
358 | # Likewise, for use in the tools that must run on this machine | |
359 | # even if we are cross-building GCC. | |
360 | # We don't use USE_ALLOCA because backquote expansion doesn't work in deps. | |
c6396a0b | 361 | HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) |
32e6d418 | 362 | |
363 | # How to link with both our special library facilities | |
364 | # and the system's installed libraries. | |
365 | LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB) | |
366 | ||
367 | # Likewise, for use in the tools that must run on this machine | |
368 | # even if we are cross-building GCC. | |
c6396a0b | 369 | HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \ |
370 | $(HOST_CLIB) | |
32e6d418 | 371 | |
372 | HOST_RTL = $(HOST_PREFIX)rtl.o | |
373 | HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o | |
262d46de | 374 | HOST_PRINT = $(HOST_PREFIX)print-rtl.o |
32e6d418 | 375 | |
376 | # Specify the directories to be searched for header files. | |
377 | # Both . and srcdir are used, in that order, | |
378 | # so that tm.h and config.h will be found in the compilation | |
379 | # subdirectory rather than in the source directory. | |
380 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config | |
381 | SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config | |
382 | ||
383 | # Always use -I$(srcdir)/config when compiling. | |
384 | .c.o: | |
385 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< | |
386 | ||
387 | # This tells GNU make version 3 not to export all the variables | |
388 | # defined in this file into the environment. | |
389 | .NOEXPORT: | |
390 | \f | |
391 | # Lists of files for various purposes. | |
392 | ||
393 | # A list of all the language-specific executables. | |
394 | COMPILERS = cc1 cc1plus cc1obj | |
395 | ||
396 | # Language-specific object files for C. | |
1294913b | 397 | C_OBJS = c-parse.o c-lang.o c-lex.o c-pragma.o \ |
398 | c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o | |
32e6d418 | 399 | |
8dff2b2b | 400 | # Language-specific object files for Objective C. |
1294913b | 401 | OBJC_OBJS = objc-parse.o objc-act.o c-lex.o c-pragma.o \ |
402 | c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o | |
32e6d418 | 403 | |
404 | # Language-specific object files for C++. | |
405 | CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \ | |
406 | cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \ | |
407 | cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \ | |
408 | cp-class.o cp-init.o cp-method.o cp-except.o \ | |
409 | cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \ | |
8aa987be | 410 | $(CPLUS_INPUT) cp-spew.o c-common.o cp-error.o cp-errfn.o |
32e6d418 | 411 | |
649d8da6 | 412 | # Files specific to the C interpreter bytecode compiler(s). |
413 | BC_OBJS = bc-emit.o bc-optab.o | |
414 | ||
32e6d418 | 415 | # Language-independent object files. |
416 | OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \ | |
417 | function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \ | |
6d9f2c4c | 418 | rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \ |
79f818d0 | 419 | dbxout.o sdbout.o dwarfout.o xcoffout.o \ |
32e6d418 | 420 | integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \ |
8a4b1e01 | 421 | regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \ |
32e6d418 | 422 | insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \ |
bdb66cef | 423 | insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \ |
de6985af | 424 | insn-attrtab.o aux-output.o getpwd.o convert.o $(EXTRA_OBJS) |
32e6d418 | 425 | |
426 | # GEN files are listed separately, so they can be built before doing parallel | |
427 | # makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load | |
428 | # them before rtl.o is compiled. | |
429 | GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep | |
430 | ||
431 | # Files to be copied away after each stage in building. | |
432 | STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \ | |
433 | insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ | |
d95fa18c | 434 | insn-attr.h insn-attrtab.c insn-opinit.c \ |
32e6d418 | 435 | stamp-flags stamp-config stamp-codes \ |
436 | stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \ | |
d95fa18c | 437 | stamp-attr stamp-attrtab stamp-opinit stamp-proto \ |
32e6d418 | 438 | genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \ |
d95fa18c | 439 | genattrtab genattr genopinit \ |
8bb62f3d | 440 | bc-arity.h bc-opcode.h bc-opname.h \ |
441 | stamp-bcarity stamp-bcopcode stamp-bcopname \ | |
442 | bi-arity bi-opcode bi-opname \ | |
22a266b1 | 443 | $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp g++ g++-cross \ |
0b20f012 | 444 | cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2) |
32e6d418 | 445 | |
446 | # Members of libgcc1.a. | |
447 | LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \ | |
448 | _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \ | |
449 | _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \ | |
450 | _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \ | |
451 | _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \ | |
452 | _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \ | |
453 | _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2 | |
454 | ||
455 | # Library members defined in libgcc2.c. | |
456 | LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ | |
dc1db499 | 457 | _lshrdi3 _lshldi3 _ashldi3 _ashrdi3 _ffsdi2 \ |
4b8f50a8 | 458 | _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ |
32e6d418 | 459 | _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ |
619c3e71 | 460 | _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ |
d055d75f | 461 | _fixtfdi _fixunstfdi _floatditf \ |
03ae18f4 | 462 | __gcc_bcmp _varargs _eprintf _op_new _new_handler _op_delete \ |
c59af377 | 463 | _bb _shtab _clear_cache _trampoline __main _exit _ctors |
32e6d418 | 464 | |
465 | # Header files that are made available under the same name | |
77a164d8 | 466 | # to programs compiled with GCC. |
ce443618 | 467 | USER_H = va-alpha.h va-h8300.h va-i860.h va-i960.h va-mips.h va-m88k.h \ |
131bde04 | 468 | va-pa.h va-pyr.h va-sparc.h va-clipper.h va-spur.h proto.h $(EXTRA_HEADERS) |
32e6d418 | 469 | |
32e6d418 | 470 | # The files that "belong" in CONFIG_H are deliberately omitted |
471 | # because having them there would not be useful in actual practice. | |
472 | # All they would do is cause complete recompilation every time | |
473 | # one of the machine description files is edited. | |
474 | # That may or may not be what one wants to do. | |
475 | # If it is, rm *.o is an easy way to do it. | |
476 | # CONFIG_H = config.h tm.h | |
477 | CONFIG_H = | |
478 | RTL_H = rtl.h rtl.def machmode.h machmode.def | |
479 | TREE_H = tree.h real.h tree.def machmode.h machmode.def | |
480 | CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def | |
649d8da6 | 481 | BYTECODE_H = bytecode.h bc-emit.h bc-optab.h |
32e6d418 | 482 | \f |
483 | # Avoid a lot of time thinking about remaking Makefile.in and *.def. | |
484 | .SUFFIXES: .in .def | |
485 | ||
79f818d0 | 486 | Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \ |
32e6d418 | 487 | $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) |
488 | sh config.status | |
489 | ||
490 | all.internal: start.encap rest.encap | |
491 | # This is what to compile if making a cross-compiler. | |
87540b0a | 492 | # Note that we can compile enquire using the cross-compiler just build, |
493 | # although we can't run it on this machine. | |
17886975 | 494 | all.cross: native gcc-cross g++-cross specs $(LIBGCC) stmp-headers $(STMP_FIXPROTO) $(CROSS_TEST) $(ENQUIRE) $(EXTRA_PARTS) |
e77fd588 | 495 | # This is what to compile if making gcc with a cross-compiler. |
22a266b1 | 496 | all.build: native xgcc g++ $(EXTRA_PARTS) |
32e6d418 | 497 | # This is what must be made before installing GCC and converting libraries. |
04f62f77 | 498 | start.encap: native xgcc g++ specs $(LIBGCC1) xlimits.h |
32e6d418 | 499 | # Use this to make a GCC that will be used only to recompile GCC. |
2289acd7 | 500 | for-bootstrap: start.encap $(LIBGCC) |
32e6d418 | 501 | # These can't be made, with COFF encapsulation, until after GCC can run. |
a5889b74 | 502 | rest.encap: $(LIBGCC) stmp-headers $(STMP_FIXPROTO) $(EXTRA_PARTS) |
32e6d418 | 503 | # This is what is made with the host's compiler |
504 | # whether making a cross compiler or not. | |
852e59cd | 505 | native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) |
32e6d418 | 506 | |
507 | # Define the names for selecting languages in LANGUAGES. | |
047c2b8b | 508 | # Note that it would be nice to move the dependency on g++ |
509 | # into the C++ rule, but that needs a little bit of work | |
510 | # to do the right thing within all.cross. | |
32e6d418 | 511 | C c: cc1 |
512 | C++ c++: cc1plus | |
ed2f1f67 | 513 | # The next two ought to depend on objc-runtime, but that doesn't work yet. |
514 | OBJC objc: cc1obj | |
515 | OBJECTIVE-C objective-c: cc1obj | |
32e6d418 | 516 | PROTO: proto |
517 | ||
c6396a0b | 518 | # Really, really stupid make features, such as SUN's KEEP_STATE, may force |
519 | # a target to build even if it is up-to-date. So we must verify that | |
520 | # config.status does not exist before failing. | |
32e6d418 | 521 | config.status: |
c6396a0b | 522 | @if [ ! -f config.status ] ; then \ |
523 | echo You must configure gcc. Look at the INSTALL file for details.; \ | |
524 | false; \ | |
525 | else \ | |
526 | true; \ | |
527 | fi | |
32e6d418 | 528 | |
840a6e8d | 529 | # On the target machine, finish building a cross compiler. |
530 | # This does the things that can't be done on the host machine. | |
2289acd7 | 531 | rest.cross: $(LIBGCC) gfloat.h specs |
840a6e8d | 532 | |
d7330690 | 533 | # Verify that it works to compile and link cross-test. |
534 | # If it does, then there are sufficient replacements for libgcc1.a. | |
2289acd7 | 535 | cross-test: cross-test.o native gcc-cross $(LIBGCC) $(GCC_PARTS) |
d7330690 | 536 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@ |
537 | cross-test.o: cross-test.c native gcc-cross | |
538 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c | |
539 | ||
840a6e8d | 540 | # Recompile all the language-independent object files. |
541 | # This is used only if the user explicitly asks for it. | |
32e6d418 | 542 | compilations: ${OBJS} |
543 | ||
77a164d8 | 544 | # We call this executable `xgcc' rather than `gcc' |
545 | # to avoid confusion if the current directory is in the path | |
546 | # and CC is `gcc'. It is renamed to `gcc' when it is installed. | |
547 | xgcc: gcc.o version.o $(LIBDEPS) | |
548 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgcc gcc.o version.o $(LIBS) | |
840a6e8d | 549 | |
550 | # Dump a specs file to make -B./ read these specs over installed ones. | |
77a164d8 | 551 | specs: xgcc |
c666179a | 552 | $(GCC_FOR_TARGET) -dumpspecs > specs |
32e6d418 | 553 | |
22a266b1 | 554 | # Create the compiler driver for g++. |
555 | g++: g++.o $(LIBDEPS) | |
556 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o g++ g++.o $(LIBS) | |
557 | ||
77a164d8 | 558 | # We do want to create an executable named `xgcc', so we can use it to |
32e6d418 | 559 | # compile libgcc2.a. |
560 | # Also create gcc-cross, so that install-common will install properly. | |
77a164d8 | 561 | gcc-cross: xgcc |
562 | cp xgcc gcc-cross | |
32e6d418 | 563 | |
22a266b1 | 564 | # Create a version of the g++ driver which calls the cross-compiler. |
565 | g++-cross: $(srcdir)/g++.c | |
566 | $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o g++-cross \ | |
567 | -DGCC_NAME=\"$(target)-gcc\" $(srcdir)/g++.c version.o $(LIBS) | |
568 | ||
675fc1b6 | 569 | cc1: $(P) $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS) |
649d8da6 | 570 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBS) |
32e6d418 | 571 | |
675fc1b6 | 572 | cc1plus: $(P) $(CPLUS_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS) |
649d8da6 | 573 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(BC_OBJS) $(OBJS) $(LIBS) |
32e6d418 | 574 | |
675fc1b6 | 575 | cc1obj: $(P) $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS) |
649d8da6 | 576 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBS) |
32e6d418 | 577 | |
2cfd79fe | 578 | # Copy float.h from its source. |
d82b9c93 | 579 | gfloat.h: $(FLOAT_H) |
580 | cp $(FLOAT_H) gfloat.h | |
2cfd79fe | 581 | |
582 | # Create float.h source for the native machine. | |
583 | float.h-nat: enquire | |
121c5e86 | 584 | -./enquire -f > tmp-float.h |
585 | mv tmp-float.h float.h-nat | |
2cfd79fe | 586 | |
587 | # Create a dummy float.h source for a cross-compiler. | |
588 | float.h-cross: | |
589 | echo "#error float.h values not known for cross-compiler" > float.h-cross | |
32e6d418 | 590 | |
591 | # Used to compile enquire with standard cc, but have forgotten why. | |
592 | # Let's try with GCC. | |
593 | enquire: enquire.o $(GCC_PARTS) | |
594 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@ | |
595 | enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) | |
1a754c64 | 596 | # -if [ "$(srcdir)" != "." ]; then rm -f ./enquire.c; else true; fi |
597 | # -cp $(srcdir)/enquire.c . > /dev/null 2>&1 | |
c6396a0b | 598 | # Breaking this line caused a problem with one version of GNU make. |
1a754c64 | 599 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c |
3f69fed5 | 600 | |
601 | # Build the version of limits.h that we will install. | |
602 | xlimits.h: glimits.h limitx.h limity.h | |
603 | if [ -f $(SYSTEM_HEADER_DIR)/limits.h ] ; then \ | |
604 | cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > xlimits.h; \ | |
605 | else \ | |
606 | cat $(srcdir)/glimits.h > xlimits.h; \ | |
607 | fi | |
32e6d418 | 608 | \f |
609 | # Build libgcc.a. | |
610 | # This is done in two parts because some functions, in libgcc1.c, | |
77a164d8 | 611 | # must be compiled with something other than GCC, |
612 | # while the rest, in libgcc2.c, must be compiled with xgcc. | |
613 | # That means we can't do libgcc2.c until after xgcc, cc1, etc. | |
32e6d418 | 614 | |
615 | # Use this as value of LIBGCC1 to cause conversion to GNU library format. | |
616 | # LIBCONVERT should put its output in libgcc1.conv. | |
617 | libgcc1.conv: libgcc1.a | |
618 | $(LIBCONVERT) libgcc1.a libgcc1.conv | |
619 | ||
620 | # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely. | |
621 | # Make an empty file instead. | |
66e9b81a | 622 | libgcc1.null: $(GCC_PASSES) |
32e6d418 | 623 | echo "__foo () {}" > dummy.c |
624 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c | |
625 | $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o | |
626 | rm -f dummy.o dummy.c | |
627 | ||
fe918d35 | 628 | # This is $(LIBGCC1) for a cross-compiler. |
629 | # We have no automatic way of building libgcc1.a, | |
630 | # so it's up to the installer to find a way to do that. | |
631 | # This rule deliberately does not depend on libgcc1.a | |
632 | # so that it will fail if the installer hasn't provided it. | |
633 | libgcc1.cross: | |
634 | mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false) | |
635 | ||
32e6d418 | 636 | # Compile the library of arithmetic subroutines with the native compiler. |
77a164d8 | 637 | # Don't compile it with GCC! |
32e6d418 | 638 | # (That would cause most arithmetic functions to call themselves.) |
639 | libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status | |
640 | -rm -f tmplibgcc1.a | |
641 | # Actually build it in tmplibgcc1.a, then rename at end, | |
642 | # so that libgcc1.a itself remains nonexistent if compilation is aborted. | |
643 | # -e causes any failing command to make this rule fail. | |
644 | # -e doesn't work in certain shells, so we test $$? as well. | |
547e1b60 | 645 | # lynx has a broken ar, it always complains when the initial library is |
646 | # empty, thus this command works only if we don't do -e | |
647 | # There is a trailing backslash (\) deleted from the following line. | |
648 | # set -e; | |
32e6d418 | 649 | for name in $(LIB1FUNCS); \ |
650 | do \ | |
651 | echo $${name}; \ | |
652 | rm -f $${name}.o; \ | |
653 | $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \ | |
654 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
655 | mv libgcc1.o $${name}.o; \ | |
656 | $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \ | |
657 | rm -f $${name}.o; \ | |
658 | done | |
659 | # Some shells crash when a loop has no items. | |
660 | # So make sure there is always at least one--`..'. | |
661 | # Then ignore it. | |
662 | # We don't use -e here because there are if statements | |
663 | # that should not make the command give up when the if condition is false. | |
664 | # Instead, we test for failure after each command where it matters. | |
c6396a0b | 665 | -for file in .. $(LIB1FUNCS_EXTRA); \ |
32e6d418 | 666 | do \ |
667 | if [ x$${file} != x.. ]; then \ | |
668 | name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \ | |
669 | echo $${name}; \ | |
670 | if [ $${name}.asm = $${file} ]; then \ | |
f32abccb | 671 | cp $${file} $${name}.s || exit 1; file=$${name}.s; \ |
32e6d418 | 672 | else true; fi; \ |
673 | $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \ | |
674 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
675 | $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \ | |
676 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
677 | rm -f $${name}.[so]; \ | |
678 | else true; \ | |
679 | fi; \ | |
680 | done | |
681 | mv tmplibgcc1.a libgcc1.a | |
682 | ||
683 | # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled. | |
684 | # But recompiling cc1 should not force recompilation of libgcc2.a. | |
685 | # If you want to force recompilation, delete libgcc2.a. | |
690a93ea | 686 | libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) |
32e6d418 | 687 | -if [ -f libgcc2.ready ] ; then \ |
688 | true; \ | |
689 | else \ | |
690 | touch libgcc2.ready; \ | |
691 | fi | |
692 | ||
693 | libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \ | |
33927595 | 694 | machmode.h longlong.h gbl-ctors.h config.status |
32e6d418 | 695 | # Actually build it in tmplibgcc2.a, then rename at end, |
696 | # so that libgcc2.a itself remains nonexistent if compilation is aborted. | |
697 | -rm -f tmplibgcc2.a | |
698 | # -e causes any failing command to make this rule fail. | |
699 | # -e doesn't work in certain shells, so we test $$? as well. | |
547e1b60 | 700 | # lynx has a broken ar, it always complains when the initial library is |
701 | # empty, thus this command works only if we don't do -e | |
702 | # There is a trailing backslash (\) deleted from the following line. | |
703 | # set -e; | |
32e6d418 | 704 | for name in $(LIB2FUNCS); \ |
705 | do \ | |
706 | echo $${name}; \ | |
c6396a0b | 707 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ |
32e6d418 | 708 | $(srcdir)/libgcc2.c -o $${name}.o; \ |
709 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
710 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \ | |
711 | rm -f $${name}.o; \ | |
712 | done | |
713 | # Some shells crash when a loop has no items. | |
714 | # So make sure there is always at least one--`..'. | |
715 | # Then ignore it. | |
716 | # We don't use -e here because there are if statements | |
717 | # that should not make the command give up when the if condition is false. | |
718 | # Instead, we test for failure after each command where it matters. | |
c6396a0b | 719 | -for file in .. $(LIB2FUNCS_EXTRA); \ |
32e6d418 | 720 | do \ |
721 | if [ x$${file} != x.. ]; then \ | |
722 | name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \ | |
723 | echo $${name}; \ | |
724 | if [ $${name}.asm = $${file} ]; then \ | |
f32abccb | 725 | cp $${file} $${name}.s || exit 1; file=$${name}.s; \ |
32e6d418 | 726 | else true; fi; \ |
c6396a0b | 727 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \ |
32e6d418 | 728 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ |
729 | $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \ | |
730 | rm -f $${name}.[so]; \ | |
731 | else true; \ | |
732 | fi; \ | |
733 | done | |
734 | mv tmplibgcc2.a libgcc2.a | |
735 | # These lines were deleted from above the mv command | |
736 | # because ranlibing libgcc.a itself should suffice. | |
737 | # -if [ x${HPUX_GAS} = x ] ; then \ | |
738 | # if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \ | |
739 | # else true; fi | |
740 | ||
741 | # Combine the various libraries into a single library, libgcc.a. | |
742 | libgcc.a: $(LIBGCC1) $(LIBGCC2) | |
743 | -rm -rf tmplibgcc.a libgcc.a tmpcopy | |
744 | mkdir tmpcopy | |
c6396a0b | 745 | -if [ x$(LIBGCC1) != x ]; \ |
746 | then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \ | |
747 | else true; \ | |
748 | fi | |
edf5976e | 749 | # Some versions of ar (specifically the one in RISC/os 5.x), create an |
750 | # unwritable table of contents file, and then print an error message when | |
751 | # the second ar command tries to overwrite this file. To avoid the error | |
752 | # message from ar, we make sure all files are writable. | |
753 | (cd tmpcopy; chmod +w * > /dev/null 2>&1) | |
32e6d418 | 754 | (cd tmpcopy; $(AR) x ../$(LIBGCC2)) |
755 | (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o) | |
756 | rm -rf tmpcopy | |
757 | -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi | |
758 | # Actually build it in tmplibgcc.a, then rename at end, | |
759 | # so that libgcc.a itself remains nonexistent if compilation is aborted. | |
760 | mv tmplibgcc.a libgcc.a | |
761 | ||
4f1fd857 | 762 | objc-runtime: libobjc.a |
763 | ||
bd594491 | 764 | # Build the Objective C runtime library. |
58df976d | 765 | libobjc.a: cc1obj libgcc2.ready $(USE_COLLECT2) $(EXTRA_PARTS) |
d6518ea8 | 766 | if [ -d objc ]; then true; else mkdir objc; fi |
4f1fd857 | 767 | thisdir1=`pwd`; \ |
e5190fd1 | 768 | srcdir1=`cd $(srcdir); pwd`; \ |
4f1fd857 | 769 | cd objc; \ |
72bce1c3 | 770 | $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \ |
771 | srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \ | |
772 | GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \ | |
4f1fd857 | 773 | GCC_CFLAGS="$(GCC_CFLAGS)" |
553479e8 | 774 | -rm -f libobjc.a |
8281617f | 775 | ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a . |
4f1fd857 | 776 | -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi |
777 | ||
778 | # This is used by objc/Makefile if the user runs that directly. | |
779 | sublibobjc.a: cc1obj libgcc2.ready | |
e5190fd1 | 780 | thisdir1=`pwd`; \ |
781 | srcdir1=`cd $(srcdir); pwd`; \ | |
782 | cd objc; \ | |
553479e8 | 783 | $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \ |
e5190fd1 | 784 | srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \ |
785 | GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \ | |
786 | GCC_CFLAGS="$(GCC_CFLAGS)" | |
32e6d418 | 787 | |
788 | # Compile two additional files that are linked with every program | |
789 | # linked using GCC on system V, for the sake of C++ constructors. | |
790 | crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h | |
791 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \ | |
7bb7a2e8 | 792 | -finhibit-size-directive -fno-inline-functions \ |
793 | -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o | |
32e6d418 | 794 | |
795 | crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h | |
796 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \ | |
7bb7a2e8 | 797 | -finhibit-size-directive -fno-inline-functions \ |
798 | -g0 -c $(srcdir)/crtstuff.c -o crtend.o | |
32e6d418 | 799 | \f |
800 | # Compiling object files from source files. | |
801 | ||
802 | # Note that dependencies on obstack.h are not written | |
803 | # because that file is not part of GCC. | |
804 | # Dependencies on gvarargs.h are not written | |
805 | # because all that file does, when not compiling with GCC, | |
806 | # is include the system varargs.h. | |
807 | ||
808 | # C language specific files. | |
809 | ||
f678532a | 810 | c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \ |
811 | c-tree.h input.h flags.h | |
32e6d418 | 812 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c |
ab2562cb | 813 | $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y |
814 | cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c | |
d7c691fa | 815 | $(srcdir)/c-parse.y: $(srcdir)/c-parse.in |
816 | sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \ | |
817 | -e "/^ifc$$/d" -e "/^end ifc$$/d" \ | |
818 | $(srcdir)/c-parse.in > $(srcdir)/c-parse.y | |
819 | ||
32e6d418 | 820 | c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h |
821 | c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h | |
822 | c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H) | |
823 | c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \ | |
824 | input.h flags.h | |
825 | c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h | |
826 | c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h | |
b3781cc4 | 827 | c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H) |
1294913b | 828 | c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h |
32e6d418 | 829 | |
830 | # C++ language specific files. | |
831 | ||
2ee73e3e | 832 | cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h cp-lex.h |
32e6d418 | 833 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
834 | `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'` | |
835 | ||
836 | $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y | |
a51a07fd | 837 | @echo expect 29 shift/reduce conflicts and 13 reduce/reduce conflicts |
32e6d418 | 838 | cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y |
fe918d35 | 839 | cd $(srcdir); grep '^#define[ ]*YYEMPTY' cp-parse.c >>cp-parse.h |
32e6d418 | 840 | |
841 | cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \ | |
2ee73e3e | 842 | $(srcdir)/cp-parse.h flags.h cp-lex.h |
32e6d418 | 843 | cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \ |
2ee73e3e | 844 | $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h cp-hash.h cp-lex.h |
32e6d418 | 845 | cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \ |
846 | cp-lex.h cp-decl.h stack.h | |
847 | cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \ | |
848 | cp-lex.h cp-decl.h | |
849 | cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
2ee73e3e | 850 | cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H) |
851 | cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
852 | cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
853 | cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H) | |
32e6d418 | 854 | cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H) |
855 | cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H) | |
856 | cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h | |
857 | cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
858 | cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H) | |
859 | cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
2ee73e3e | 860 | cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H) |
32e6d418 | 861 | cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \ |
862 | expr.h insn-codes.h | |
863 | cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h | |
2ee73e3e | 864 | cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H) input.h |
32e6d418 | 865 | cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h |
2c560fb4 | 866 | cp-error.o : cp-error.c $(CONFIG_H) $(CPLUS_TREE_H) |
867 | cp-errfn.o : cp-errfn.c $(CONFIG_H) $(CPLUS_TREE_H) | |
32e6d418 | 868 | |
047c2b8b | 869 | g++.o : g++.c $(CONFIG_H) gvarargs.h |
870 | ||
79f818d0 | 871 | # To make a configuration always use collect2, set USE_COLLECT2 to ld. |
872 | ld: collect2 | |
873 | rm -f ld | |
874 | ln collect2 ld | |
875 | ||
32e6d418 | 876 | collect2 : collect2.o version.o $(LIBDEPS) |
e77fd588 | 877 | # Don't try modifying collect2 (aka ld) in place--it might be linking this. |
878 | -rm -f collect2 | |
32e6d418 | 879 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS) |
880 | ||
881 | collect2.o : collect2.c $(CONFIG_H) gstab.h | |
5e03c63d | 882 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
883 | -DTARGET_MACHINE=\"$(target)\" \ | |
884 | -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'` | |
32e6d418 | 885 | |
8dff2b2b | 886 | # Objective C language specific files. |
32e6d418 | 887 | |
888 | objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \ | |
222e139b | 889 | c-tree.h input.h flags.h objc-act.h |
32e6d418 | 890 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c |
891 | $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y | |
892 | cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c | |
ab2562cb | 893 | $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in |
894 | sed -e "/^ifc$$/,/^end ifc$$/d" \ | |
895 | -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \ | |
896 | $(srcdir)/c-parse.in > $(srcdir)/objc-parse.y | |
32e6d418 | 897 | |
7c4f0e88 | 898 | objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \ |
899 | flags.h objc-act.h input.h function.h $(srcdir)/c-parse.h | |
32e6d418 | 900 | |
901 | # A file used by all variants of C. | |
902 | ||
903 | c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h | |
904 | ||
905 | # Language-independent files. | |
906 | ||
1294913b | 907 | gcc.o: gcc.c $(CONFIG_H) gvarargs.h config.status |
32e6d418 | 908 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
909 | -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \ | |
c6396a0b | 910 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \ |
32e6d418 | 911 | -DDEFAULT_TARGET_MACHINE=\"$(target)\" \ |
556d8d24 | 912 | -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \ |
ae0fea3a | 913 | -DTOOLDIR=\"$(tooldir)/\" \ |
8618ef50 | 914 | $(MAYBE_TARGET_DEFAULT) \ |
32e6d418 | 915 | -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` |
916 | ||
917 | dumpvers: dumpvers.c | |
918 | ||
919 | version.o: version.c | |
920 | obstack.o: obstack.c | |
921 | ||
beb68ac1 | 922 | convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h |
923 | ||
32e6d418 | 924 | tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h |
925 | print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H) | |
926 | stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h | |
927 | fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h | |
c6396a0b | 928 | toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \ |
aadb7c33 | 929 | insn-attr.h xcoffout.h defaults.h |
79f818d0 | 930 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
fe918d35 | 931 | $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \ |
932 | -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'` | |
32e6d418 | 933 | |
934 | rtl.o : rtl.c $(CONFIG_H) $(RTL_H) | |
935 | ||
936 | print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H) | |
937 | rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H) | |
938 | ||
832bfff4 | 939 | toplev.o: bytecode.h bc-emit.h |
35325097 | 940 | varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \ |
832bfff4 | 941 | defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h bytecode.h |
32e6d418 | 942 | function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
943 | insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \ | |
832bfff4 | 944 | recog.h output.h bytecode.h |
32e6d418 | 945 | stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
da98194a | 946 | insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h \ |
e83ee760 | 947 | recog.h bytecode.h bc-typecd.h bc-typecd.def bc-opcode.h bc-optab.h \ |
948 | bc-emit.h | |
d077a015 | 949 | expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \ |
e83ee760 | 950 | insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h \ |
951 | typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \ | |
952 | bc-emit.h modemap.def | |
32e6d418 | 953 | calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \ |
d077a015 | 954 | insn-flags.h gvarargs.h |
32e6d418 | 955 | expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ |
956 | insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h | |
957 | explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \ | |
958 | insn-config.h expr.h recog.h insn-flags.h insn-codes.h | |
959 | optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ | |
a8a33ff5 | 960 | insn-flags.h insn-config.h insn-codes.h expr.h recog.h reload.h |
32e6d418 | 961 | dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \ |
e7748130 | 962 | insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h |
32e6d418 | 963 | sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \ |
964 | insn-config.h reload.h | |
965 | dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \ | |
8a19d0d5 | 966 | insn-config.h reload.h output.h defaults.h |
79f818d0 | 967 | xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h |
32e6d418 | 968 | emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h \ |
832bfff4 | 969 | regs.h insn-config.h insn-codes.h real.h expr.h bytecode.h bc-opcode.h \ |
e83ee760 | 970 | bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h bc-opname.h |
6d9f2c4c | 971 | real.o : real.c $(CONFIG_H) $(TREE_H) |
c6396a0b | 972 | getpwd.o : getpwd.c $(CONFIG_H) |
32e6d418 | 973 | |
974 | integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \ | |
832bfff4 | 975 | insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h \ |
976 | bytecode.h | |
32e6d418 | 977 | |
978 | jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \ | |
979 | insn-config.h insn-flags.h insn-codes.h expr.h real.h | |
980 | stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h | |
981 | ||
982 | cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \ | |
983 | insn-config.h recog.h | |
984 | loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \ | |
985 | insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h | |
986 | unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \ | |
987 | integrate.h regs.h flags.h expr.h loop.h | |
988 | flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \ | |
989 | basic-block.h regs.h hard-reg-set.h output.h | |
990 | combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h \ | |
991 | insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \ | |
f0a903c4 | 992 | basic-block.h recog.h real.h hard-reg-set.h |
32e6d418 | 993 | regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \ |
832bfff4 | 994 | basic-block.h regs.h insn-config.h recog.h reload.h real.h bytecode.h |
32e6d418 | 995 | local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \ |
996 | regs.h hard-reg-set.h insn-config.h recog.h output.h | |
8a4b1e01 | 997 | global.o : global.c $(CONFIG_H) $(RTL_H) flags.h \ |
32e6d418 | 998 | basic-block.h regs.h hard-reg-set.h insn-config.h output.h |
999 | ||
1000 | reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \ | |
1001 | reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h | |
1002 | reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \ | |
1003 | reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \ | |
1004 | basic-block.h recog.h output.h | |
1005 | caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \ | |
1006 | regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h | |
1007 | reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \ | |
1008 | basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \ | |
1009 | flags.h output.h | |
1010 | sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \ | |
1011 | flags.h insn-config.h insn-attr.h | |
543e7f6c | 1012 | final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h regs.h \ |
32e6d418 | 1013 | recog.h conditions.h insn-config.h insn-attr.h real.h output.h \ |
fe918d35 | 1014 | hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h |
32e6d418 | 1015 | recog.o : recog.c $(CONFIG_H) $(RTL_H) \ |
1016 | regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \ | |
1017 | insn-flags.h insn-codes.h real.h | |
1018 | reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \ | |
1019 | regs.h hard-reg-set.h flags.h insn-config.h | |
48c6936b | 1020 | |
32e6d418 | 1021 | aux-output.o : aux-output.c $(CONFIG_H) \ |
1022 | $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \ | |
1023 | insn-flags.h output.h insn-attr.h insn-codes.h | |
1024 | ||
f213fcf9 | 1025 | # Build auxiliary files that support ecoff format. |
1026 | mips-tfile: mips-tfile.o version.o $(LIBDEPS) | |
1027 | $(CC) $(CFLAGS) $(LDFLAGS) -o mips-tfile mips-tfile.o version.o $(LIBS) | |
1028 | ||
1029 | mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) | |
1030 | ||
1031 | mips-tdump: mips-tdump.o version.o $(LIBDEPS) | |
1032 | $(CC) $(CFLAGS) $(LDFLAGS) -o mips-tdump mips-tdump.o version.o $(LIBS) | |
1033 | ||
1034 | mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) | |
1035 | ||
32e6d418 | 1036 | # Normally this target is not used; but it is used if you |
1037 | # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c | |
1038 | # from the GNU Emacs distribution. | |
32e6d418 | 1039 | alloca.o: alloca.c |
32e6d418 | 1040 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \ |
cc2af6ca | 1041 | -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'` |
32e6d418 | 1042 | $(ALLOCA_FINISH) |
1043 | \f | |
1044 | # Generate header and source files from the machine description, | |
1045 | # and compile them. | |
1046 | ||
1047 | .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \ | |
1048 | insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \ | |
1049 | insn-attr.h insn-attrtab.c | |
1050 | ||
1051 | # The following pair of rules has this effect: | |
1052 | # genconfig is run only if the md has changed since genconfig was last run; | |
1053 | # but the file insn-config.h is touched only when its contents actually change. | |
1054 | ||
1055 | # Each of the other insn-* files is handled by a similar pair of rules. | |
1056 | ||
3f69fed5 | 1057 | # This causes an anomaly in the results of make -n |
1058 | # because insn-* is older than stamp-* | |
1059 | # and thus make -n thinks that insn-* will be updated | |
1060 | # and force recompilation of things that depend on it. | |
9ac790c5 | 1061 | # We use move-if-change precisely to avoid such recompilation. |
3f69fed5 | 1062 | # But there is no way to teach make -n that it will be avoided. |
1063 | ||
32e6d418 | 1064 | # Each of the insn-*.[ch] rules has a semicolon at the end, |
1065 | # for otherwise the system Make on SunOS 4.1 never tries | |
876dc5b0 | 1066 | # to recompile insn-*.o. To avoid problems and extra noise from |
1067 | # versions of make which don't like empty commands (nothing after the | |
1068 | # trailing `;'), we call true for each. | |
32e6d418 | 1069 | |
c2a18965 | 1070 | insn-config.h: stamp-config ; @true |
32e6d418 | 1071 | stamp-config : md genconfig $(srcdir)/move-if-change |
1072 | ./genconfig md > tmp-config.h | |
1073 | $(srcdir)/move-if-change tmp-config.h insn-config.h | |
1074 | touch stamp-config | |
1075 | ||
c2a18965 | 1076 | insn-flags.h: stamp-flags ; @true |
32e6d418 | 1077 | stamp-flags : md genflags $(srcdir)/move-if-change |
1078 | ./genflags md > tmp-flags.h | |
1079 | $(srcdir)/move-if-change tmp-flags.h insn-flags.h | |
1080 | touch stamp-flags | |
1081 | ||
c2a18965 | 1082 | insn-codes.h: stamp-codes ; @true |
32e6d418 | 1083 | stamp-codes : md gencodes $(srcdir)/move-if-change |
1084 | ./gencodes md > tmp-codes.h | |
1085 | $(srcdir)/move-if-change tmp-codes.h insn-codes.h | |
1086 | touch stamp-codes | |
1087 | ||
1088 | insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \ | |
1089 | insn-config.h insn-flags.h insn-codes.h | |
1090 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c | |
1091 | ||
c2a18965 | 1092 | insn-emit.c: stamp-emit ; @true |
32e6d418 | 1093 | stamp-emit : md genemit $(srcdir)/move-if-change |
1094 | ./genemit md > tmp-emit.c | |
1095 | $(srcdir)/move-if-change tmp-emit.c insn-emit.c | |
1096 | touch stamp-emit | |
1097 | ||
1098 | insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \ | |
1099 | real.h output.h flags.h | |
1100 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c | |
1101 | ||
c2a18965 | 1102 | insn-recog.c: stamp-recog ; @true |
32e6d418 | 1103 | stamp-recog : md genrecog $(srcdir)/move-if-change |
1104 | ./genrecog md > tmp-recog.c | |
1105 | $(srcdir)/move-if-change tmp-recog.c insn-recog.c | |
1106 | touch stamp-recog | |
1107 | ||
bdb66cef | 1108 | insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \ |
1109 | insn-config.h flags.h rtl.h recog.h expr.h reload.h | |
1110 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c | |
1111 | ||
1112 | insn-opinit.c: stamp-opinit ; @true | |
1113 | stamp-opinit : md genopinit $(srcdir)/move-if-change | |
1114 | ./genopinit md > tmp-opinit.c | |
1115 | $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c | |
1116 | touch stamp-opinit | |
1117 | ||
32e6d418 | 1118 | insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) |
1119 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c | |
1120 | ||
c2a18965 | 1121 | insn-extract.c: stamp-extract ; @true |
32e6d418 | 1122 | stamp-extract : md genextract $(srcdir)/move-if-change |
1123 | ./genextract md > tmp-extract.c | |
1124 | $(srcdir)/move-if-change tmp-extract.c insn-extract.c | |
1125 | touch stamp-extract | |
1126 | ||
1127 | insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h | |
1128 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c | |
1129 | ||
c2a18965 | 1130 | insn-peep.c: stamp-peep ; @true |
32e6d418 | 1131 | stamp-peep : md genpeep $(srcdir)/move-if-change |
1132 | ./genpeep md > tmp-peep.c | |
1133 | $(srcdir)/move-if-change tmp-peep.c insn-peep.c | |
1134 | touch stamp-peep | |
1135 | ||
1136 | insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \ | |
1137 | insn-attr.h insn-config.h | |
1138 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c | |
1139 | ||
c2a18965 | 1140 | insn-attr.h: stamp-attr ; @true |
32e6d418 | 1141 | stamp-attr : md genattr $(srcdir)/move-if-change |
1142 | ./genattr md > tmp-attr.h | |
1143 | $(srcdir)/move-if-change tmp-attr.h insn-attr.h | |
1144 | touch stamp-attr | |
1145 | ||
c2a18965 | 1146 | insn-attrtab.c: stamp-attrtab ; @true |
32e6d418 | 1147 | stamp-attrtab : md genattrtab $(srcdir)/move-if-change |
8bd8ea06 | 1148 | if cmp -s $(PREMADE_ATTRTAB_MD) md; \ |
1149 | then \ | |
1150 | echo Using $(PREMADE_ATTRTAB); \ | |
ab866dde | 1151 | cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \ |
8bd8ea06 | 1152 | else \ |
1153 | ./genattrtab md > tmp-attrtab.c; \ | |
1154 | fi | |
32e6d418 | 1155 | $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c |
1156 | touch stamp-attrtab | |
1157 | ||
1158 | insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \ | |
1159 | hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \ | |
1160 | insn-codes.h | |
1161 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c | |
1162 | ||
c2a18965 | 1163 | insn-output.c: stamp-output ; @true |
32e6d418 | 1164 | stamp-output : md genoutput $(srcdir)/move-if-change |
1165 | ./genoutput md > tmp-output.c | |
1166 | $(srcdir)/move-if-change tmp-output.c insn-output.c | |
1167 | touch stamp-output | |
1168 | \f | |
1169 | # Compile the programs that generate insn-* from the machine description. | |
1170 | # They are compiled with $(HOST_CC), and associated libraries, | |
1171 | # since they need to run on this machine | |
1172 | # even if GCC is being compiled to run on some other machine. | |
1173 | ||
1174 | # $(CONFIG_H) is omitted from the deps of the gen*.o | |
1175 | # because these programs don't really depend on anything | |
1176 | # about the target machine. They do depend on config.h itself, | |
1177 | # since that describes the host machine. | |
1178 | ||
89e36a04 | 1179 | # Pass the md file through cpp if the target requests it. |
1180 | $(MD_FILE): $(CPP_MD) | |
1181 | -if [ -f md.pre-cpp ]; then \ | |
1182 | rm -f md ; ./cpp $(CPP_MD_FLAGS) md.pre-cpp | sed 's/^# /; /g' > md ; \ | |
1183 | else true ; \ | |
1184 | fi | |
1185 | ||
32e6d418 | 1186 | genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS) |
1187 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \ | |
1188 | genconfig.o $(HOST_RTL) $(HOST_LIBS) | |
1189 | ||
e77fd588 | 1190 | genconfig.o : genconfig.c $(RTL_H) hconfig.h |
32e6d418 | 1191 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c |
1192 | ||
1193 | genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1194 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \ | |
1195 | genflags.o $(HOST_RTL) $(HOST_LIBS) | |
1196 | ||
e77fd588 | 1197 | genflags.o : genflags.c $(RTL_H) hconfig.h |
32e6d418 | 1198 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c |
1199 | ||
1200 | gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1201 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \ | |
1202 | gencodes.o $(HOST_RTL) $(HOST_LIBS) | |
1203 | ||
e77fd588 | 1204 | gencodes.o : gencodes.c $(RTL_H) hconfig.h |
32e6d418 | 1205 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c |
1206 | ||
1207 | genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1208 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \ | |
1209 | genemit.o $(HOST_RTL) $(HOST_LIBS) | |
1210 | ||
e77fd588 | 1211 | genemit.o : genemit.c $(RTL_H) hconfig.h |
32e6d418 | 1212 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c |
1213 | ||
bdb66cef | 1214 | genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS) |
1215 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genopinit \ | |
1216 | genopinit.o $(HOST_RTL) $(HOST_LIBS) | |
1217 | ||
1218 | genopinit.o : genopinit.c $(RTL_H) hconfig.h | |
1219 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c | |
1220 | ||
32e6d418 | 1221 | genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS) |
1222 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \ | |
1223 | genrecog.o $(HOST_RTL) $(HOST_LIBS) | |
1224 | ||
e77fd588 | 1225 | genrecog.o : genrecog.c $(RTL_H) hconfig.h |
32e6d418 | 1226 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c |
1227 | ||
1228 | genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1229 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \ | |
1230 | genextract.o $(HOST_RTL) $(HOST_LIBS) | |
1231 | ||
e77fd588 | 1232 | genextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h |
32e6d418 | 1233 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c |
1234 | ||
1235 | genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1236 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \ | |
1237 | genpeep.o $(HOST_RTL) $(HOST_LIBS) | |
1238 | ||
e77fd588 | 1239 | genpeep.o : genpeep.c $(RTL_H) hconfig.h |
32e6d418 | 1240 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c |
1241 | ||
1242 | genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1243 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \ | |
1244 | genattr.o $(HOST_RTL) $(HOST_LIBS) | |
1245 | ||
e77fd588 | 1246 | genattr.o : genattr.c $(RTL_H) hconfig.h |
32e6d418 | 1247 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c |
1248 | ||
262d46de | 1249 | genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS) |
32e6d418 | 1250 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \ |
262d46de | 1251 | genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS) |
32e6d418 | 1252 | |
e77fd588 | 1253 | genattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h |
32e6d418 | 1254 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c |
1255 | ||
1256 | genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS) | |
1257 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \ | |
1258 | genoutput.o $(HOST_RTL) $(HOST_LIBS) | |
1259 | ||
e77fd588 | 1260 | genoutput.o : genoutput.c $(RTL_H) hconfig.h |
32e6d418 | 1261 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c |
1262 | \f | |
1263 | # Compile the libraries to be used by gen*. | |
1264 | # If we are not cross-building, gen* use the same .o's that cc1 will use, | |
1265 | # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict | |
1266 | # with the rules for rtl.o, alloca.o, etc. | |
1267 | $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H) | |
1268 | rm -f $(HOST_PREFIX)rtl.c | |
e77fd588 | 1269 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c |
32e6d418 | 1270 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c |
1271 | ||
262d46de | 1272 | $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H) |
1273 | rm -f $(HOST_PREFIX)print-rtl.c | |
e77fd588 | 1274 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c |
262d46de | 1275 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c |
1276 | ||
32e6d418 | 1277 | $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H) |
1278 | rm -f $(HOST_PREFIX)rtlanal.c | |
e77fd588 | 1279 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c |
32e6d418 | 1280 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c |
1281 | ||
1282 | $(HOST_PREFIX_1)alloca.o: alloca.c | |
1283 | rm -f $(HOST_PREFIX)alloca.c | |
1284 | cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c | |
1285 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c | |
1286 | ||
1287 | $(HOST_PREFIX_1)obstack.o: obstack.c | |
1288 | rm -f $(HOST_PREFIX)obstack.c | |
e77fd588 | 1289 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c |
32e6d418 | 1290 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c |
1291 | ||
1292 | $(HOST_PREFIX_1)malloc.o: malloc.c | |
1293 | rm -f $(HOST_PREFIX)malloc.c | |
e77fd588 | 1294 | sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c |
32e6d418 | 1295 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c |
1296 | ||
1297 | # This satisfies the dependency that we get if you cross-compile a compiler | |
1298 | # that does not need to compile alloca, malloc or whatever. | |
1299 | $(HOST_PREFIX_1): | |
1300 | touch $(HOST_PREFIX_1) | |
1301 | \f | |
649d8da6 | 1302 | # Remake bytecode files. |
1303 | # BI_ALL=bi-run.o | |
1304 | BI_ALL= | |
1305 | BC_ALL=bc-opname.h bc-opcode.h bc-arity.h | |
1306 | BI_OBJ=bi-parser.o bi-lexer.o bi-reverse.o | |
1307 | ||
1308 | ||
7e20ea39 | 1309 | bc-emit.o : bc-emit.c $(CONFIG_H) $(RTL_H) real.h $(BYTECODE_H) \ |
f698a3d1 | 1310 | bc-arity.h bc-opcode.h bc-typecd.h bc-typecd.def bi-run.h bytetypes.h |
7e20ea39 | 1311 | bc-optab.o : bc-optab.c $(CONFIG_H) $(REAL_H) $(BYTECODE_H) \ |
1312 | bc-opcode.h bc-typecd.h bc-typecd.def | |
649d8da6 | 1313 | |
1314 | ||
1315 | bytecode: $(BI_ALL) $(BC_ALL) | |
1316 | ||
7e20ea39 | 1317 | bi-arity: bi-arity.o $(BI_OBJ) $(HOST_LIBDEPS) |
1318 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-arity \ | |
c3eff1f2 | 1319 | bi-arity.o $(BI_OBJ) $(HOST_LIBS) |
7e20ea39 | 1320 | bi-opcode: bi-opcode.o $(BI_OBJ) $(HOST_LIBDEPS) |
1321 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-opcode \ | |
c3eff1f2 | 1322 | bi-opcode.o $(BI_OBJ) $(HOST_LIBS) |
7e20ea39 | 1323 | bi-opname: bi-opname.o $(BI_OBJ) $(HOST_LIBDEPS) |
1324 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o bi-opname \ | |
c3eff1f2 | 1325 | bi-opname.o $(BI_OBJ) $(HOST_LIBS) |
7e20ea39 | 1326 | |
e83ee760 | 1327 | bi-run.o: $(srcdir)/bi-run.c $(srcdir)/bi-run.h $(srcdir)/bc-typecd.h \ |
1328 | bc-opname.h bc-arity.h bc-opcode.h | |
6fc7cea4 | 1329 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/bi-run.c |
7e20ea39 | 1330 | $(srcdir)/bi-parser.c $(srcdir)/bi-parser.h: $(srcdir)/bi-parser.y |
1331 | cd $(srcdir); $(BISON) $(BISONFLAGS) -d bi-parser.y -o bi-parser.c | |
3a346d9d | 1332 | bi-parser.o: $(srcdir)/bi-parser.c $(srcdir)/bi-defs.h hconfig.h |
7e20ea39 | 1333 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1334 | $(srcdir)/bi-parser.c | |
3a346d9d | 1335 | bi-lexer.o: $(srcdir)/bi-lexer.c $(srcdir)/bi-parser.h hconfig.h |
7e20ea39 | 1336 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1337 | $(srcdir)/bi-lexer.c | |
3a346d9d | 1338 | bi-arity.o: bi-arity.c $(srcdir)/bi-defs.h hconfig.h |
7e20ea39 | 1339 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1340 | $(srcdir)/bi-arity.c | |
2cba3cbb | 1341 | bi-opcode.o: bi-opcode.c $(srcdir)/bi-defs.h hconfig.h |
7e20ea39 | 1342 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1343 | $(srcdir)/bi-opcode.c | |
3a346d9d | 1344 | bi-opname.o: bi-opname.c $(srcdir)/bi-defs.h hconfig.h |
7e20ea39 | 1345 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ |
1346 | $(srcdir)/bi-opname.c | |
1347 | bi-reverse.o: bi-reverse.c $(srcdir)/bi-defs.h | |
1348 | $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ | |
1349 | $(srcdir)/bi-reverse.c | |
832bfff4 | 1350 | |
1351 | ||
e6baec2f | 1352 | bc-arity.h: stamp-bcarity ; @true |
1353 | stamp-bcarity : $(srcdir)/bytecode.def bi-arity $(srcdir)/move-if-change | |
e78095bc | 1354 | ./bi-arity < $(srcdir)/bytecode.def >tmp-bc-arity.h |
1355 | $(srcdir)/move-if-change tmp-bc-arity.h bc-arity.h | |
675fc1b6 | 1356 | touch stamp-bcarity |
649d8da6 | 1357 | |
e6baec2f | 1358 | bc-opcode.h: stamp-bcopcode ; @true |
1359 | stamp-bcopcode : $(srcdir)/bytecode.def bi-opcode $(srcdir)/move-if-change | |
f698a3d1 | 1360 | ./bi-opcode < $(srcdir)/bytecode.def >tmp-bcopcd.h |
1361 | $(srcdir)/move-if-change tmp-bcopcd.h bc-opcode.h | |
675fc1b6 | 1362 | touch stamp-bcopcode |
649d8da6 | 1363 | |
e6baec2f | 1364 | bc-opname.h: stamp-bcopname ; @true |
1365 | stamp-bcopname : $(srcdir)/bytecode.def bi-opname $(srcdir)/move-if-change | |
f698a3d1 | 1366 | ./bi-opname < $(srcdir)/bytecode.def >tmp-bcopnm.h |
1367 | $(srcdir)/move-if-change tmp-bcopnm.h bc-opname.h | |
675fc1b6 | 1368 | touch stamp-bcopname |
649d8da6 | 1369 | |
1370 | bytecode.mostlyclean: | |
1371 | -rm -f bc-arity.h bc-opcode.h bc-opname.h | |
1372 | ||
1373 | bytecode.distclean bytecode.clean: bytecode.mostlyclean | |
7e20ea39 | 1374 | -rm -f bi-arity bi-opcode bi-opname bi-lexer |
649d8da6 | 1375 | |
1376 | bytecode.realclean: bytecode.clean | |
91cbf3f1 | 1377 | -rm -f bi-parser.c bi-parser.h |
649d8da6 | 1378 | |
1379 | \f | |
32e6d418 | 1380 | # Remake cpp and protoize. |
1381 | ||
1382 | # Making the preprocessor | |
1383 | cpp: cccp | |
1384 | -rm -f cpp | |
1385 | ln cccp cpp | |
1386 | cccp: cccp.o cexp.o version.o $(LIBDEPS) | |
1387 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS) | |
1388 | cexp.o: $(srcdir)/cexp.c $(CONFIG_H) | |
1389 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c | |
1390 | $(srcdir)/cexp.c: $(srcdir)/cexp.y | |
1391 | cd $(srcdir); $(BISON) -o cexp.c cexp.y | |
d6b50af2 | 1392 | cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status |
32e6d418 | 1393 | # The reason we use $(libdir)/g++-include rather than using libsubdir |
1394 | # is for compatibility with the current version of libg++. | |
1395 | $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
c6396a0b | 1396 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ |
1397 | -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \ | |
2ffdcadf | 1398 | -DLOCAL_INCLUDE_DIR=\"$(local_prefix)/include\" \ |
c6396a0b | 1399 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
46073b39 | 1400 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
ae0fea3a | 1401 | -DTOOLDIR=\"$(tooldir)/\" \ |
32e6d418 | 1402 | -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'` |
1403 | ||
876dc5b0 | 1404 | # Note for the stamp targets, we run the program `true' instead of |
1405 | # having an empty command (nothing following the semicolon). | |
1406 | ||
77a164d8 | 1407 | proto: config.status protoize unprotoize SYSCALLS.c.X |
32e6d418 | 1408 | |
c6396a0b | 1409 | protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS) |
32e6d418 | 1410 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) \ |
c6396a0b | 1411 | protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@ |
c2a18965 | 1412 | protoize.o: stamp-proto ; @true |
ab866dde | 1413 | |
1414 | unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS) | |
1415 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) \ | |
1416 | unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@ | |
c2a18965 | 1417 | unprotoize.o: stamp-proto ; @true |
ab866dde | 1418 | |
1419 | stamp-proto: $(srcdir)/protoize.c getopt.h $(CONFIG_H) | |
32e6d418 | 1420 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1421 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
c6396a0b | 1422 | -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \ |
32e6d418 | 1423 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
46073b39 | 1424 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
67154a35 | 1425 | -DLOCAL_INCLUDE_DIR=\"$(local_prefix)/include\" \ |
32e6d418 | 1426 | -DSTD_PROTO_DIR=\"$(libsubdir)\" \ |
ab866dde | 1427 | -DUNPROTOIZE $(srcdir)/protoize.c |
1428 | mv protoize.o unprotoize.o | |
32e6d418 | 1429 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
1430 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ | |
c6396a0b | 1431 | -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \ |
32e6d418 | 1432 | -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \ |
46073b39 | 1433 | -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \ |
67154a35 | 1434 | -DLOCAL_INCLUDE_DIR=\"$(local_prefix)/include\" \ |
32e6d418 | 1435 | -DSTD_PROTO_DIR=\"$(libsubdir)\" \ |
ab866dde | 1436 | $(srcdir)/protoize.c |
77a164d8 | 1437 | touch stamp-proto |
32e6d418 | 1438 | |
1439 | getopt.o: $(srcdir)/getopt.c getopt.h | |
1440 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c | |
1441 | getopt1.o: $(srcdir)/getopt1.c getopt.h | |
1442 | $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c | |
1443 | ||
32e6d418 | 1444 | # This info describes the target machine, so compile with GCC just built. |
79f818d0 | 1445 | SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) |
f678532a | 1446 | -rm -f SYSCALLS.c tmp-SYSCALLS.s |
79f818d0 | 1447 | cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c |
32e6d418 | 1448 | $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ |
f678532a | 1449 | -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c |
1450 | -rm -f SYSCALLS.c tmp-SYSCALLS.s | |
0b20f012 | 1451 | |
a5889b74 | 1452 | |
0b20f012 | 1453 | test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) |
c548e550 | 1454 | -rm -f tmp-proto.[cso] |
262d46de | 1455 | cp $(srcdir)/protoize.c tmp-proto.c |
1456 | chmod u+w tmp-proto.c | |
c548e550 | 1457 | ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \ |
1458 | $(CFLAGS) $(INCLUDES) \ | |
0b20f012 | 1459 | -DGCC_INCLUDE_DIR=0 \ |
1460 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1461 | -DCROSS_INCLUDE_DIR=0 \ | |
46073b39 | 1462 | -DTOOL_INCLUDE_DIR=0 \ |
262d46de | 1463 | -DSTD_PROTO_DIR=0" tmp-proto.c |
1a754c64 | 1464 | @echo '**********' Expect 400 lines of differences. |
c548e550 | 1465 | -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff |
1466 | -wc -l tmp-proto.diff | |
1467 | ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \ | |
1468 | $(CFLAGS) $(INCLUDES) \ | |
0b20f012 | 1469 | -DGCC_INCLUDE_DIR=0 \ |
1470 | -DGPLUSPLUS_INCLUDE_DIR=0 \ | |
1471 | -DCROSS_INCLUDE_DIR=0 \ | |
46073b39 | 1472 | -DTOOL_INCLUDE_DIR=0 \ |
262d46de | 1473 | -DSTD_PROTO_DIR=0" tmp-proto.c |
0b20f012 | 1474 | @echo Expect zero differences. |
262d46de | 1475 | diff $(srcdir)/protoize.c tmp-proto.c | cat |
c548e550 | 1476 | -rm -f tmp-proto.[cso] |
32e6d418 | 1477 | \f |
2cfd79fe | 1478 | # Build the include directory. The stamp files are stmp-* rather than |
1479 | # stamp-* so that mostlyclean does not force the include directory to | |
1480 | # be rebuilt. | |
1481 | ||
690a93ea | 1482 | # Build the include directory except for float.h (which depends upon |
1483 | # enquire). | |
b7d4d520 | 1484 | stmp-int-hdrs: stmp-fixinc $(USER_H) gvarargs.h gstdarg.h gstddef.h \ |
1485 | xlimits.h objc-headers | |
2cfd79fe | 1486 | # Copy in the headers provided with gcc. |
1487 | # The sed command gets just the last file name component; | |
1488 | # this is necessary because VPATH could add a dirname. | |
1489 | # Using basename would be simpler, but some systems don't have it. | |
1490 | objdir=`pwd`; \ | |
1491 | cd $(srcdir); \ | |
1492 | for file in $(USER_H); do \ | |
1493 | realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ | |
b5850e21 | 1494 | rm -f $$objdir/include/$$realfile; \ |
2cfd79fe | 1495 | cp $$realfile $$objdir/include; \ |
1496 | chmod a+r $$objdir/include/$$realfile; \ | |
1497 | done | |
b5850e21 | 1498 | rm -f include/varargs.h |
2cfd79fe | 1499 | cp $(srcdir)/gvarargs.h include/varargs.h |
1500 | chmod a+r include/varargs.h | |
b5850e21 | 1501 | rm -f include/stdarg.h |
2cfd79fe | 1502 | cp $(srcdir)/gstdarg.h include/stdarg.h |
1503 | chmod a+r include/stdarg.h | |
b5850e21 | 1504 | rm -f include/stddef.h |
2cfd79fe | 1505 | cp $(srcdir)/gstddef.h include/stddef.h |
1506 | chmod a+r include/stddef.h | |
b5850e21 | 1507 | rm -f include/limits.h |
2cfd79fe | 1508 | cp xlimits.h include/limits.h |
1509 | chmod a+r include/limits.h | |
2cfd79fe | 1510 | # Install the README |
b5850e21 | 1511 | rm -f include/README |
2cfd79fe | 1512 | cp $(srcdir)/README-fixinc include/README |
1513 | chmod a+r include/README | |
690a93ea | 1514 | touch stmp-int-hdrs |
1515 | ||
1516 | # Build the complete include directory. | |
1517 | stmp-headers: stmp-int-hdrs gfloat.h | |
1518 | rm -f include/float.h | |
1519 | cp gfloat.h include/float.h | |
1520 | chmod a+r include/float.h | |
2cfd79fe | 1521 | touch stmp-headers |
1522 | ||
e21960f1 | 1523 | # Running fixincludes requires making sure that xgcc and cpp have been |
1524 | # compiled (they are used to get the value of __SIZE_TYPE__). | |
1525 | # But recompiling xgcc should not force the the header files to be | |
1526 | # fixed again. If you want to do that, delete stmp-fixinc. | |
1527 | fixinc.ready: xgcc cpp | |
1528 | -if [ -f fixinc.ready ] ; then \ | |
1529 | true; \ | |
1530 | else \ | |
1531 | touch fixinc.ready; \ | |
1532 | fi | |
1533 | ||
2cfd79fe | 1534 | # Build fixed copies of system files. |
e21960f1 | 1535 | stmp-fixinc: $(srcdir)/$(FIXINCLUDES) gsyslimits.h fixinc.ready |
2cfd79fe | 1536 | rm -rf include |
1537 | mkdir include | |
92d223d1 | 1538 | if [ x$(FIXINCLUDES) != xMakefile.in ]; \ |
6848a9c6 | 1539 | then \ |
1540 | for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \ | |
1541 | if [ -d $$dir ]; \ | |
1542 | then \ | |
2ecf1d02 | 1543 | $(srcdir)/$(FIXINCLUDES) include $$dir $(srcdir) "`pwd`/xgcc -B`pwd`/"; \ |
6848a9c6 | 1544 | else true; fi; \ |
92d223d1 | 1545 | done; \ |
6848a9c6 | 1546 | else true; \ |
1547 | fi | |
b7d4d520 | 1548 | rm -f include/syslimits.h |
1549 | if [ -f include/limits.h ]; then \ | |
1550 | mv include/limits.h include/syslimits.h; \ | |
1551 | else \ | |
1552 | cp $(srcdir)/gsyslimits.h include/syslimits.h; \ | |
1553 | fi | |
1554 | chmod a+r include/syslimits.h | |
9e74f24f | 1555 | touch stmp-fixinc |
7c4f0e88 | 1556 | |
15045969 | 1557 | # copy objc header files into build directory |
9fdf517e | 1558 | objc-headers: stmp-fixinc |
a5199ad9 | 1559 | if [ -d objc ]; then true; else mkdir objc; fi |
7c4f0e88 | 1560 | thisdir1=`pwd`; \ |
1561 | srcdir1=`cd $(srcdir); pwd`; \ | |
1562 | cd objc; \ | |
1563 | $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \ | |
1564 | srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \ | |
1565 | GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \ | |
1566 | GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include | |
15045969 | 1567 | touch objc-headers |
a5889b74 | 1568 | |
1569 | # Files related to the fixproto script. | |
1570 | ||
047c2b8b | 1571 | deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs |
553c2c6d | 1572 | CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -Iinclude -I${SYSTEM_HEADER_DIR}"; \ |
a5889b74 | 1573 | export CC; \ |
9541a717 | 1574 | $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h |
a5889b74 | 1575 | mv tmp-deduced.h deduced.h |
1576 | ||
1577 | gen-protos: gen-protos.o scan.o | |
1578 | ${HOST_CC} -o gen-protos gen-protos.o scan.o | |
1579 | ||
9541a717 | 1580 | gen-protos.o: gen-protos.c scan.h |
1581 | scan.o: scan.c scan.h | |
1582 | ||
047c2b8b | 1583 | xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile |
d7c4552e | 1584 | cat deduced.h $(srcdir)/sys-protos.h > fixtmp.c |
1585 | $(GCC_FOR_TARGET) fixtmp.c -E \ | |
6fc3eafd | 1586 | | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \ |
1587 | | ./gen-protos >xsys-protos.h | |
d7c4552e | 1588 | rm -rf fixtmp.c |
a5889b74 | 1589 | |
15dece2a | 1590 | fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_OBSTACK) |
1591 | $(HOST_CC) -o fix-header fix-header.o scan-decls.o scan.o $(HOST_OBSTACK) | |
a5889b74 | 1592 | |
9541a717 | 1593 | fix-header.o: fix-header.c obstack.h scan.h xsys-protos.h |
1594 | scan-decls.o: scan-decls.c scan.h | |
a5889b74 | 1595 | |
047c2b8b | 1596 | # stmp-fixproto depends on this, not on fix-header directly. |
1597 | # The idea is to make sure fix-header gets built, | |
1598 | # but not rerun fixproto after each stage | |
1599 | # just because fix-header's mtime has changed. | |
1600 | fixhdr.ready: fix-header | |
1601 | -if [ -f fixhdr.ready ] ; then \ | |
1602 | true; \ | |
1603 | else \ | |
1604 | touch fixhdr.ready; \ | |
1605 | fi | |
1606 | ||
7bf27989 | 1607 | # stmp-headers is to make sure fixincludes has already finished. |
047c2b8b | 1608 | stmp-fixproto: fixhdr.ready xsys-protos.h fixproto stmp-headers |
a5889b74 | 1609 | CPP="$(GCC_FOR_TARGET) -E"; export CPP; \ |
1610 | ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR) | |
1611 | touch stmp-fixproto | |
2cfd79fe | 1612 | \f |
32e6d418 | 1613 | # Remake the info files. |
1614 | ||
627defc4 | 1615 | doc: info |
1616 | info: $(srcdir)/cpp.info $(srcdir)/gcc.info | |
32e6d418 | 1617 | |
630c76ba | 1618 | $(srcdir)/cpp.info: cpp.texi |
4b0206c0 | 1619 | cd $(srcdir); $(MAKEINFO) cpp.texi |
32e6d418 | 1620 | |
630c76ba | 1621 | #$(srcdir)/gplus.info: gplus.texi |
bc51108a | 1622 | # $(MAKEINFO) `echo $(srcdir)/gplus.texi | sed 's,^\./,,'` |
32e6d418 | 1623 | |
630c76ba | 1624 | $(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \ |
1625 | md.texi rtl.texi tm.texi | |
4b0206c0 | 1626 | cd $(srcdir); $(MAKEINFO) gcc.texi |
630c76ba | 1627 | |
627defc4 | 1628 | dvi: $(srcdir)/gcc.dvi $(srcdir)/cpp.dvi |
1629 | ||
64616031 | 1630 | # This works with GNU Make's default rule. |
1631 | $(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \ | |
1632 | md.texi rtl.texi tm.texi | |
f345940f | 1633 | $(TEXI2DVI) $< |
64616031 | 1634 | |
1635 | # This works with GNU Make's default rule. | |
1636 | $(srcdir)/cpp.dvi: cpp.texi | |
f345940f | 1637 | $(TEXI2DVI) $< |
64616031 | 1638 | |
630c76ba | 1639 | $(srcdir)/INSTALL: install1.texi install.texi |
0b9e1f1f | 1640 | $(MAKEINFO) -D INSTALLONLY --no-header --no-split \ |
1641 | `echo $(srcdir)/install1.texi | sed 's,^\./,,'` | |
32e6d418 | 1642 | \f |
1643 | # Deletion of files made during compilation. | |
1644 | # There are four levels of this: | |
79f818d0 | 1645 | # `mostlyclean', `clean', `distclean' and `realclean'. |
32e6d418 | 1646 | # `mostlyclean' is useful while working on a particular type of machine. |
c6396a0b | 1647 | # It deletes most, but not all, of the files made by compilation. |
32e6d418 | 1648 | # It does not delete libgcc.a or its parts, so it won't have to be recompiled. |
c6396a0b | 1649 | # `clean' deletes everything made by running `make all'. |
79f818d0 | 1650 | # `distclean' also deletes the files made by config. |
32e6d418 | 1651 | # `realclean' also deletes everything that could be regenerated automatically. |
1652 | ||
79f818d0 | 1653 | |
649d8da6 | 1654 | mostlyclean: bytecode.mostlyclean |
32e6d418 | 1655 | -rm -f $(STAGESTUFF) |
343505c4 | 1656 | # Clean the objc subdir if we created one. |
1657 | if [ -d objc ]; then \ | |
1658 | srcdir1=`cd $(srcdir); pwd`; \ | |
8c6da369 | 1659 | cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \ |
343505c4 | 1660 | else true; fi |
bd594491 | 1661 | -rm -f libobjc.a |
32e6d418 | 1662 | # Delete the temporary source copies for cross compilation. |
1663 | -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c | |
1664 | -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c | |
1665 | -rm -f $(HOST_PREFIX_1)obstack.c | |
1666 | # Delete the temp files made in the course of building libgcc.a. | |
590613c7 | 1667 | -rm -f tmplibgcc* tmpcopy xlimits.h |
32e6d418 | 1668 | for name in $(LIB1FUNCS); do rm -f $${name}.c; done |
1669 | # Delete other temporary files. | |
e5b63666 | 1670 | -rm -f tmp-float.h tmp-gcc.xtar.gz |
f678532a | 1671 | -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s |
32e6d418 | 1672 | # Delete the stamp files. |
1673 | -rm -f stamp-* tmp-* | |
c6396a0b | 1674 | # Delete debugging dump files. |
32e6d418 | 1675 | -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop |
c6396a0b | 1676 | -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack |
1677 | # Delete some files made during installation. | |
d82b9c93 | 1678 | -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c |
79f818d0 | 1679 | -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s |
a5889b74 | 1680 | # Delete files generated for fixproto |
15dece2a | 1681 | -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \ |
553c2c6d | 1682 | gen-protos fixproto.list fixtmp.* |
c6396a0b | 1683 | # Delete unwanted output files from TeX. |
1684 | -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg | |
79f818d0 | 1685 | # Delete sorted indices we don't actually use. |
1686 | -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns | |
c6396a0b | 1687 | # Delete core dumps. |
8d14a5ba | 1688 | -rm -f core config/core |
32e6d418 | 1689 | |
79f818d0 | 1690 | # Delete all files made by compilation |
1691 | # that don't exist in the distribution. | |
649d8da6 | 1692 | clean: mostlyclean bytecode.clean |
8bd8ea06 | 1693 | # It may not be quite desirable to delete unprotoize.c here, |
1694 | # but the spec for `make clean' requires it. | |
1695 | # Using unprotoize.c is not quite right in the first place, | |
1696 | # but what better way is there? | |
840a6e8d | 1697 | -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready libgcc1.null |
131b361e | 1698 | -rm -f *.dvi |
89e36a04 | 1699 | -if [ -f md.pre-cpp ]; then \ |
1700 | rm -f md ; \ | |
1701 | fi | |
2cfd79fe | 1702 | # Delete the include directory. |
e21960f1 | 1703 | -rm -rf stmp-* fixinc.ready include objc-headers |
047c2b8b | 1704 | -rm -rf fixhdr.ready |
32e6d418 | 1705 | |
79f818d0 | 1706 | # Delete all files that users would normally create |
1707 | # while building and installing GCC. | |
649d8da6 | 1708 | distclean: clean bytecode.distclean |
89e36a04 | 1709 | -rm -f tm.h aux-output.c config.h config.status tconfig.h hconfig.h |
1710 | -rm -f md md.pre-cpp | |
ab866dde | 1711 | -rm -f Makefile *.oaux |
79f818d0 | 1712 | -rm -fr stage1 stage2 stage3 stage4 |
08d7a103 | 1713 | -rm -f cp-parse.output |
1714 | -rm -f objc-parse.output | |
1715 | -rm -f c-parse.output | |
c6396a0b | 1716 | |
1717 | # Delete anything likely to be found in the source directory | |
1718 | # that shouldn't be in the distribution. | |
1719 | extraclean: distclean | |
bbbdbddd | 1720 | -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~* |
131b361e | 1721 | -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej |
08d7a103 | 1722 | -rm -f config/*/=* config/*/"#"* config/*/*~* |
1723 | -rm -f config/*/*.orig config/*/*.rej | |
e66de667 | 1724 | -rm -f objc/=* objc/"#"* objc/*~* |
1725 | -rm -f objc/*.orig objc/*.rej | |
13da1009 | 1726 | -rm -f *.dvi *.oaux *.d *.[zZ] *.gz |
1727 | -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs | |
08d7a103 | 1728 | -rm -f *lose config/*lose config/*/*lose |
3a0781a0 | 1729 | -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog |
092f28a2 | 1730 | -rm -f djefoo |
32e6d418 | 1731 | |
1732 | # Get rid of every file that's generated from some other file. | |
1733 | # Most of these files ARE PRESENT in the GCC distribution. | |
649d8da6 | 1734 | realclean: distclean bytecode.realclean |
c373bd56 | 1735 | -rm -f c-parse.y objc-parse.y |
32e6d418 | 1736 | -rm -f cp-parse.c cp-parse.h cp-parse.output |
1737 | -rm -f objc-parse.c objc-parse.output | |
32e6d418 | 1738 | -rm -f c-parse.c c-parse.h c-parse.output |
1739 | -rm -f cexp.c cexp.output TAGS | |
c6396a0b | 1740 | -rm -f cpp.info* cpp.??s cpp.*aux |
1741 | -rm -f gcc.info* gcc.??s gcc.*aux | |
1742 | -rm -f gplus.info* gplus.??s gplus.*aux | |
32e6d418 | 1743 | \f |
1744 | # Entry points `install' and `uninstall'. | |
c6396a0b | 1745 | # Also use `install-collect2' to install collect2 when the config files don't. |
32e6d418 | 1746 | |
3f69fed5 | 1747 | # The semicolon is to prevent the install.sh -> install default rule |
876dc5b0 | 1748 | # from doing anything. Having it run true helps avoid problems and |
1749 | # noise from versions of make which don't like to have null commands. | |
c2a18965 | 1750 | install: $(INSTALL_TARGET) ; @true |
32e6d418 | 1751 | |
2cfd79fe | 1752 | # Copy the compiler files into directories where they will be run. |
2289acd7 | 1753 | install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ |
1754 | install-man install-info | |
32e6d418 | 1755 | |
e77fd588 | 1756 | # Do nothing while making gcc with a cross-compiler. The person who |
1757 | # makes gcc for the target machine has to know how to put a complete | |
1758 | # gcc together by hand. | |
1759 | install-build: force | |
1760 | @echo You have to install gcc on your target machine by hand. | |
1761 | ||
32e6d418 | 1762 | # Run this on the target machine |
1763 | # to finish installation of cross compiler. | |
1764 | install-cross-rest: install-float-h-cross | |
1765 | ||
1766 | # Install float.h for cross compiler. | |
1767 | # Run this on the target machine! | |
aa02423a | 1768 | install-float-h-cross: install-dir |
9f10de4b | 1769 | # if [ -f enquire ] ; then true; else false; fi |
1770 | # Note: don't use -. We should fail right away if enquire was not made. | |
1771 | ./enquire -f > $(tmpdir)/float.h | |
32e6d418 | 1772 | -rm -f $(libsubdir)/include/float.h |
f32abccb | 1773 | $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h |
1774 | -rm -f $(tmpdir)/float.h | |
32e6d418 | 1775 | chmod a-x $(libsubdir)/include/float.h |
1776 | ||
1777 | # Create the installation directory. | |
1778 | install-dir: | |
2388f67d | 1779 | -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi |
1780 | -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi | |
444c3fb0 | 1781 | # This dir isn't currently searched by cpp. |
d0561ed0 | 1782 | # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi |
2388f67d | 1783 | -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi |
1784 | -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi | |
630c76ba | 1785 | -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi |
2388f67d | 1786 | -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi |
69184f78 | 1787 | -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi |
67aebfdd | 1788 | -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; fi |
9d8314a9 | 1789 | -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; fi |
a2aa0fc1 | 1790 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi |
32e6d418 | 1791 | # We don't use mkdir -p to create the parents of mandir, |
1792 | # because some systems don't support it. | |
1793 | # Instead, we use this technique to create the immediate parent of mandir. | |
2388f67d | 1794 | -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \ |
32e6d418 | 1795 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi |
1796 | -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi | |
1797 | ||
1798 | # Install the compiler executables built during cross compilation. | |
eb778650 | 1799 | install-common: native install-dir xgcc $(EXTRA_PARTS) |
32e6d418 | 1800 | for file in $(COMPILERS); do \ |
1801 | if [ -f $$file ] ; then \ | |
1802 | rm -f $(libsubdir)/$$file; \ | |
1803 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
1804 | else true; \ | |
1805 | fi; \ | |
1806 | done | |
79f818d0 | 1807 | for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \ |
32e6d418 | 1808 | if [ x"$$file" != x.. ]; then \ |
1809 | rm -f $(libsubdir)/$$file; \ | |
1810 | $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \ | |
1811 | else true; fi; \ | |
1812 | done | |
8a4b1e01 | 1813 | # Don't mess with specs if it doesn't exist yet. |
94c53b91 | 1814 | -if [ -f specs ] ; then \ |
1815 | rm -f $(libsubdir)/specs; \ | |
8a4b1e01 | 1816 | $(INSTALL_DATA) specs $(libsubdir)/specs; \ |
1817 | fi | |
6005991e | 1818 | # Install the driver program as $(target)-gcc |
32e6d418 | 1819 | # and also as either gcc (if native) or $(tooldir)/bin/gcc. |
1820 | -if [ -f gcc-cross ] ; then \ | |
7fdd7d43 | 1821 | rm -f $(bindir)/$(target)-gcc; \ |
6005991e | 1822 | $(INSTALL_PROGRAM) gcc-cross $(bindir)/$(target)-gcc; \ |
32e6d418 | 1823 | if [ -d $(tooldir)/bin/. ] ; then \ |
1824 | rm -f $(tooldir)/bin/gcc; \ | |
1825 | $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \ | |
32e6d418 | 1826 | else true; fi; \ |
22a266b1 | 1827 | if [ -f cc1plus ] ; then \ |
1828 | rm -f $(bindir)/$(target)-g++; \ | |
1829 | $(INSTALL_PROGRAM) g++-cross $(bindir)/$(target)-g++; \ | |
1830 | chmod a+x $(bindir)/$(target)-g++; \ | |
1831 | rm -f $(bindir)/$(target)-c++; \ | |
1832 | ln $(bindir)/$(target)-g++ $(bindir)/$(target)-c++; \ | |
1833 | fi ; \ | |
32e6d418 | 1834 | else \ |
1835 | rm -f $(bindir)/gcc; \ | |
77a164d8 | 1836 | $(INSTALL_PROGRAM) xgcc $(bindir)/gcc; \ |
6005991e | 1837 | rm -f $(bindir)/$(target)-gcc-1; \ |
1838 | ln $(bindir)/gcc $(bindir)/$(target)-gcc-1; \ | |
1839 | mv $(bindir)/$(target)-gcc-1 $(bindir)/$(target)-gcc; \ | |
a2678ef6 | 1840 | if [ -f cc1plus ] ; then \ |
444c3fb0 | 1841 | rm -f $(bindir)/g++; \ |
1842 | $(INSTALL_PROGRAM) g++ $(bindir)/g++; \ | |
1843 | chmod a+x $(bindir)/g++; \ | |
1844 | rm -f $(bindir)/c++; \ | |
1845 | ln $(bindir)/g++ $(bindir)/c++; \ | |
a2678ef6 | 1846 | fi ; \ |
32e6d418 | 1847 | fi |
9cee99f7 | 1848 | # Install protoize if it was compiled. |
ae0fea3a | 1849 | -if [ -f protoize ]; \ |
9cee99f7 | 1850 | then \ |
1851 | rm -f $(bindir)/protoize; \ | |
1852 | $(INSTALL_PROGRAM) protoize $(bindir)/protoize; \ | |
1853 | rm -f $(bindir)/unprotoize; \ | |
1854 | $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize; \ | |
1855 | rm -f $(libsubdir)/SYSCALLS.c.X; \ | |
1856 | $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \ | |
1857 | chmod a-x $(libsubdir)/SYSCALLS.c.X; \ | |
1858 | fi | |
32e6d418 | 1859 | -rm -f $(libsubdir)/cpp |
1860 | $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp | |
1861 | ||
a2aa0fc1 | 1862 | # Install the info files. |
aa02423a | 1863 | install-info: doc install-dir |
a2aa0fc1 | 1864 | -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info* |
1865 | cd $(srcdir); for f in cpp.info* gcc.info*; \ | |
1866 | do $(INSTALL_DATA) $$f $(infodir)/$$f; done | |
1867 | -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info* | |
1868 | ||
32e6d418 | 1869 | # Install the man pages. |
77a164d8 | 1870 | install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 $(srcdir)/g++.1 |
32e6d418 | 1871 | -rm -f $(mandir)/gcc$(manext) |
ab866dde | 1872 | -$(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext) |
1873 | -chmod a-x $(mandir)/gcc$(manext) | |
c6396a0b | 1874 | -rm -f $(mandir)/cccp$(manext) |
ab866dde | 1875 | -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext) |
1876 | -chmod a-x $(mandir)/cccp$(manext) | |
ab866dde | 1877 | -$(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext) |
1878 | -chmod a-x $(mandir)/g++$(manext) | |
32e6d418 | 1879 | |
1880 | # Install the library. | |
807a86f6 | 1881 | install-libgcc: libgcc.a install-dir |
32e6d418 | 1882 | -if [ -f libgcc.a ] ; then \ |
1883 | rm -f $(libsubdir)/libgcc.a; \ | |
1884 | $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \ | |
1885 | if $(RANLIB_TEST) ; then \ | |
1886 | (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \ | |
1887 | chmod a-x $(libsubdir)/libgcc.a; \ | |
1888 | else true; fi | |
1889 | ||
f32abccb | 1890 | # Install the objc run time library. |
1891 | install-libobjc: libobjc.a install-dir | |
1892 | -if [ -f libobjc.a ] ; then \ | |
1893 | rm -f $(libsubdir)/libobjc.a; \ | |
1894 | $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \ | |
1895 | if $(RANLIB_TEST) ; then \ | |
1896 | (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \ | |
1897 | chmod a-x $(libsubdir)/libobjc.a; \ | |
1898 | else true; fi | |
1899 | ||
2cfd79fe | 1900 | # Install all the header files built in the include subdirectory. |
1901 | install-headers: install-include-dir $(INSTALL_HEADERS_DIR) install-assert-h | |
1902 | # Fix symlinks to absolute paths in the installed include directory to | |
1903 | # point to the installed directory, not the build directory. | |
1904 | -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \ | |
1905 | if [ $$? -eq 0 ]; then \ | |
1906 | dir=`cd include; pwd`; \ | |
1907 | for i in $$files; do \ | |
1908 | dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \ | |
1909 | if expr "$$dest" : "$$dir.*" > /dev/null; then \ | |
1910 | rm -f $(libsubdir)/include/$$i; \ | |
5822e312 | 1911 | ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \ |
2cfd79fe | 1912 | fi; \ |
1913 | done; \ | |
1914 | fi | |
32e6d418 | 1915 | |
2cfd79fe | 1916 | # Create or recreate the gcc private include file directory. |
2fc395f6 | 1917 | install-include-dir: install-dir |
2cfd79fe | 1918 | -rm -rf $(libsubdir)/include |
1919 | mkdir $(libsubdir)/include | |
1920 | -chmod a+rx $(libsubdir)/include | |
1921 | ||
1922 | # Install the include directory using tar. | |
a5889b74 | 1923 | install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir |
16db1e2d | 1924 | cd include; \ |
1925 | (tar cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - ) | |
1926 | # /bin/sh on some systems returns the status of the first tar, | |
1927 | # and that can lose with GNU tar which always writes a full block. | |
1928 | # So use `exit 0' to ignore its exit status. | |
2cfd79fe | 1929 | |
1930 | # Install the include directory using cpio. | |
a5889b74 | 1931 | install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir |
bea171c6 | 1932 | cd include; find . -print | cpio -pdum $(libsubdir)/include |
32e6d418 | 1933 | |
35df828f | 1934 | # Put assert.h where it won't override GNU libc's assert.h. |
1935 | # It goes in a dir that is searched after GNU libc's headers; | |
1936 | # thus, the following conditionals are no longer needed. | |
1937 | # But it's not worth deleting them now. | |
1938 | ## Don't replace the assert.h already there if it is not from GCC. | |
1939 | ## This code would be simpler if it tested for -f ... && ! grep ... | |
1940 | ## but supposedly the ! operator is missing in sh on some systems. | |
2cfd79fe | 1941 | install-assert-h: assert.h install-dir |
eb5a0caa | 1942 | if [ -f $(assertdir)/assert.h ]; \ |
1943 | then \ | |
95856242 | 1944 | if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \ |
a953974c | 1945 | then \ |
eb5a0caa | 1946 | rm -f $(assertdir)/assert.h; \ |
1947 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
04873c54 | 1948 | chmod a-x $(assertdir)/assert.h; \ |
eb5a0caa | 1949 | else true; \ |
1950 | fi; \ | |
2ba284c3 | 1951 | else \ |
db9a0b19 | 1952 | rm -f $(assertdir)/assert.h; \ |
1953 | $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \ | |
04873c54 | 1954 | chmod a-x $(assertdir)/assert.h; \ |
2ba284c3 | 1955 | fi |
32e6d418 | 1956 | |
c6396a0b | 1957 | # Use this target to install the program `collect2' under the name `ld'. |
aa02423a | 1958 | install-collect2: collect2 install-dir |
c6396a0b | 1959 | $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld |
1960 | # Install the driver program as $(libsubdir)/gcc for collect2. | |
77a164d8 | 1961 | $(INSTALL_PROGRAM) xgcc $(libsubdir)/gcc |
c6396a0b | 1962 | |
32e6d418 | 1963 | # Cancel installation by deleting the installed files. |
1964 | uninstall: | |
1965 | -rm -rf $(libsubdir) | |
1966 | -rm -rf $(bindir)/gcc | |
32e6d418 | 1967 | -rm -rf $(bindir)/protoize |
1968 | -rm -rf $(bindir)/unprotoize | |
1969 | -rm -rf $(mandir)/gcc$(manext) | |
3b50af09 | 1970 | -rm -rf $(mandir)/g++$(manext) |
c6396a0b | 1971 | -rm -rf $(mandir)/cccp$(manext) |
32e6d418 | 1972 | -rm -rf $(mandir)/protoize$(manext) |
1973 | -rm -rf $(mandir)/unprotoize$(manext) | |
1974 | \f | |
1975 | # These exist for maintenance purposes. | |
1976 | ||
1977 | # Update the tags table. | |
1978 | TAGS: force | |
1979 | cd $(srcdir); \ | |
1980 | mkdir temp; \ | |
8c1b3852 | 1981 | mv -f c-parse.[ch] cp-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \ |
32e6d418 | 1982 | etags *.y *.h *.c; \ |
1983 | mv temp/* .; \ | |
1984 | rmdir temp | |
1985 | ||
1986 | # Create the distribution tar file. | |
e5b63666 | 1987 | #dist: gcc-$(version).tar.gz |
1988 | dist: gcc.xtar.gz | |
32e6d418 | 1989 | |
e5b63666 | 1990 | gcc.xtar.gz: gcc.xtar |
1991 | gzip < gcc.xtar > tmp-gcc.xtar.gz | |
1992 | mv tmp-gcc.xtar.gz gcc.xtar.gz | |
32e6d418 | 1993 | |
e5b63666 | 1994 | #gcc-$(version).tar.gz: gcc-$(version).tar |
1995 | # gzip < gcc-$(version).tar > gcc-$(version).tar.gz | |
32e6d418 | 1996 | |
1997 | #gcc-$(version).tar: | |
6c76e6ec | 1998 | gcc.xtar: distdir |
1999 | # Make the distribution. | |
2000 | tar chf gcc.xtar gcc-$(version) | |
2001 | ||
3b50af09 | 2002 | distdir: doc $(srcdir)/INSTALL c-parse.y objc-parse.y cp-parse.y \ |
2003 | c-parse.c cp-parse.c objc-parse.c cexp.c | |
630c76ba | 2004 | if grep -s "for version ${version}" gcc.texi; \ |
2005 | then true; \ | |
0dce1b01 | 2006 | else echo "You must update the version number in \`gcc.texi'"; sleep 10;\ |
630c76ba | 2007 | fi |
131b361e | 2008 | # Update the version number in README |
2009 | awk '$$1 " " $$2 " " $$3 == "This directory contains" \ | |
2010 | { $$6 = version; print $$0 } \ | |
2011 | $$1 " " $$2 " " $$3 != "This directory contains"' \ | |
2012 | version=$(version) README > tmp.README | |
2013 | mv tmp.README README | |
c6396a0b | 2014 | -rm -rf gcc-$(version) tmp |
32e6d418 | 2015 | # Put all the files in a temporary subdirectory |
2016 | # which has the name that we want to have in the tar file. | |
c6396a0b | 2017 | mkdir tmp |
2018 | mkdir tmp/config | |
4f1fd857 | 2019 | mkdir tmp/objc |
c6396a0b | 2020 | for file in *[0-9a-zA-Z+]; do \ |
131b361e | 2021 | ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \ |
c6396a0b | 2022 | done |
2023 | cd config; \ | |
2024 | for file in *[0-9a-zA-Z+]; do \ | |
57e88ef9 | 2025 | if test -d $$file && test "$$file" != RCS; then \ |
8a32ef6f | 2026 | mkdir ../tmp/config/$$file; \ |
2027 | cd $$file; \ | |
2028 | for subfile in *[0-9a-zA-Z+]; do \ | |
2029 | ln $$subfile ../../tmp/config/$$file >/dev/null 2>&1 \ | |
2030 | || cp $$subfile ../../tmp/config/$$file; \ | |
2031 | done; \ | |
2032 | cd ..; \ | |
2033 | else \ | |
2034 | ln $$file ../tmp/config >/dev/null 2>&1 \ | |
2035 | || cp $$file ../tmp/config; \ | |
2036 | fi; \ | |
32e6d418 | 2037 | done |
4f1fd857 | 2038 | cd objc; \ |
2039 | for file in *[0-9a-zA-Z+]; do \ | |
e77fd588 | 2040 | ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \ |
4f1fd857 | 2041 | done |
c6396a0b | 2042 | ln .gdbinit tmp |
2043 | mv tmp gcc-$(version) | |
32e6d418 | 2044 | # Get rid of everything we don't want in the distribution. |
c6396a0b | 2045 | cd gcc-$(version); make -f Makefile.in extraclean |
32e6d418 | 2046 | |
2047 | # do make -f ../gcc/Makefile maketest DIR=../gcc | |
2048 | # in the intended test directory to make it a suitable test directory. | |
2049 | # THIS IS OBSOLETE; use the -srcdir operand in configure instead. | |
2050 | maketest: | |
2051 | ln -s $(DIR)/*.[chy] . | |
2052 | ln -s $(DIR)/configure . | |
2053 | ln -s $(DIR)/*.def . | |
2054 | -rm -f =* | |
2055 | ln -s $(DIR)/.gdbinit . | |
2056 | ln -s $(DIR)/$(FIXINCLUDES) . | |
2057 | -ln -s $(DIR)/bison.simple . | |
2058 | ln -s $(DIR)/config . | |
2059 | ln -s $(DIR)/move-if-change . | |
2060 | # The then and else were swapped to avoid a problem on Ultrix. | |
2061 | if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi | |
2062 | -rm tm.h aux-output.c config.h md | |
2063 | make clean | |
2064 | # You must then run config to set up for compilation. | |
77a164d8 | 2065 | |
41f63c60 | 2066 | bootstrap: force |
2067 | # Only build the C compiler for stage1, because that is the only one that | |
2068 | # we can guarantee will build with the native compiler, and also it is the | |
2069 | # only thing useful for building stage2. | |
3ef0efe3 | 2070 | $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES=c |
32e6d418 | 2071 | $(MAKE) stage1 |
c6396a0b | 2072 | # This used to define ALLOCA as empty, but that would lead to bad results |
2073 | # for a subsequent `make install' since that would not have ALLOCA empty. | |
2074 | # To prevent `make install' from compiling alloca.o and then relinking cc1 | |
2075 | # because alloca.o is newer, we permit these recursive makes to compile | |
2076 | # alloca.o. Then cc1 is newer, so it won't have to be relinked. | |
12343c6a | 2077 | $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)" |
32e6d418 | 2078 | $(MAKE) stage2 |
12343c6a | 2079 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)" |
32e6d418 | 2080 | |
2081 | bootstrap2: force | |
12343c6a | 2082 | $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)" |
32e6d418 | 2083 | $(MAKE) stage2 |
12343c6a | 2084 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)" |
32e6d418 | 2085 | |
2086 | bootstrap3: force | |
12343c6a | 2087 | $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)" |
32e6d418 | 2088 | |
48c6936b | 2089 | # Compare the object files in the current directory with those in the |
2090 | # stage2 directory. | |
2091 | ||
639b13ee | 2092 | # ./ avoids bug in some versions of tail. |
48c6936b | 2093 | compare: force |
2094 | for file in *.o; do \ | |
639b13ee | 2095 | tail +16c ./$$file > tmp-foo1; \ |
77a164d8 | 2096 | tail +16c stage2/$$file > tmp-foo2 2>/dev/null \ |
2097 | && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \ | |
48c6936b | 2098 | done |
2099 | -rm -f tmp-foo* | |
2100 | ||
2101 | # Similar, but compare with stage3 directory | |
2102 | compare3: force | |
2103 | for file in *.o; do \ | |
77a164d8 | 2104 | tail +16c $$file > tmp-foo1; \ |
2105 | tail +16c stage3/$$file > tmp-foo2 2>/dev/null \ | |
2106 | && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \ | |
48c6936b | 2107 | done |
2108 | -rm -f tmp-foo* | |
2109 | ||
32e6d418 | 2110 | # Copy the object files from a particular stage into a subdirectory. |
2111 | stage1: force | |
c6396a0b | 2112 | -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi |
32e6d418 | 2113 | -mv $(STAGESTUFF) stage1 |
2114 | -rm -f stage1/libgcc.a | |
2115 | -cp libgcc.a stage1 | |
2116 | -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi | |
2117 | ||
2118 | stage2: force | |
c6396a0b | 2119 | -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi |
32e6d418 | 2120 | -mv $(STAGESTUFF) stage2 |
2121 | -rm -f stage2/libgcc.a | |
2122 | -cp libgcc.a stage2 | |
2123 | -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi | |
2124 | ||
2125 | stage3: force | |
2388f67d | 2126 | -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi |
32e6d418 | 2127 | -mv $(STAGESTUFF) stage3 |
2128 | -rm -f stage3/libgcc.a | |
2129 | -cp libgcc.a stage3 | |
2130 | -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi | |
2131 | ||
2132 | stage4: force | |
2388f67d | 2133 | -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi |
32e6d418 | 2134 | -mv $(STAGESTUFF) stage4 |
2135 | -rm -f stage4/libgcc.a | |
2136 | -cp libgcc.a stage4 | |
2137 | -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi | |
2138 | ||
2139 | # Copy just the executable files from a particular stage into a subdirectory, | |
2140 | # and delete the object files. Use this if you're just verifying a version | |
2141 | # that is pretty sure to work, and you are short of disk space. | |
2142 | risky-stage1: force | |
2388f67d | 2143 | -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi |
e650197c | 2144 | -mv $(GCC_PARTS) stage1 |
32e6d418 | 2145 | -rm -f stage1/libgcc.a |
2146 | -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a | |
2147 | -make clean | |
2148 | ||
2149 | risky-stage2: force | |
2388f67d | 2150 | -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi |
e650197c | 2151 | -mv $(GCC_PARTS) stage2 |
32e6d418 | 2152 | -rm -f stage2/libgcc.a |
2153 | -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a | |
2154 | -make clean | |
2155 | ||
2156 | risky-stage3: force | |
2388f67d | 2157 | -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi |
e650197c | 2158 | -mv $(GCC_PARTS) stage3 |
32e6d418 | 2159 | -rm -f stage3/libgcc.a |
2160 | -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a | |
2161 | -make clean | |
2162 | ||
2163 | risky-stage4: force | |
2388f67d | 2164 | -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi |
e650197c | 2165 | -mv $(GCC_PARTS) stage4 |
32e6d418 | 2166 | -rm -f stage4/libgcc.a |
2167 | -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a | |
2168 | -make clean | |
2169 | ||
2170 | #In GNU Make, ignore whether `stage*' exists. | |
2171 | .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap | |
2172 | .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 | |
2173 | ||
2174 | force: |