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