|
|
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:
1.1.1.2 root 22: CFLAGS = -g
1.1 root 23: CC = cc
1.1.1.2 root 24: # OLDCC should not be the GNU C compiler.
25: OLDCC = cc
26: BISON = bison
27: AR = ar
28: SHELL = /bin/sh
29:
30: bindir = /usr/local
31: libdir = /usr/local/lib
32:
33: # These are what you would need on HPUX:
1.1.1.10! root 34: # CFLAGS = -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
1.1.1.2 root 35: # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5
36: # bites whenever tree.def, rtl.def or machmode.def is included
37: # (ie., on every source file).
38: # CCLIBFLAGS = -Wc,-Ns2000 -Wc,-Ne700
39: # For CCLIBFLAGS you might want to specify the switch that
40: # forces only 68000 instructions to be used.
41:
1.1.1.4 root 42: # If you are making gcc for the first time, and if you are compiling it with
43: # a non-gcc compiler, and if your system doesn't have a working alloca() in any
1.1.1.7 root 44: # of the standard libraries (as is true for HP/UX or Genix),
45: # then get alloca.c from GNU Emacs and un-comment the following line:
46: # ALLOCA = alloca.o
1.1.1.2 root 47:
1.1.1.4 root 48: # If your system has alloca() in /lib/libPW.a, un-comment the following line:
1.1.1.7 root 49: # CLIB= -lPW
50:
51: # If your system's malloc() routine fails for any reason (as it does on
52: # certain versions of Genix), try getting the files
53: # malloc.c and getpagesize.h from GNU Emacs and un-comment the following line:
54: # MALLOC = malloc.o
1.1 root 55:
1.1.1.5 root 56: # If you are running GCC on an Apollo, you will need this:
57: # CFLAGS = -g -O -M 3000 -U__STDC__ -DSHORT_ENUM_BUG
58:
1.1.1.7 root 59: # Change this to a null string if obstacks are installed in the
60: # system library.
1.1 root 61: OBSTACK=obstack.o
62:
1.1.1.7 root 63: # Dependency on obstack, alloca, malloc or whatever library facilities
64: # are not installed in the system libraries.
65: LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
66:
67: # How to link with both our special library facilities
68: # and the system's installed libraries.
69: LIBS = $(OBSTACK) $(ALLOCA) $(MALLOC) $(CLIB)
70:
1.1 root 71: DIR = ../gcc
72:
1.1.1.7 root 73: # Object files of CC1.
74: OBJS = toplev.o version.o c-parse.tab.o tree.o print-tree.o \
75: c-decl.o c-typeck.o c-convert.o stor-layout.o fold-const.o \
1.1.1.2 root 76: rtl.o expr.o stmt.o expmed.o explow.o optabs.o varasm.o \
1.1.1.4 root 77: symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
1.1.1.2 root 78: integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
79: regclass.o local-alloc.o global-alloc.o reload.o reload1.o insn-peep.o \
1.1 root 80: final.o recog.o insn-recog.o insn-extract.o insn-output.o
81:
1.1.1.2 root 82: # Files to be copied away after each stage in building.
83: STAGE_GCC=gcc
84: STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
85: insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
86: genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
87: cc1 cpp cccp
88:
89: # Members of gnulib.
1.1.1.4 root 90: LIBFUNCS = _eprintf \
1.1.1.2 root 91: _umulsi3 _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
92: _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
93: _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \
94: _fixunsdfsi _fixunsdfdi _fixdfsi _fixdfdi \
95: _floatsidf _floatdidf _truncdfsf2 _extendsfdf2 \
96: _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3
97:
1.1.1.8 root 98: # Header files that are made available to programs compiled with gcc.
99: USER_H = stddef.h stdarg.h assert.h varargs.h va-*.h limits.h
100:
1.1 root 101: # If you want to recompile everything, just do rm *.o.
102: # CONFIG_H = config.h tm.h
103: CONFIG_H =
104: RTL_H = rtl.h rtl.def machmode.def
105: TREE_H = tree.h tree.def machmode.def
106:
1.1.1.2 root 107: all: gnulib gcc cc1 cpp
108:
1.1.1.10! root 109: doc: cpp.info gcc.info
1.1.1.4 root 110:
1.1.1.2 root 111: compilations: ${OBJS}
1.1 root 112:
1.1.1.7 root 113: gcc: gcc.o version.o $(LIBDEPS)
1.1.1.6 root 114: $(CC) $(CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
1.1.1.2 root 115: # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
116: mv gccnew gcc
1.1 root 117:
1.1.1.2 root 118: gcc.o: gcc.c $(CONFIG_H)
1.1.1.4 root 119: $(CC) $(CFLAGS) -c -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" gcc.c
1.1 root 120:
1.1.1.7 root 121: cc1: $(OBJS) $(LIBDEPS)
1.1.1.6 root 122: $(CC) $(CFLAGS) $(LDFLAGS) -o cc1 $(OBJS) $(LIBS)
1.1 root 123:
1.1.1.2 root 124: #Library of arithmetic subroutines
125: # Don't compile this with gcc!
126: gnulib: gnulib.c
127: -mkdir libtemp
128: cd libtemp; \
129: rm -f gnulib; \
130: for name in $(LIBFUNCS); \
131: do \
132: echo $${name}; \
133: rm -f $${name}.c; \
134: ln ../gnulib.c $${name}.c; \
135: $(OLDCC) $(CCLIBFLAGS) -O -I.. -c -DL$${name} $${name}.c; \
136: $(AR) qc gnulib $${name}.o; \
137: done
138: mv libtemp/gnulib .
139: rm -rf libtemp
1.1.1.4 root 140: if [ -f /usr/bin/ranlib ] ; then ranlib gnulib ;fi
1.1.1.2 root 141: # On HPUX, if you are working with the GNU assembler and linker,
142: # the previous line must be replaced with
143: # No change is needed here if you are using the HPUX assembler and linker.
144: # mv gnulib gnulib-hp
145: # hpxt gnulib-hp gnulib
1.1 root 146:
1.1.1.7 root 147:
148: # C-language specific files.
149:
150: c-parse.tab.o : c-parse.tab.c $(CONFIG_H) $(TREE_H) c-parse.h c-tree.h
151: c-parse.tab.c : c-parse.y
152: $(BISON) -v c-parse.y
153:
154: c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-parse.h flags.h
155: c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
156: c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H)
157:
158: # Language-independent files.
159:
1.1 root 160: tree.o : tree.c $(CONFIG_H) $(TREE_H)
161: print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
162: stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H)
163: fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H)
1.1.1.2 root 164: toplev.o : toplev.c $(CONFIG_H) $(TREE_H) flags.h
1.1 root 165:
166: rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
167:
1.1.1.6 root 168: varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h expr.h insn-codes.h
1.1.1.2 root 169: stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1.1.1.6 root 170: insn-flags.h expr.h insn-config.h regs.h insn-codes.h
1.1.1.2 root 171: expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
172: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
173: expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
174: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
1.1.1.6 root 175: explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h
1.1.1.2 root 176: optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
177: insn-flags.h insn-codes.h expr.h insn-config.h recog.h
178: symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h gdbfiles.h
1.1.1.7 root 179: dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h
1.1.1.4 root 180: sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h
1.1.1.2 root 181:
182: emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h
1.1 root 183:
1.1.1.6 root 184: integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h \
185: insn-flags.h insn-codes.h
1.1 root 186:
1.1.1.2 root 187: jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h
188: stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h
1.1 root 189:
1.1.1.9 root 190: cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
1.1.1.10! root 191: loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h recog.h flags.h
1.1.1.2 root 192: flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h
193: combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
194: insn-config.h regs.h basic-block.h recog.h
1.1.1.4 root 195: regclass.o : regclass.c $(CONFIG_H) $(RTL_H) flags.h regs.h \
196: insn-config.h recog.h hard-reg-set.h
197: local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h \
198: insn-config.h recog.h hard-reg-set.h
1.1.1.2 root 199: global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \
200: basic-block.h regs.h hard-reg-set.h insn-config.h
1.1 root 201:
1.1.1.2 root 202: reload.o : reload.c $(CONFIG_H) $(RTL_H) \
203: reload.h recog.h hard-reg-set.h insn-config.h regs.h
204: reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h \
205: reload.h regs.h hard-reg-set.h insn-config.h basic-block.h
1.1.1.6 root 206: final.o : final.c $(CONFIG_H) $(RTL_H) regs.h recog.h conditions.h gdbfiles.h \
207: insn-config.h
1.1.1.2 root 208: recog.o : recog.c $(CONFIG_H) $(RTL_H) \
209: regs.h recog.h hard-reg-set.h insn-config.h
1.1 root 210:
211: # Now the source files that are generated from the machine description.
212:
1.1.1.2 root 213: .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
214: insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c
215:
1.1 root 216: insn-config.h : md genconfig
1.1.1.2 root 217: ./genconfig md > tmp-insn-config.h
218: ./move-if-change tmp-insn-config.h insn-config.h
1.1 root 219:
220: insn-flags.h : md genflags
1.1.1.2 root 221: ./genflags md > tmp-insn-flags.h
222: ./move-if-change tmp-insn-flags.h insn-flags.h
1.1 root 223:
224: insn-codes.h : md gencodes
1.1.1.2 root 225: ./gencodes md > tmp-insn-codes.h
226: ./move-if-change tmp-insn-codes.h insn-codes.h
1.1 root 227:
1.1.1.2 root 228: insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h insn-config.h
229: $(CC) $(CFLAGS) -c insn-emit.c
1.1 root 230:
231: insn-emit.c : md genemit
1.1.1.2 root 232: ./genemit md > tmp-insn-emit.c
233: ./move-if-change tmp-insn-emit.c insn-emit.c
1.1 root 234:
235: insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h
1.1.1.2 root 236: $(CC) $(CFLAGS) -c insn-recog.c
1.1 root 237:
238: insn-recog.c : md genrecog
1.1.1.2 root 239: ./genrecog md > tmp-insn-recog.c
240: ./move-if-change tmp-insn-recog.c insn-recog.c
1.1 root 241:
242: insn-extract.o : insn-extract.c $(RTL_H)
1.1.1.2 root 243: $(CC) $(CFLAGS) -c insn-extract.c
1.1 root 244:
245: insn-extract.c : md genextract
1.1.1.2 root 246: ./genextract md > tmp-insn-extract.c
247: ./move-if-change tmp-insn-extract.c insn-extract.c
1.1 root 248:
1.1.1.2 root 249: insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h
250: $(CC) $(CFLAGS) -c insn-peep.c
251:
252: insn-peep.c : md genpeep
253: ./genpeep md > tmp-insn-peep.c
254: ./move-if-change tmp-insn-peep.c insn-peep.c
255:
256: 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
257: $(CC) $(CFLAGS) -c insn-output.c
1.1 root 258:
259: insn-output.c : md genoutput
1.1.1.2 root 260: ./genoutput md > tmp-insn-output.c
261: ./move-if-change tmp-insn-output.c insn-output.c
1.1 root 262:
263: # Now the programs that generate those files.
264:
1.1.1.7 root 265: genconfig : genconfig.o rtl.o $(LIBDEPS)
1.1.1.6 root 266: $(CC) $(CFLAGS) $(LDFLAGS) -o genconfig genconfig.o rtl.o $(LIBS)
1.1.1.2 root 267:
268: genconfig.o : genconfig.c $(RTL_H)
269: $(CC) $(CFLAGS) -c genconfig.c
1.1 root 270:
1.1.1.7 root 271: genflags : genflags.o rtl.o $(LIBDEPS)
1.1.1.6 root 272: $(CC) $(CFLAGS) $(LDFLAGS) -o genflags genflags.o rtl.o $(LIBS)
1.1 root 273:
1.1.1.2 root 274: genflags.o : genflags.c $(RTL_H)
275: $(CC) $(CFLAGS) -c genflags.c
1.1 root 276:
1.1.1.7 root 277: gencodes : gencodes.o rtl.o $(LIBDEPS)
1.1.1.6 root 278: $(CC) $(CFLAGS) $(LDFLAGS) -o gencodes gencodes.o rtl.o $(LIBS)
1.1 root 279:
1.1.1.2 root 280: gencodes.o : gencodes.c $(RTL_H)
281: $(CC) $(CFLAGS) -c gencodes.c
1.1 root 282:
1.1.1.7 root 283: genemit : genemit.o rtl.o $(LIBDEPS)
1.1.1.6 root 284: $(CC) $(CFLAGS) $(LDFLAGS) -o genemit genemit.o rtl.o $(LIBS)
1.1 root 285:
1.1.1.2 root 286: genemit.o : genemit.c $(RTL_H)
287: $(CC) $(CFLAGS) -c genemit.c
1.1 root 288:
1.1.1.7 root 289: genrecog : genrecog.o rtl.o $(LIBDEPS)
1.1.1.6 root 290: $(CC) $(CFLAGS) $(LDFLAGS) -o genrecog genrecog.o rtl.o $(LIBS)
1.1 root 291:
1.1.1.2 root 292: genrecog.o : genrecog.c $(RTL_H)
293: $(CC) $(CFLAGS) -c genrecog.c
1.1 root 294:
1.1.1.7 root 295: genextract : genextract.o rtl.o $(LIBDEPS)
1.1.1.6 root 296: $(CC) $(CFLAGS) $(LDFLAGS) -o genextract genextract.o rtl.o $(LIBS)
1.1 root 297:
1.1.1.2 root 298: genextract.o : genextract.c $(RTL_H)
299: $(CC) $(CFLAGS) -c genextract.c
1.1 root 300:
1.1.1.7 root 301: genpeep : genpeep.o rtl.o $(LIBDEPS)
1.1.1.6 root 302: $(CC) $(CFLAGS) $(LDFLAGS) -o genpeep genpeep.o rtl.o $(LIBS)
1.1 root 303:
1.1.1.2 root 304: genpeep.o : genpeep.c $(RTL_H)
305: $(CC) $(CFLAGS) -c genpeep.c
1.1 root 306:
1.1.1.7 root 307: genoutput : genoutput.o rtl.o $(LIBDEPS)
1.1.1.6 root 308: $(CC) $(CFLAGS) $(LDFLAGS) -o genoutput genoutput.o rtl.o $(LIBS)
1.1.1.2 root 309:
310: genoutput.o : genoutput.c $(RTL_H)
311: $(CC) $(CFLAGS) -c genoutput.c
1.1 root 312:
313: # Making the preprocessor
314: cpp: cccp
315: -rm -f cpp
316: ln cccp cpp
1.1.1.7 root 317: cccp: cccp.o cexp.o version.o $(LIBDEPS)
318: $(CC) $(CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1.1.1.2 root 319: cexp.o: cexp.c
320: cexp.c: cexp.y
321: $(BISON) cexp.y
322: mv cexp.tab.c cexp.c
1.1 root 323: cccp.o: cccp.c
1.1.1.5 root 324: $(CC) $(CFLAGS) -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \
325: -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" -c cccp.c
1.1 root 326:
1.1.1.4 root 327: cpp.info: cpp.texinfo
328: makeinfo $<
329:
1.1.1.10! root 330: gcc.info: gcc.texinfo
1.1.1.4 root 331: makeinfo $<
332:
1.1.1.2 root 333: # gnulib is not deleted because deleting it would be inconvenient
334: # for most uses of this target.
1.1 root 335: clean:
1.1.1.2 root 336: -rm -f $(STAGESTUFF) $(STAGE_GCC)
337: -rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
338: -rm -f core
339:
1.1.1.8 root 340: # Get rid of every file that's generated from some other file (except INSTALL).
341: realclean: clean
342: -rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs
343: -rm -f c-parse.tab.c c-parse.output errs gnulib cexp.c TAGS
344: -rm -f internals internals-* internals.?? internals.??s
345:
1.1.1.2 root 346: # Copy the files into directories where they will be run.
347: install: all
348: install cc1 $(libdir)/gcc-cc1
349: install -c -m 755 gnulib $(libdir)/gcc-gnulib
1.1.1.4 root 350: if [ -f /usr/bin/ranlib ] ; then ranlib $(libdir)/gcc-gnulib ;fi
1.1.1.2 root 351: install cpp $(libdir)/gcc-cpp
352: install gcc $(bindir)
1.1.1.6 root 353: -mkdir $(libdir)/gcc-include
1.1.1.8 root 354: cd $(libdir)/gcc-include; rm -f $(USER_H)
355: cp $(USER_H) $(libdir)/gcc-include
1.1 root 356:
357: # do make -f ../gcc/Makefile maketest DIR=../gcc
358: # in the intended test directory to make it a suitable test directory.
359: maketest:
360: ln -s $(DIR)/*.[chy] .
361: ln -s $(DIR)/*.def .
362: ln -s $(DIR)/*.md .
363: ln -s $(DIR)/.gdbinit .
364: -ln -s $(DIR)/bison.simple .
365: ln -s $(DIR)/gcc .
1.1.1.2 root 366: ln -s $(DIR)/move-if-change .
1.1 root 367: ln -s $(DIR)/Makefile test-Makefile
368: -rm tm.h aux-output.c
369: make -f test-Makefile clean
1.1.1.2 root 370: # You must create the necessary links tm.h, md and aux-output.c
371:
1.1.1.10! root 372: bootstrap: all force
! 373: $(MAKE) stage1
! 374: $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="-O $(CFLAGS)"
! 375: $(MAKE) stage2
! 376: $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="-O $(CFLAGS)"
! 377:
1.1.1.2 root 378: # Copy the object files from a particular stage into a subdirectory.
379: stage1: force
380: -mkdir stage1
381: mv $(STAGESTUFF) $(STAGE_GCC) stage1
1.1.1.10! root 382: -rm -f stage1/gnulib
1.1.1.8 root 383: -ln gnulib stage1 || cp gnulib stage1
1.1.1.2 root 384:
385: stage2: force
386: -mkdir stage2
387: mv $(STAGESTUFF) $(STAGE_GCC) stage2
1.1.1.10! root 388: -rm -f stage2/gnulib
1.1.1.8 root 389: -ln gnulib stage2 || cp gnulib stage2
1.1.1.2 root 390:
391: stage3: force
392: -mkdir stage3
393: mv $(STAGESTUFF) $(STAGE_GCC) stage3
1.1.1.10! root 394: -rm -f stage3/gnulib
1.1.1.8 root 395: -ln gnulib stage3 || cp gnulib stage3
396:
1.1.1.2 root 397: TAGS: force
1.1.1.9 root 398: mkdir temp
399: -mv c-parse.tab.c cexp.c temp
1.1.1.2 root 400: etags *.y *.h *.c
1.1.1.9 root 401: mv temp/* .
402: rmdir temp
403:
404: #In GNU Make, ignore whether `stage*' exists.
1.1.1.10! root 405: .PHONY: stage1 stage2 stage3 clean realclean TAGS bootstrap
! 406:
! 407: force:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.