Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | # Makefile for GNU C compiler. |
2 | # Copyright (C) 1987, 1988 Free Software Foundation, Inc. | |
3 | ||
4 | #This file is part of GNU CC. | |
5 | ||
6 | #GNU CC is free software; you can redistribute it and/or modify | |
7 | #it under the terms of the GNU General Public License as published by | |
8 | #the Free Software Foundation; either version 1, 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 | ||
21 | # Variables that exist for you to override. | |
22 | # See below for how to change them for certain systems. | |
23 | ||
24 | CFLAGS = -g $(XCFLAGS) | |
25 | CC = cc | |
26 | BISON = bison | |
27 | BISONFLAGS = -v | |
28 | # This should be the version of ar to use with output from GCC. | |
29 | AR = ar | |
30 | SHELL = /bin/sh | |
31 | # on sysV, define this as cp. | |
32 | INSTALL = install -c | |
33 | # Directory not specified here so that, if a GNU ranlib | |
34 | # is earlier in the path, it will be used. | |
35 | # That is likely to be true on systems that have the GNU ar | |
36 | # installed earlier in the path. | |
37 | RANLIB = ranlib | |
38 | ||
39 | # Compiler to use for compiling gnulib. | |
40 | # OLDCC should not be the GNU C compiler. | |
41 | OLDCC = cc | |
42 | ||
43 | # CFLAGS for use with OLDCC, for compiling gnulib. | |
44 | # NOTE: -O does not work on some Unix systems! | |
45 | # On them, you must take it out. | |
46 | CCLIBFLAGS=-O | |
47 | ||
48 | # This should be the version of ar to use with output from $(OLDCC). | |
49 | OLDAR = ar | |
50 | ||
51 | # CFLAGS for use with OLDCC, for compiling hard-params. | |
52 | HARD_PARAMS_FLAGS= | |
53 | ||
54 | # Directory where sources are, from where we are. | |
55 | srcdir = . | |
56 | # Directory in which to put the executable for the command `gcc' | |
57 | bindir = $(prefix)/usr/local/bin | |
58 | # Directory in which to put the subprograms used by the compiler. | |
59 | libdir = $(prefix)/usr/local/lib | |
60 | # Directory in which to put man pages. | |
61 | mandir = $(prefix)/usr/local/man/man1 | |
62 | # Number to put in man-page filename. | |
63 | manext = 1 | |
64 | ||
65 | # Additional system libraries to link with. | |
66 | CLIB= | |
67 | ||
68 | # Change this to a null string if obstacks are installed in the | |
69 | # system library. | |
70 | OBSTACK=obstack.o | |
71 | ||
72 | # Directory to link to, when using the target `maketest'. | |
73 | DIR = ../gcc | |
74 | ||
75 | # End of variables for you to override. | |
76 | ||
77 | ||
78 | # Variables you should change for certain systems. | |
79 | ||
80 | # These are what you would need on HPUX: | |
81 | # CFLAGS = -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300 | |
82 | # If you are using the GNU assembler and linker on HPUX, | |
83 | # add -I../hp-include to CFLAGS. | |
84 | # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5 | |
85 | # bites whenever tree.def, rtl.def or machmode.def is included | |
86 | # (ie., on every source file). | |
87 | # If you have a floating point accelerator, you might want -lsetjmp as well. | |
88 | # CCLIBFLAGS = -Wc,-Ns2000 -Wc,-Ne700 -O | |
89 | # HARD_PARAMS_FLAGS = -Wc,-Ns2000 -Wc,-Ne700 | |
90 | # INSTALL = cp | |
91 | # For CCLIBFLAGS you might want to specify the switch that | |
92 | # forces only 68000 instructions to be used. | |
93 | # If using the GNU assembler and linker, set AR to the GNU ar program, | |
94 | # wherever that is. | |
95 | # To get a working alloca, you may need to get alloca.s from Emacs | |
96 | # and assemble it into alloca.o rather than using alloca.c. | |
97 | ||
98 | # On the Sequent, you may need to set CCLIBFLAG to empty. | |
99 | ||
100 | # On the 3b1, this line may help you compile gnulib | |
101 | # if you already have a prior version of gcc installed. | |
102 | # CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional | |
103 | ||
104 | # On SysV from SCO, uncomment these lines as well as those for SysV in general. | |
105 | # You might also want to remove limits.h from the definition of USER_H, | |
106 | # since the one that comes with the system is good for POSIX. | |
107 | # RANLIB = : | |
108 | # CC = rcc | |
109 | # OLDCC = rcc | |
110 | ||
111 | # On a 386 running an ISC system, uncomment the following lines. | |
112 | # You also need to add -D_POSIX_SOURCE to CFLAGS | |
113 | # when compiling with GCC. | |
114 | # INSTALL = cp | |
115 | # CLIB = -lPW -lcposix | |
116 | ||
117 | # If you are making gcc for the first time, and if you are compiling it with | |
118 | # a non-gcc compiler, and if your system doesn't have a working alloca() in any | |
119 | # of the standard libraries (as is true for HP/UX or Genix), | |
120 | # then un-comment the following line when compiling with the system's cc: | |
121 | # ALLOCA = alloca.o | |
122 | # But don't do that if compiling using GCC. | |
123 | ||
124 | # If your system has a working alloca in /lib/libPW.a, | |
125 | # un-comment the following line. Note that -lPW doesn't work on HPUX or IRIX. | |
126 | # CLIB= -lPW | |
127 | ||
128 | # On SysV R4, when compiling with PCC, you can get alloca as follows: | |
129 | # CLIB = -lc /usr/ucblib/libucb.a | |
130 | # -lc is needed because if libucb.a were searched before libc.a, | |
131 | # you would get an incompatible stdio package that won't work. | |
132 | ||
133 | # On the NCR Tower 32 running SVR3, says ra@intsys.no : | |
134 | # Do *not* enable optimization in CFLAGS when using the native cc, because: | |
135 | # a) The optimizer seems to loop when invoked with -O2. | |
136 | # b) The -O1 level does stack/frame pointer optimizations that make the | |
137 | # assembler alloca in libPW.a fail, and the C alloca eats *lots* of memory. | |
138 | # c) gcc will eventually be recompiled with itself, so all this doesn't matter. | |
139 | # CFLAGS = -g -O0 | |
140 | # HARD_PARAMS_FLAGS = -O0 | |
141 | # CCLIBFLAGS = -O2 | |
142 | # CLIB = -lmalloc -lPW | |
143 | ||
144 | # On a pyramid, you need to uncomment the following line: | |
145 | # CLIB = -lc /usr/.attlib/libPW.a | |
146 | ||
147 | # If your system's malloc() routine fails for any reason (as it does on | |
148 | # certain versions of Genix), try getting the files | |
149 | # malloc.c and getpagesize.h from GNU Emacs and un-comment the following line: | |
150 | # MALLOC = malloc.o | |
151 | ||
152 | # To build gcc for Apollo 68K machines you must be running at least SR10.2 | |
153 | # with the 6.7 version of the C compiler. Use 'apollo68' as the argument to | |
154 | # config.gcc, then go into a bsd4.3 environment and use this: | |
155 | # CFLAGS = -g -O -Acpu,3000 -Arun,bsd4.3 -Asys,any -Anansi $(XCFLAGS) | |
156 | # CCLIBFLAGS = -O -Acpu,3000 -Arun,bsd4.3 -Asys,any -Anansi | |
157 | # HARD_PARAMS_FLAGS= -Anansi | |
158 | # (Says vasta@apollo.com.) | |
159 | ||
160 | ||
161 | # Dependency on obstack, alloca, malloc or whatever library facilities | |
162 | # are not installed in the system libraries. | |
163 | LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) | |
164 | ||
165 | # How to link with both our special library facilities | |
166 | # and the system's installed libraries. | |
167 | LIBS = $(OBSTACK) $(ALLOCA) $(MALLOC) $(CLIB) | |
168 | ||
169 | # Specify the directories to be searched for header files. | |
170 | # Both . and srcdir are used, in that order, | |
171 | # so that tm.h and config.h will be found in the compilation | |
172 | # subdirectory rather than in the source directory. | |
173 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config | |
174 | SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config | |
175 | ||
176 | # Always use -I$(srcdir)/config when compiling. | |
177 | .c.o: | |
178 | $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
179 | ||
180 | # Language-specific object files for C. | |
181 | C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o | |
182 | ||
183 | # Language-specific object files for C++. | |
184 | # (These are not yet released.) | |
185 | CPLUS_OBJS = cplus-parse.o cplus-decl.o cplus-typeck.o \ | |
186 | cplus-cvt.o cplus-search.o cplus-lex.o \ | |
187 | cplus-class.o cplus-init.o cplus-method.o | |
188 | ||
189 | # Language-independent object files. | |
190 | OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \ | |
191 | rtl.o rtlanal.o expr.o stmt.o expmed.o explow.o optabs.o varasm.o \ | |
192 | symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \ | |
193 | integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \ | |
194 | regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \ | |
195 | insn-peep.o final.o recog.o insn-recog.o insn-extract.o insn-output.o | |
196 | ||
197 | # Files to be copied away after each stage in building. | |
198 | STAGE_GCC=gcc | |
199 | STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \ | |
200 | insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ | |
201 | stamp-flags stamp-config stamp-codes \ | |
202 | stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \ | |
203 | genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \ | |
204 | cc1 cpp cccp # cc1plus | |
205 | ||
206 | # Members of gnulib. | |
207 | LIBFUNCS = _eprintf _builtin_new _builtin_New _builtin_del _bb \ | |
208 | _umulsi3 _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \ | |
209 | _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \ | |
210 | _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \ | |
211 | _fixunsdfsi _fixdfsi _floatsidf _truncdfsf2 _extendsfdf2 \ | |
212 | _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3 | |
213 | ||
214 | # Library members defined in gnulib2.c. | |
215 | LIB2FUNCS = _adddi3 _subdi3 _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \ | |
216 | _anddi3 _iordi3 _xordi3 _lshrdi3 _lshldi3 _ashldi3 _ashrdi3 _one_cmpldi2 \ | |
217 | _bdiv _cmpdi2 _ucmpdi2 _fixunsdfdi _fixdfdi _floatdidf _varargs | |
218 | ||
219 | # Header files that are made available to programs compiled with gcc. | |
220 | USER_H = stddef.h assert.h va-i860.h va-mips.h va-pyr.h va-sparc.h \ | |
221 | va-spur.h limits.h proto.h | |
222 | ||
223 | # The files that "belong" in CONFIG_H are deliberately omitted | |
224 | # because having them there would not be useful in actual practice. | |
225 | # All they would do is cause complete recompilation every time | |
226 | # one of the machine description files is edited. | |
227 | # That may or may not be what one wants to do. | |
228 | # If it is, rm *.o is an easy way to do it. | |
229 | # CONFIG_H = config.h tm.h | |
230 | CONFIG_H = | |
231 | RTL_H = rtl.h rtl.def machmode.def | |
232 | TREE_H = tree.h real.h tree.def machmode.def | |
233 | CPLUS_TREE_H = $(TREE_H) cplus-tree.h c-tree.h | |
234 | ||
235 | # Note that dependencies on obstack.h are not written | |
236 | # because that file is not part of GCC. | |
237 | # Dependencies on gvarargs.h are not written | |
238 | # because all that file does, when not compiling with GCC, | |
239 | # is include the system varargs.h. | |
240 | ||
241 | all: config.status gnulib gcc cc1 cpp float.h gnulib2 libg # cc1plus | |
242 | ||
243 | # Use this instead of `all' if you need to convert the libraries | |
244 | # before you can use the compiler. | |
245 | # Don't forget to do `make gnulib2' before installation. | |
246 | all-libconvert: config.status gnulib gcc cc1 cpp float.h libg # cc1plus | |
247 | ||
248 | lang-c: config.status gnulib gcc cc1 cpp gnulib2 libg | |
249 | # lang-cplus: config.status gnulib gcc cc1plus cpp gnulib2 libg | |
250 | ||
251 | config.status: | |
252 | @echo You must configure gcc. Look at the INSTALL file for details. | |
253 | @false | |
254 | ||
255 | doc: $(srcdir)/cpp.info $(srcdir)/gplus.info $(srcdir)/gcc.info | |
256 | ||
257 | compilations: ${OBJS} | |
258 | ||
259 | gcc: gcc.o version.o $(LIBDEPS) | |
260 | $(CC) $(CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS) | |
261 | # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'. | |
262 | mv gccnew gcc | |
263 | ||
264 | cc1: $(C_OBJS) $(OBJS) $(LIBDEPS) | |
265 | $(CC) $(CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS) | |
266 | ||
267 | cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS) | |
268 | $(CC) $(CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS) | |
269 | ||
270 | # Make sure there is some libg.a to be found, | |
271 | # in case compiling with a GCC that was built but not installed. | |
272 | libg: | |
273 | if [ ! -f /lib/libg.a -a ! -f /usr/lib/libg.a ]; \ | |
274 | then ar rc libg.a; else true; fi | |
275 | ||
276 | #Library of arithmetic subroutines | |
277 | # Don't compile this with gcc! | |
278 | # (That would cause most arithmetic functions to call themselves.) | |
279 | gnulib: gnulib.c $(CONFIG_H) config.status | |
280 | -rm -f stamp-gnulib2 | |
281 | rm -f tmpgnulib gnulib; \ | |
282 | for name in $(LIBFUNCS); \ | |
283 | do \ | |
284 | echo $${name}; \ | |
285 | rm -f $${name}.c; \ | |
286 | cp $(srcdir)/gnulib.c $${name}.c; \ | |
287 | $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $${name}.c; \ | |
288 | $(OLDAR) qc tmpgnulib $${name}.o; \ | |
289 | rm -f $${name}.[co]; \ | |
290 | done | |
291 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ;then $(RANLIB) tmpgnulib; else true; fi | |
292 | # Actually build it in tmpgnulib above, then rename now, | |
293 | # so that gnulib itself remains nonexistent if compilation is aborted. | |
294 | mv tmpgnulib gnulib | |
295 | # On HPUX, if you are working with the GNU assembler and linker, | |
296 | # the previous two command lines must be replaced with the following line. | |
297 | # No change is needed here if you are using the HPUX assembler and linker. | |
298 | # ../hp-bin/hpxt tmpgnulib gnulib | |
299 | ||
300 | gnulib2: stamp-gnulib2; | |
301 | stamp-gnulib2: gnulib2.c gnulib cc1 gcc cpp $(CONFIG_H) | |
302 | for name in $(LIB2FUNCS); \ | |
303 | do \ | |
304 | echo $${name}; \ | |
305 | ./gcc -B./ -fstrength-reduce -O $(INCLUDES) $(GNULIB2_CFLAGS) -c -DL$${name} $(srcdir)/gnulib2.c -o $${name}.o; \ | |
306 | $(AR) rc gnulib $${name}.o; \ | |
307 | rm -f $${name}.o; \ | |
308 | done | |
309 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) gnulib; else true; fi | |
310 | # On HPUX, if you are working with the GNU assembler and linker, | |
311 | # the previous line must be commented out. | |
312 | # No change is needed here if you are using the HPUX assembler and linker. | |
313 | touch stamp-gnulib2 | |
314 | ||
315 | float.h: | |
316 | # Originally, we used `make' rather than $(MAKE), to avoid propagating | |
317 | # a CC=gcc command option. However, since hard-params is now made | |
318 | # with $(OLDCC) explicitly, this is no longer important. | |
319 | # However, $(MAKE) fails on some systems where it isn't defined. | |
320 | # `make' has the disadvantage of sometimes running the system's make, | |
321 | # instead of GNU make. And the system's make might not support VPATH. | |
322 | # However, the compilation of hard-params should not need to use VPATH, | |
323 | # due to the explicit use of `$(srcdir)'. | |
324 | make hard-params | |
325 | -./hard-params -f > float.h | |
326 | ||
327 | # Compile hard-params with standard cc. It avoids some headaches. | |
328 | hard-params: hard-params.o | |
329 | $(OLDCC) $(HARD_PARAMS_FLAGS) $(LDFLAGS) hard-params.o -o $@ | |
330 | hard-params.o: $(srcdir)/hard-params.c | |
331 | -cp $(srcdir)/hard-params.c . > /dev/null 2>&1 | |
332 | $(OLDCC) $(HARD_PARAMS_FLAGS) $(CPPFLAGS) -DNO_SC -c hard-params.c | |
333 | ||
334 | # C language specific files. | |
335 | ||
336 | c-parse.tab.o : $(srcdir)/c-parse.tab.c $(CONFIG_H) $(TREE_H) c-parse.h c-tree.h input.h | |
337 | $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.tab.c | |
338 | $(srcdir)/c-parse.tab.c : $(srcdir)/c-parse.y | |
339 | $(BISON) $(BISONFLAGS) $(srcdir)/c-parse.y -o $@ | |
340 | ||
341 | c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-parse.h flags.h | |
342 | c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h | |
343 | c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) | |
344 | ||
345 | # C++ language specific files. | |
346 | ||
347 | cplus-parse.o : $(srcdir)/cplus-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
348 | $(CC) -c $(CFLAGS) $(INCLUDES) \ | |
349 | -DPARSE_OUTPUT=\"$(PWD)/cplus-parse.output\" \ | |
350 | `echo $(srcdir)/cplus-parse.c | sed 's,^\./,,'` | |
351 | ||
352 | $(srcdir)/cplus-parse.h $(srcdir)/cplus-parse.c : $(srcdir)/cplus-parse.y | |
353 | @echo expect 49 shift/reduce conflicts and 4 reduce/reduce conflicts | |
354 | $(BISON) $(BISONFLAGS) -d -o $(srcdir)/cplus-parse.c $(srcdir)/cplus-parse.y | |
355 | ||
356 | cplus-lex.o : cplus-lex.c $(CONFIG_H) $(CPLUS_TREE_H) $(srcdir)/cplus-parse.h | |
357 | cplus-decl.o : cplus-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
358 | cplus-typeck.o : cplus-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h | |
359 | cplus-class.o : cplus-class.c $(CONFIG_H) $(CPLUS_TREE_H) | |
360 | cplus-init.o : cplus-init.c $(CONFIG_H) $(CPLUS_TREE_H) | |
361 | cplus-method.o : cplus-method.c $(CONFIG_H) $(CPLUS_TREE_H) | |
362 | cplus-cvt.o : cplus-cvt.c $(CONFIG_H) $(CPLUS_TREE_H) | |
363 | cplus-search.o : cplus-search.c $(CONFIG_H) $(CPLUS_TREE_H) | |
364 | new-method.o : new-method.c $(CONFIG_H) $(CPLUS_TREE_H) | |
365 | ||
366 | # Language-independent files. | |
367 | ||
368 | gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h | |
369 | $(CC) $(CFLAGS) $(INCLUDES) \ | |
370 | -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \ | |
371 | -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" -c \ | |
372 | `echo $(srcdir)/gcc.c | sed 's,^\./,,'` | |
373 | ||
374 | version.o: version.c | |
375 | obstack.o: obstack.c | |
376 | ||
377 | tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h | |
378 | print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H) | |
379 | stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) $(RTL_H) | |
380 | fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) | |
381 | toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h | |
382 | ||
383 | rtl.o : rtl.c $(CONFIG_H) $(RTL_H) | |
384 | ||
385 | rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H) | |
386 | ||
387 | varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h expr.h \ | |
388 | insn-codes.h hard-reg-set.h | |
389 | stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ | |
390 | insn-flags.h insn-config.h insn-codes.h expr.h regs.h hard-reg-set.h recog.h | |
391 | expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ | |
392 | insn-flags.h insn-codes.h expr.h insn-config.h recog.h typeclass.h | |
393 | expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ | |
394 | insn-flags.h insn-codes.h expr.h insn-config.h recog.h | |
395 | explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h | |
396 | optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ | |
397 | insn-flags.h insn-codes.h expr.h insn-config.h recog.h | |
398 | symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h gdbfiles.h | |
399 | dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h | |
400 | sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) | |
401 | ||
402 | emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h real.h | |
403 | ||
404 | integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h \ | |
405 | insn-flags.h insn-codes.h | |
406 | ||
407 | jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h | |
408 | stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h | |
409 | ||
410 | cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h | |
411 | loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \ | |
412 | regs.h hard-reg-set.h recog.h flags.h expr.h | |
413 | flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h | |
414 | combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \ | |
415 | insn-config.h regs.h basic-block.h recog.h | |
416 | regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \ | |
417 | basic-block.h regs.h insn-config.h recog.h | |
418 | local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h regs.h \ | |
419 | hard-reg-set.h insn-config.h recog.h | |
420 | global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \ | |
421 | basic-block.h regs.h hard-reg-set.h insn-config.h | |
422 | ||
423 | reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \ | |
424 | reload.h recog.h hard-reg-set.h insn-config.h regs.h | |
425 | reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h \ | |
426 | reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h | |
427 | caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \ | |
428 | reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h | |
429 | final.o : final.c $(CONFIG_H) $(RTL_H) flags.h regs.h recog.h conditions.h \ | |
430 | gdbfiles.h insn-config.h real.h output.h | |
431 | recog.o : recog.c $(CONFIG_H) $(RTL_H) \ | |
432 | regs.h recog.h hard-reg-set.h insn-config.h real.h | |
433 | ||
434 | # Normally this target is not used; but it is used if you | |
435 | # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c | |
436 | # from the GNU Emacs distribution. | |
437 | # Note some machines won't allow $(CC) without -S on this source file. | |
438 | alloca.o: alloca.c | |
439 | $(CC) $(CFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'` | |
440 | as alloca.s -o alloca.o | |
441 | ||
442 | # Now the source files that are generated from the machine description. | |
443 | ||
444 | .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \ | |
445 | insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c | |
446 | ||
447 | # The following pair of rules has this effect: | |
448 | # genconfig is run only if the md has changed since genconfig was last run; | |
449 | # but the file insn-config.h is touched only when its contents actually change. | |
450 | ||
451 | # Each of the other insn-* files is handled by a similar pair of rules. | |
452 | ||
453 | insn-config.h: stamp-config ; | |
454 | stamp-config : md genconfig $(srcdir)/move-if-change | |
455 | ./genconfig md > tmp-config.h | |
456 | $(srcdir)/move-if-change tmp-config.h insn-config.h | |
457 | touch stamp-config | |
458 | ||
459 | insn-flags.h: stamp-flags ; | |
460 | stamp-flags : md genflags $(srcdir)/move-if-change | |
461 | ./genflags md > tmp-flags.h | |
462 | $(srcdir)/move-if-change tmp-flags.h insn-flags.h | |
463 | touch stamp-flags | |
464 | ||
465 | insn-codes.h: stamp-codes ; | |
466 | stamp-codes : md gencodes $(srcdir)/move-if-change | |
467 | ./gencodes md > tmp-codes.h | |
468 | $(srcdir)/move-if-change tmp-codes.h insn-codes.h | |
469 | touch stamp-codes | |
470 | ||
471 | insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h insn-codes.h \ | |
472 | insn-config.h insn-flags.h | |
473 | $(CC) $(CFLAGS) $(INCLUDES) -c insn-emit.c | |
474 | ||
475 | insn-emit.c: stamp-emit ; | |
476 | stamp-emit : md genemit $(srcdir)/move-if-change | |
477 | ./genemit md > tmp-emit.c | |
478 | $(srcdir)/move-if-change tmp-emit.c insn-emit.c | |
479 | touch stamp-emit | |
480 | ||
481 | insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h real.h recog.h | |
482 | $(CC) $(CFLAGS) $(INCLUDES) -c insn-recog.c | |
483 | ||
484 | insn-recog.c: stamp-recog ; | |
485 | stamp-recog : md genrecog $(srcdir)/move-if-change | |
486 | ./genrecog md > tmp-recog.c | |
487 | $(srcdir)/move-if-change tmp-recog.c insn-recog.c | |
488 | touch stamp-recog | |
489 | ||
490 | insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) | |
491 | $(CC) $(CFLAGS) $(INCLUDES) -c insn-extract.c | |
492 | ||
493 | insn-extract.c: stamp-extract ; | |
494 | stamp-extract : md genextract $(srcdir)/move-if-change | |
495 | ./genextract md > tmp-extract.c | |
496 | $(srcdir)/move-if-change tmp-extract.c insn-extract.c | |
497 | touch stamp-extract | |
498 | ||
499 | insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h real.h | |
500 | $(CC) $(CFLAGS) $(INCLUDES) -c insn-peep.c | |
501 | ||
502 | insn-peep.c: stamp-peep ; | |
503 | stamp-peep : md genpeep $(srcdir)/move-if-change | |
504 | ./genpeep md > tmp-peep.c | |
505 | $(srcdir)/move-if-change tmp-peep.c insn-peep.c | |
506 | touch stamp-peep | |
507 | ||
508 | insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \ | |
509 | hard-reg-set.h insn-config.h insn-flags.h output.h aux-output.c | |
510 | $(CC) $(CFLAGS) $(INCLUDES) -c insn-output.c | |
511 | ||
512 | insn-output.c: stamp-output ; | |
513 | stamp-output : md genoutput $(srcdir)/move-if-change | |
514 | ./genoutput md > tmp-output.c | |
515 | $(srcdir)/move-if-change tmp-output.c insn-output.c | |
516 | touch stamp-output | |
517 | ||
518 | # Now the programs that generate those files. | |
519 | # $(CONFIG_H) is omitted from the deps of the gen*.o | |
520 | # because these programs don't really depend on anything | |
521 | # about the target machine. They do depend on config.h itself, | |
522 | # since that describes the host machine. | |
523 | ||
524 | genconfig : genconfig.o rtl.o $(LIBDEPS) | |
525 | $(CC) $(CFLAGS) $(LDFLAGS) -o genconfig genconfig.o rtl.o $(LIBS) | |
526 | ||
527 | genconfig.o : genconfig.c $(RTL_H) config.h | |
528 | ||
529 | genflags : genflags.o rtl.o $(LIBDEPS) | |
530 | $(CC) $(CFLAGS) $(LDFLAGS) -o genflags genflags.o rtl.o $(LIBS) | |
531 | ||
532 | genflags.o : genflags.c $(RTL_H) config.h | |
533 | ||
534 | gencodes : gencodes.o rtl.o $(LIBDEPS) | |
535 | $(CC) $(CFLAGS) $(LDFLAGS) -o gencodes gencodes.o rtl.o $(LIBS) | |
536 | ||
537 | gencodes.o : gencodes.c $(RTL_H) config.h | |
538 | ||
539 | genemit : genemit.o rtl.o $(LIBDEPS) | |
540 | $(CC) $(CFLAGS) $(LDFLAGS) -o genemit genemit.o rtl.o $(LIBS) | |
541 | ||
542 | genemit.o : genemit.c $(RTL_H) config.h | |
543 | ||
544 | genrecog : genrecog.o rtl.o $(LIBDEPS) | |
545 | $(CC) $(CFLAGS) $(LDFLAGS) -o genrecog genrecog.o rtl.o $(LIBS) | |
546 | ||
547 | genrecog.o : genrecog.c $(RTL_H) config.h | |
548 | ||
549 | genextract : genextract.o rtl.o $(LIBDEPS) | |
550 | $(CC) $(CFLAGS) $(LDFLAGS) -o genextract genextract.o rtl.o $(LIBS) | |
551 | ||
552 | genextract.o : genextract.c $(RTL_H) config.h | |
553 | ||
554 | genpeep : genpeep.o rtl.o $(LIBDEPS) | |
555 | $(CC) $(CFLAGS) $(LDFLAGS) -o genpeep genpeep.o rtl.o $(LIBS) | |
556 | ||
557 | genpeep.o : genpeep.c $(RTL_H) config.h | |
558 | ||
559 | genoutput : genoutput.o rtl.o $(LIBDEPS) | |
560 | $(CC) $(CFLAGS) $(LDFLAGS) -o genoutput genoutput.o rtl.o $(LIBS) | |
561 | ||
562 | genoutput.o : genoutput.c $(RTL_H) config.h | |
563 | ||
564 | # Making the preprocessor | |
565 | cpp: cccp | |
566 | -rm -f cpp | |
567 | ln cccp cpp | |
568 | cccp: cccp.o cexp.o version.o $(LIBDEPS) | |
569 | $(CC) $(CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS) | |
570 | cexp.o: $(srcdir)/cexp.c $(CONFIG_H) | |
571 | $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c | |
572 | $(srcdir)/cexp.c: $(srcdir)/cexp.y | |
573 | $(BISON) -o $(srcdir)/cexp.c $(srcdir)/cexp.y | |
574 | cccp.o: cccp.c $(CONFIG_H) | |
575 | $(CC) $(CFLAGS) $(INCLUDES) \ | |
576 | -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \ | |
577 | -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \ | |
578 | -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'` | |
579 | ||
580 | $(srcdir)/cpp.info: $(srcdir)/cpp.texinfo | |
581 | makeinfo `echo $(srcdir)/cpp.texinfo | sed 's,^\./,,'` | |
582 | ||
583 | $(srcdir)/gplus.info: $(srcdir)/gplus.texinfo | |
584 | makeinfo `echo $(srcdir)/gplus.texinfo | sed 's,^\./,,'` | |
585 | ||
586 | $(srcdir)/gcc.info: $(srcdir)/gcc.texinfo | |
587 | makeinfo `echo $(srcdir)/gcc.texinfo | sed 's,^\./,,'` | |
588 | ||
589 | # gnulib is not deleted because deleting it would be inconvenient | |
590 | # for most uses of this target. | |
591 | clean: | |
592 | -rm -f $(STAGESTUFF) $(STAGE_GCC) | |
593 | # Delete the temp files made in the course of building gnulib. | |
594 | -rm -f tmpgnulib | |
595 | for name in $(LIBFUNCS); do rm -f $${name}.c; done | |
596 | -rm -f stamp-*.[ch] tmp-* | |
597 | -rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop *.dbr *.jump2 | |
598 | -rm -f core float.h hard-params | |
599 | ||
600 | # Like clean but also delete the links made to configure gcc. | |
601 | # Also removes gnulib, since that is desirable if you are changing cpus. | |
602 | cleanconfig: clean | |
603 | -rm -f tm.h aux-output.c config.h md config.status gnulib stamp-gnulib2 | |
604 | ||
605 | # Get rid of every file that's generated from some other file (except INSTALL). | |
606 | realclean: cleanconfig | |
607 | -rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs | |
608 | # -rm -f cplus-parse.tab.c cplus-parse.output | |
609 | -rm -f c-parse.tab.c c-parse.output c-parse.tab.output | |
610 | -rm -f gnulib cexp.c TAGS | |
611 | -rm -f cpp.info* cpp.?? cpp.??s cpp.log cpp.toc cpp.*aux | |
612 | -rm -f gcc.info* gcc.?? gcc.??s gcc.log gcc.toc gcc.*aux | |
613 | -rm -f gplus.info* gplus.?? gplus.??s gplus.log gplus.toc gplus.*aux | |
614 | -rm -f *.dvi | |
615 | ||
616 | # Copy the files into directories where they will be run. | |
617 | install: all $(USER_H) float.h gvarargs.h gstdarg.h gcc.1 | |
618 | -mkdir $(libdir) | |
619 | -if [ -f cc1 ] ; then $(INSTALL) cc1 $(libdir)/gcc-cc1 ; else true; fi | |
620 | -if [ -f cc1plus ] ; then $(INSTALL) cc1plus $(libdir)/gcc-cc1plus ; else true; fi | |
621 | $(INSTALL) gnulib $(libdir)/gcc-gnulib | |
622 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then (cd $(libdir); $(RANLIB) gcc-gnulib) ; else true; fi | |
623 | $(INSTALL) cpp $(libdir)/gcc-cpp | |
624 | $(INSTALL) gcc $(bindir) | |
625 | -mkdir $(libdir)/gcc-include | |
626 | -chmod ugo+rx $(libdir)/gcc-include | |
627 | for file in $(USER_H); do \ | |
628 | for eachfile in $(srcdir)/$${file} ; do \ | |
629 | $(INSTALL) $(srcdir)/`basename $${eachfile}` $(libdir)/gcc-include/`basename $${eachfile}`; \ | |
630 | done ; done | |
631 | $(INSTALL) float.h $(libdir)/gcc-include/float.h | |
632 | $(INSTALL) $(srcdir)/gvarargs.h $(libdir)/gcc-include/varargs.h | |
633 | $(INSTALL) $(srcdir)/gstdarg.h $(libdir)/gcc-include/stdarg.h | |
634 | -chmod a-x $(libdir)/gcc-include/*.h | |
635 | $(INSTALL) $(srcdir)/gcc.1 $(mandir)/gcc.$(manext) | |
636 | -chmod a-x $(mandir)/gcc.$(manext) | |
637 | # Make sure -lg won't get an error message from the linker: | |
638 | # create a library libg.a if there isn't one. | |
639 | -if [ -f /lib/libg.a -o -f /usr/lib/libg.a ]; then \ | |
640 | : ; \ | |
641 | else \ | |
642 | echo Installing a dummy libg.a into /usr/lib; \ | |
643 | echo "_no_libg(){}" > _no_libg.c; \ | |
644 | ./gcc -B./ -c _no_libg.c; \ | |
645 | $(AR) rc libg.a _no_libg.o; \ | |
646 | $(INSTALL) libg.a /usr/lib/libg.a; \ | |
647 | if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then (cd /usr/lib; $(RANLIB) libg.a) ; else true; fi; \ | |
648 | rm -f _no_libg.[co] libg.a; \ | |
649 | fi | |
650 | ||
651 | # do make -f ../gcc/Makefile maketest DIR=../gcc | |
652 | # in the intended test directory to make it a suitable test directory. | |
653 | maketest: | |
654 | ln -s $(DIR)/*.[chy] . | |
655 | ln -s $(DIR)/config . | |
656 | ln -s $(DIR)/*.def . | |
657 | -rm -f =* | |
658 | ln -s $(DIR)/.gdbinit . | |
659 | -ln -s $(DIR)/bison.simple . | |
660 | ln -s $(DIR)/config.gcc . | |
661 | ln -s $(DIR)/move-if-change . | |
662 | # The then and else were swapped to avoid a problem on Ultrix. | |
663 | if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile . ; else false; fi | |
664 | -rm tm.h aux-output.c config.h md | |
665 | make clean | |
666 | # You must then run config.gcc to set up for compilation. | |
667 | ||
668 | bootstrap: all force | |
669 | $(MAKE) stage1 | |
670 | $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="-O $(CFLAGS)" libdir=$(libdir) | |
671 | $(MAKE) stage2 | |
672 | $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="-O $(CFLAGS)" libdir=$(libdir) | |
673 | ||
674 | bootstrap2: force | |
675 | $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="-O $(CFLAGS)" libdir=$(libdir) | |
676 | $(MAKE) stage2 | |
677 | $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="-O $(CFLAGS)" libdir=$(libdir) | |
678 | ||
679 | bootstrap3: force | |
680 | $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="-O $(CFLAGS)" libdir=$(libdir) | |
681 | ||
682 | # Copy the object files from a particular stage into a subdirectory. | |
683 | stage1: force | |
684 | -mkdir stage1 | |
685 | -mv $(STAGESTUFF) $(STAGE_GCC) stage1 | |
686 | -rm -f stage1/gnulib | |
687 | -ln gnulib stage1 || cp gnulib stage1 | |
688 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) stage1/gnulib; else true; fi | |
689 | ||
690 | stage2: force | |
691 | -mkdir stage2 | |
692 | -mv $(STAGESTUFF) $(STAGE_GCC) stage2 | |
693 | -rm -f stage2/gnulib | |
694 | -ln gnulib stage2 || cp gnulib stage2 | |
695 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) stage2/gnulib; else true; fi | |
696 | ||
697 | stage3: force | |
698 | -mkdir stage3 | |
699 | -mv $(STAGESTUFF) $(STAGE_GCC) stage3 | |
700 | -rm -f stage3/gnulib | |
701 | -ln gnulib stage3 || cp gnulib stage3 | |
702 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) stage3/gnulib; else true; fi | |
703 | ||
704 | stage4: force | |
705 | -mkdir stage4 | |
706 | -mv $(STAGESTUFF) $(STAGE_GCC) stage4 | |
707 | -rm -f stage4/gnulib | |
708 | -ln gnulib stage4 || cp gnulib stage4 | |
709 | -if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) stage4/gnulib; else true; fi | |
710 | ||
711 | TAGS: force | |
712 | mkdir temp | |
713 | -mv c-parse.tab.c cplus-parse.c cplus-parse.h cexp.c temp | |
714 | etags *.y *.h *.c | |
715 | mv temp/* . | |
716 | rmdir temp | |
717 | ||
718 | includes: force | |
719 | export LIB; LIB=$(libdir)/gcc-include ./fixincludes | |
720 | ||
721 | #In GNU Make, ignore whether `stage*' exists. | |
722 | .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap | |
723 | ||
724 | force: |