|
|
1.1 root 1: # Makefile for GNU C compiler.
2: # Copyright (C) 1987 Free Software Foundation, Inc.
3:
4: #This file is part of GNU CC.
5:
6: #GNU CC is distributed in the hope that it will be useful,
7: #but WITHOUT ANY WARRANTY. No author or distributor
8: #accepts responsibility to anyone for the consequences of using it
9: #or for whether it serves any particular purpose or works at all,
10: #unless he says so in writing. Refer to the GNU CC General Public
11: #License for full details.
12:
13: #Everyone is granted permission to copy, modify and redistribute
14: #GNU CC, but only under the conditions described in the
15: #GNU CC General Public License. A copy of this license is
16: #supposed to have been given to you along with GNU CC so you
17: #can know your rights and responsibilities. It should be in a
18: #file named COPYING. Among other things, the copyright notice
19: #and this notice must be preserved on all copies.
20:
21:
22: CFLAGS = -g -O -DUSG
23: BUILTINS=
24: NPROC=2
25: CC = gcc
26: # OLDCC should not be the GNU C compiler.
27: OLDCC = cc
28: BISON = bison
29: AR = ar
30: SHELL = /bin/sh
31:
32: bindir = /usr/bin
33: libdir = /usr/lib
34:
35: # These are what you would need on HPUX:
36: # CFLAGS = -Wc,-Ns2000 -Wc,-Ne700
37: # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5
38: # bites whenever tree.def, rtl.def or machmode.def is included
39: # (ie., on every source file).
40: # CCLIBFLAGS = -Wc,-Ns2000 -Wc,-Ne700
41: # For CCLIBFLAGS you might want to specify the switch that
42: # forces only 68000 instructions to be used.
43:
44: # If you are compiling this with CC on HPUX, you need the following line:
45: CLIB = alloca.o
46: # Get alloca.o from GNU Emacs.
47:
48: # You must also change the line that uses `ranlib'. See below.
49:
50:
51: # How to link with obstack
52: OBSTACK=obstack.o
53: # Dependency on obstack
54: OBSTACK1=obstack.o
55:
56: LIBS = $OBSTACK $CLIB
57: CLIBS=alloca.O obstack.O
58: DIR = ../gcc
59:
60: OBJS = toplev.o version.o parse.tab.o tree.o print-tree.o \
61: decl.o typecheck.o stor-layout.o fold-const.o \
62: rtl.o expr.o stmt.o expmed.o explow.o optabs.o varasm.o \
63: symout.o dbxout.o emit-rtl.o insn-emit.o \
64: integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
65: regclass.o local-alloc.o global-alloc.o reload.o reload1.o insn-peep.o \
66: final.o recog.o insn-recog.o insn-extract.o insn-output.o
67: COBJS=`echo "$OBJS" | sed 's/\.o/.O/g'`
68:
69: # Files to be copied away after each stage in building.
70: STAGE_GCC=gcc
71: STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
72: insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
73: genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
74: cc1 cpp cccp
75:
76: # Members of gnulib.
77: LIBFUNCS = va_end _eprintf \
78: _umulsi3 _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
79: _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
80: _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \
81: _fixunsdfsi _fixunsdfdi _fixdfsi _fixdfdi \
82: _floatsidf _floatdidf _truncdfsf2 _extendsfdf2 \
83: _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3
84:
85: # If you want to recompile everything, just do rm *.o.
86: # CONFIG_H = config.h tm.h
87: CONFIG_H =config.h tm.h
88: RTL_H = rtl.h rtl.def machmode.def
89: TREE_H = tree.h tree.def machmode.def
90:
91: all:V: gnulib gcc cc1 cpp
92:
93: compilations: $OBJS
94:
95: gcc: gcc.o version.o $LIBS
96: $CC $CFLAGS -o gccnew $prereq
97: mv gccnew gcc
98:
99: gcc.o: gcc.c $CONFIG_H
100: $CC $CFLAGS -c gcc.c
101:
102: cc1: $OBJS $LIBS
103: $CC $CFLAGS -o cc1 $prereq
104:
105:
106: #Library of arithmetic subroutines
107: # Don't compile this with gcc!
108: gnulib: gnulib.c
109: set +e; mkdir libtemp; set -e
110: cd libtemp
111: rm -f gnulib
112: for name in ${LIBFUNCS}
113: do
114: echo ${name}
115: rm -f ${name}.c
116: ln ../gnulib.c ${name}.c
117: $OLDCC $CCLIBFLAGS -O -I.. -c -DL${name} ${name}.c
118: $AR qc gnulib ${name}.o
119: done; set -e
120: cd ..
121: mv libtemp/gnulib .
122: rm -rf libtemp
123: ranlib gnulib
124: # On HPUX, if you are working with the GNU assembler and linker,
125: # the previous line must be replaced with
126: # No change is needed here if you are using the HPUX assembler and linker.
127: # mv gnulib gnulib-hp
128: # hpxt gnulib-hp gnulib
129:
130: decl.o : decl.c $CONFIG_H $TREE_H flags.h c-tree.h parse.h
131: typecheck.o : typecheck.c $CONFIG_H $TREE_H c-tree.h flags.h
132: tree.o : tree.c $CONFIG_H $TREE_H
133: print-tree.o : print-tree.c $CONFIG_H $TREE_H
134: stor-layout.o : stor-layout.c $CONFIG_H $TREE_H
135: fold-const.o : fold-const.c $CONFIG_H $TREE_H
136: toplev.o : toplev.c $CONFIG_H $TREE_H flags.h
137:
138: parse.tab.o : parse.tab.c $CONFIG_H $TREE_H parse.h c-tree.h flags.h
139:
140: parse.tab.c : parse.y
141: $BISON -v parse.y
142:
143: rtl.o : rtl.c $CONFIG_H $RTL_H
144:
145: varasm.o : varasm.c $CONFIG_H $TREE_H $RTL_H flags.h expr.h
146: stmt.o : stmt.c $CONFIG_H $RTL_H $TREE_H flags.h \
147: insn-flags.h expr.h insn-config.h regs.h
148: expr.o : expr.c $CONFIG_H $RTL_H $TREE_H flags.h \
149: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
150: expmed.o : expmed.c $CONFIG_H $RTL_H $TREE_H flags.h \
151: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
152: explow.o : explow.c $CONFIG_H $RTL_H $TREE_H flags.h expr.h
153: optabs.o : optabs.c $CONFIG_H $RTL_H $TREE_H flags.h \
154: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
155: symout.o : symout.c $CONFIG_H $TREE_H $RTL_H symseg.h gdbfiles.h
156: dbxout.o : dbxout.c $CONFIG_H $TREE_H $RTL_H
157:
158: emit-rtl.o : emit-rtl.c $CONFIG_H $RTL_H regs.h insn-config.h
159:
160: integrate.o : integrate.c $CONFIG_H $RTL_H $TREE_H flags.h expr.h insn-flags.h
161:
162: jump.o : jump.c $CONFIG_H $RTL_H flags.h regs.h
163: stupid.o : stupid.c $CONFIG_H $RTL_H regs.h hard-reg-set.h
164:
165: cse.o : cse.c $CONFIG_H $RTL_H insn-config.h regs.h hard-reg-set.h
166: loop.o : loop.c $CONFIG_H $RTL_H insn-config.h regs.h recog.h
167: flow.o : flow.c $CONFIG_H $RTL_H basic-block.h regs.h hard-reg-set.h
168: combine.o : combine.c $CONFIG_H $RTL_H flags.h \
169: insn-config.h regs.h basic-block.h recog.h
170: regclass.o : regclass.c $CONFIG_H $RTL_H flags.h regs.h insn-config.h recog.h hard-reg-set.h
171: local-alloc.o : local-alloc.c $CONFIG_H $RTL_H basic-block.h regs.h hard-reg-set.h
172: global-alloc.o : global-alloc.c $CONFIG_H $RTL_H flags.h \
173: basic-block.h regs.h hard-reg-set.h insn-config.h
174: expr.h:N: insn-codes.h
175: reload.o : reload.c $CONFIG_H $RTL_H \
176: reload.h recog.h hard-reg-set.h insn-config.h regs.h
177: reload1.o : reload1.c $CONFIG_H $RTL_H flags.h \
178: reload.h regs.h hard-reg-set.h insn-config.h basic-block.h
179: final.o : final.c $CONFIG_H $RTL_H regs.h recog.h conditions.h gdbfiles.h insn-config.h
180: recog.o : recog.c $CONFIG_H $RTL_H \
181: regs.h recog.h hard-reg-set.h insn-config.h
182:
183: # Now the source files that are generated from the machine description.
184:
185: .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
186: insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c
187:
188: insn-config.h:Q: md genconfig
189: ./genconfig md > TI-config.h
190: ./move-if-change TI-config.h insn-config.h
191:
192: insn-flags.h:Q: md genflags
193: ./genflags md > TI-flags.h
194: ./move-if-change TI-flags.h insn-flags.h
195:
196: insn-codes.h:Q: md gencodes
197: ./gencodes md > TI-codes.h
198: ./move-if-change TI-codes.h insn-codes.h
199:
200: insn-emit.o : insn-emit.c $CONFIG_H $RTL_H expr.h insn-config.h
201: $CC $CFLAGS -c insn-emit.c
202:
203: insn-emit.c:Q: md genemit
204: ./genemit md > TI-emit.c
205: ./move-if-change TI-emit.c insn-emit.c
206:
207: insn-recog.o : insn-recog.c $CONFIG_H $RTL_H insn-config.h
208: $CC $CFLAGS -c insn-recog.c
209:
210: insn-recog.c:Q: md genrecog
211: ./genrecog md > TI-recog.c
212: ./move-if-change TI-recog.c insn-recog.c
213:
214: insn-extract.o : insn-extract.c $RTL_H
215: $CC $CFLAGS -c insn-extract.c
216:
217: insn-extract.c:Q: md genextract
218: ./genextract md > TI-extract.c
219: ./move-if-change TI-extract.c insn-extract.c
220:
221: insn-peep.o : insn-peep.c $CONFIG_H $RTL_H regs.h
222: $CC $CFLAGS -c insn-peep.c
223:
224: insn-peep.c:Q: md genpeep
225: ./genpeep md > TI-peep.c
226: ./move-if-change TI-peep.c insn-peep.c
227:
228: insn-output.o: insn-output.c $CONFIG_H $RTL_H regs.h insn-config.h insn-flags.h conditions.h output.h aux-output.c
229: $CC $CFLAGS -c insn-output.c
230:
231: insn-output.c:Q: md genoutput
232: ./genoutput md > TI-output.c
233: ./move-if-change TI-output.c insn-output.c
234:
235: # Now the programs that generate those files.
236:
237: genconfig : genconfig.o rtl.o $LIBS
238: $CC $CFLAGS -o genconfig $prereq
239:
240: genconfig.o : genconfig.c $RTL_H
241: $CC $CFLAGS -c genconfig.c
242:
243: genflags : genflags.o rtl.o $LIBS
244: $CC $CFLAGS -o genflags genflags.o rtl.o $LIBS
245:
246: genflags.o : genflags.c $RTL_H
247: $CC $CFLAGS -c genflags.c
248:
249: gencodes : gencodes.o rtl.o $LIBS
250: $CC $CFLAGS -o gencodes gencodes.o rtl.o $LIBS
251:
252: gencodes.o : gencodes.c $RTL_H
253: $CC $CFLAGS -c gencodes.c
254:
255: genemit : genemit.o rtl.o $LIBS
256: $CC $CFLAGS -o genemit genemit.o rtl.o $LIBS
257:
258: genemit.o : genemit.c $RTL_H
259: $CC $CFLAGS -c genemit.c
260:
261: genrecog : genrecog.o rtl.o $LIBS
262: $CC $CFLAGS -o genrecog genrecog.o rtl.o $LIBS
263:
264: genrecog.o : genrecog.c $RTL_H
265: $CC $CFLAGS -c genrecog.c
266:
267: genextract : genextract.o rtl.o $LIBS
268: $CC $CFLAGS -o genextract genextract.o rtl.o $LIBS
269:
270: genextract.o : genextract.c $RTL_H
271: $CC $CFLAGS -c genextract.c
272:
273: genpeep : genpeep.o rtl.o $LIBS
274: $CC $CFLAGS -o genpeep genpeep.o rtl.o $LIBS
275:
276: genpeep.o : genpeep.c $RTL_H
277: $CC $CFLAGS -c genpeep.c
278:
279: genoutput : genoutput.o rtl.o $LIBS
280: $CC $CFLAGS -o genoutput genoutput.o rtl.o $LIBS
281:
282: genoutput.o : genoutput.c $RTL_H
283: $CC $CFLAGS -c genoutput.c
284:
285: # Making the preprocessor
286: cpp: cccp
287: set +e; rm -f cpp; set -e
288: ln cccp cpp; set -e
289: cccp: cccp.o cexp.o version.o $CLIB
290: $CC $CFLAGS -o cccp $prereq
291: cexp.o: cexp.c
292: cexp.c: cexp.y
293: $BISON cexp.y
294: mv cexp.tab.c cexp.c
295: cccp.o: cccp.c
296:
297: # gnulib is not deleted because deleting it would be inconvenient
298: # for most uses of this target.
299: clean:
300: rm -f $STAGESTUFF $STAGE_GCC
301: rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
302: rm -f core
303:
304: # Copy the files into directories where they will be run.; set -e
305: BINS=$libdir/gcc-cc1 $libdir/gcc-gnulib $libdir/gcc-cpp $bindir/gcc
306:
307: install:V: $BINS
308: ship:V: shipped
309: shipped: $BINS
310: ship $newprereq
311:
312: $libdir/gcc-cc1: cc1
313: cp $prereq $target; chmod 775 $target; strip -g target
314: $libdir/gcc-gnulib: gnulib
315: cp $prereq $target; chmod 775 $target
316: ranlib $target
317: $libdir/gcc-cpp: cpp
318: cp $prereq $target; chmod 775 $target; strip -g target
319: $bindir/gcc: gcc
320: cp $prereq $target; chmod 775 $target; strip -g target
321:
322: # do make -f ../gcc/Makefile maketest DIR=../gcc
323: # in the intended test directory to make it a suitable test directory.
324: maketest:
325: ln -s $DIR/*.[chy] .
326: ln -s $DIR/*.def .
327: ln -s $DIR/*.md .
328: ln -s $DIR/.gdbinit .
329: set +e; ln -s $DIR/bison.simple .; set -e
330: ln -s $DIR/gcc .; set -e
331: ln -s $DIR/move-if-change .
332: ln -s $DIR/Makefile test-Makefile
333: set +e; rm tm.h aux-output.c; set -e
334: make -f test-Makefile clean; set -e
335: # You must create the necessary links tm.h, md and aux-output.c
336:
337: # Copy the object files from a particular stage into a subdirectory.
338: stage1:V:
339: set +e; rm -fr stage1; mkdir stage1; set -e
340: rm -f stage/*; cp $STAGESTUFF $STAGE_GCC stage
341: mv $STAGESTUFF $STAGE_GCC stage1
342: ln gnulib stage1
343:
344: unstage:V:
345: cp stage/* .
346:
347: recomp:V: stage1
348: mk CC=stage1/gcc CFLAGS="-O -DUSG -Bstage1/"
349:
350: stage2:V:
351: set +e; rm -fr stage2; mkdir stage2; set -e
352: mv $STAGESTUFF $STAGE_GCC stage2; set -e
353: ln gnulib stage2
354:
355: stage3:V:
356: set +e; rm -fr stage3; mkdir stage3; set -e
357: mv $STAGESTUFF $STAGE_GCC stage3; set -e
358: ln gnulib stage3
359:
360: force:
361:
362: TAGS: force
363: etags *.y *.h *.c
364: .PHONY: TAGS
365:
366: %.o: %.c
367: $CC $CFLAGS -c $stem.c
368:
369: %.O: %.c
370: cyntax $CFLAGS -c $stem.c
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.