Deleted Added
full compact
Makefile (40457) Makefile (45299)
1#
1#
2# $Id: Makefile,v 1.13 1998/08/20 21:45:46 jb Exp $
2# $Id: Makefile,v 1.16 1999/03/05 04:55:03 obrien Exp $
3#
4
5#
6# This could probably be merged with ../cc_int/Makefile, but bsd.lib.mk
7# is such a !@#!*#% nightmare because of how it reprograms the dependencies,
8# suffix rules, SRCS, etc. It's easiest to cheat by using bsd.prog.mk and
9# SRCS to get dependencies.
10#
11
12# ../Makefile.inc will put an absolute path to our objdir in CFLAGS.
13# Prevent mkdep from using it, so that we don't have to give rules for
14# aliases of generated headers.
15#
3#
4
5#
6# This could probably be merged with ../cc_int/Makefile, but bsd.lib.mk
7# is such a !@#!*#% nightmare because of how it reprograms the dependencies,
8# suffix rules, SRCS, etc. It's easiest to cheat by using bsd.prog.mk and
9# SRCS to get dependencies.
10#
11
12# ../Makefile.inc will put an absolute path to our objdir in CFLAGS.
13# Prevent mkdep from using it, so that we don't have to give rules for
14# aliases of generated headers.
15#
16CFLAGS+= -I.
16CFLAGS+= -I${GCCDIR}/objc
17
18.include "../Makefile.inc"
19
17
18.include "../Makefile.inc"
19
20#-----------------------------------------------------------------------
21# Bytecode components
20.PATH: ${GCCDIR} ${GCCDIR}/cp
22
21
23.for i in arity opcode opname
24build-tools: bi-$i
25
26bc-$i.h: bi-$i bytecode.def
27 ./bi-$i < ${GCCDIR}/bytecode.def > bc-$i.h
28
29bi-$i: bi-$i.o bi-parser.o bi-lexer.o bi-reverse.o
30 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
31
32GENSRCS+= bc-$i.h bi-$i.c
33CLEANFILES+= bi-$i
34.endfor
35
36.ORDER: bi-parser.c bi-parser.h
37bi-parser.c bi-parser.h: bi-parser.y
38 ${BISON} ${BISONFLAGS} -d ${.ALLSRC} -o bi-parser.c
39
40SRCS+= bi-lexer.c bi-reverse.c
41GENSRCS+= bi-parser.c bi-parser.h
42
43#-----------------------------------------------------------------------
44# insn-* gunk
45
46.for i in attr codes config flags
47insn-$i.h: gen$i ${MD_FILE}
48 ./gen$i ${MD_FILE} > insn-$i.h
49GENSRCS+= insn-$i.h
50.endfor
51
52.for i in attrtab emit extract opinit output peep recog
53insn-$i.c: gen$i ${MD_FILE}
54 ./gen$i ${MD_FILE} > insn-$i.c
55GENSRCS+= insn-$i.c
56.endfor
57
58.for i in attr codes config emit extract flags opinit output peep recog
59build-tools: gen$i
60
22#-----------------------------------------------------------------------
23# insn-* gunk
24
25.for i in attr codes config flags
26insn-$i.h: gen$i ${MD_FILE}
27 ./gen$i ${MD_FILE} > insn-$i.h
28GENSRCS+= insn-$i.h
29.endfor
30
31.for i in attrtab emit extract opinit output peep recog
32insn-$i.c: gen$i ${MD_FILE}
33 ./gen$i ${MD_FILE} > insn-$i.c
34GENSRCS+= insn-$i.c
35.endfor
36
37.for i in attr codes config emit extract flags opinit output peep recog
38build-tools: gen$i
39
61gen$i: gen$i.o rtl.o obstack.o
40gen$i: gen$i.o rtl.o obstack.o bitmap.o
62 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
63
64GENSRCS+= gen$i.c
65CLEANFILES+= gen$i
66.endfor
67
41 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
42
43GENSRCS+= gen$i.c
44CLEANFILES+= gen$i
45.endfor
46
68.for i in attrtab
47.for i in check genrtl
69build-tools: gen$i
70
48build-tools: gen$i
49
71gen$i: gen$i.o rtl.o rtlanal.o print-rtl.o obstack.o
50gen$i: gen$i.o
72 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
73
74GENSRCS+= gen$i.c
75CLEANFILES+= gen$i
76.endfor
77
51 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
52
53GENSRCS+= gen$i.c
54CLEANFILES+= gen$i
55.endfor
56
78SRCS+= print-rtl.c rtl.c rtlanal.c obstack.c
57genrtl.h genrtl.c: gengenrtl
58 ./gengenrtl genrtl.h genrtl.c
79
59
60#GENSRCS+= genrtl.c genrtl.h
61CLEANFILES+= genrtl.c genrtl.h
62
63.for i in attrtab
64build-tools: gen$i
65
66gen$i: gen$i.o rtl.o rtlanal.o print-rtl.o obstack.o bitmap.o
67 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
68
69GENSRCS+= gen$i.c
70CLEANFILES+= gen$i
71.endfor
72
73SRCS+= bitmap.c print-rtl.c rtl.c rtlanal.c obstack.c
80#-----------------------------------------------------------------------
81# C hash codes
82c-gperf.h: c-parse.gperf
83 gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
84 ${GCCDIR}/c-parse.gperf > ${.TARGET}
85GENSRCS+= c-gperf.h
86
87#-----------------------------------------------------------------------
88# C++ hash codes
89hash.h: gxx.gperf
90 gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
91 ${GCCDIR}/cp/gxx.gperf >hash.h
92GENSRCS+= hash.h
93
94#-----------------------------------------------------------------------
74#-----------------------------------------------------------------------
75# C hash codes
76c-gperf.h: c-parse.gperf
77 gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
78 ${GCCDIR}/c-parse.gperf > ${.TARGET}
79GENSRCS+= c-gperf.h
80
81#-----------------------------------------------------------------------
82# C++ hash codes
83hash.h: gxx.gperf
84 gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
85 ${GCCDIR}/cp/gxx.gperf >hash.h
86GENSRCS+= hash.h
87
88#-----------------------------------------------------------------------
89# common parser stuff
90
91.for i in c objc
92$i-parse.c: tree-check.h
93.endfor
94
95tree-check.h: gencheck
96 ./gencheck > ${.TARGET}
97
98##GENSRCS+= tree-check.h
99CLEANFILES+= tree-check.h
100
101#-----------------------------------------------------------------------
95# C parser
96.ORDER: c-parse.c c-parse.h
97c-parse.c c-parse.h: c-parse.in
98 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
99 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
100 ${GCCDIR}/c-parse.in > c-parse.y
101 ${BISON} -d c-parse.y -o c-parse.c
102 rm -f c-parse.y

--- 16 unchanged lines hidden (view full) ---

119
120#-----------------------------------------------------------------------
121# C++ parser done in its own makefile
122#-----------------------------------------------------------------------
123# CPP parser done in its own makefile
124#-----------------------------------------------------------------------
125# the host/target compiler config.
126
102# C parser
103.ORDER: c-parse.c c-parse.h
104c-parse.c c-parse.h: c-parse.in
105 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
106 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
107 ${GCCDIR}/c-parse.in > c-parse.y
108 ${BISON} -d c-parse.y -o c-parse.c
109 rm -f c-parse.y

--- 16 unchanged lines hidden (view full) ---

126
127#-----------------------------------------------------------------------
128# C++ parser done in its own makefile
129#-----------------------------------------------------------------------
130# CPP parser done in its own makefile
131#-----------------------------------------------------------------------
132# the host/target compiler config.
133
127COMMONHDRS= config.h hconfig.h options.h specs.h tconfig.h tm.h
134COMMONHDRS= config.h hconfig.h options.h specs.h tconfig.h tm.h multilib.h
128GENSRCS+= ${COMMONHDRS}
129
135GENSRCS+= ${COMMONHDRS}
136
130config.h hconfig.h tconfig.h:
131 echo '#include "${MACHINE_ARCH}/xm-freebsd.h"' > ${.TARGET}
137config.h hconfig.h:
138 echo '#include "auto-host.h"' > ${.TARGET}
139 echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"' >> ${.TARGET}
140
141tconfig.h:
142 echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"' > ${.TARGET}
143
132options.h:
133 echo '#include "cp/lang-options.h"' > ${.TARGET}
144options.h:
145 echo '#include "cp/lang-options.h"' > ${.TARGET}
146 #echo '#include "f/lang-options.h"' >> ${.TARGET}
147
134specs.h:
148specs.h:
135 echo '#include "cp/lang-specs.h"'> ${.TARGET}
136 echo '#include "f2c-specs.h"' >> ${.TARGET}
149 echo '#include "cp/lang-specs.h"' > ${.TARGET}
150 #echo '#include "f/lang-specs.h"' >> ${.TARGET}
151
137tm.h:
152tm.h:
138 echo '#include "${MACHINE_ARCH}/freebsd.h"' > ${.TARGET}
153 echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' > ${.TARGET}
154 echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET}
155 echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
156 echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
139
157
158multilib.h: genmultilib
159 echo 'static char *multilib_raw[] = {"aout maout;elf !maout;", NULL};' > multilib.h
160 echo 'static char *orig_port_multilib_raw[] = {".;", NULL};' >> multilib.h
161 echo 'static char *multilib_matches_raw[] = {NULL};' >> multilib.h
162 echo 'static char **multilib_extra = "";' >> multilib.h
163
140#-----------------------------------------------------------------------
141# General things.
142
143SRCS+= ${GENSRCS}
144CLEANFILES+= ${GENSRCS}
145
146all: ${SRCS}
147

--- 5 unchanged lines hidden (view full) ---

153# Set OBJS the same as bsd.prog.mk would do if we defined PROG. We can't
154# define PROG because we have multiple programs.
155#
156OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
157
158.if !exists(${DEPENDFILE})
159# Fudge pre-dependfile dependencies of objects the same as bsd.prog.mk
160# would do if we defined PROG, except for leaving out dependencies on
164#-----------------------------------------------------------------------
165# General things.
166
167SRCS+= ${GENSRCS}
168CLEANFILES+= ${GENSRCS}
169
170all: ${SRCS}
171

--- 5 unchanged lines hidden (view full) ---

177# Set OBJS the same as bsd.prog.mk would do if we defined PROG. We can't
178# define PROG because we have multiple programs.
179#
180OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
181
182.if !exists(${DEPENDFILE})
183# Fudge pre-dependfile dependencies of objects the same as bsd.prog.mk
184# would do if we defined PROG, except for leaving out dependencies on
161# bc-*.h and insn-*.h because these dependencies would be circular.
185# insn-*.h because these dependencies would be circular.
162#
186#
163${OBJS}: ${SRCS:M*.h:Nbc-*.h:Ninsn-*.h}
187${OBJS}: ${SRCS:M*.h:Ninsn-*.h}
164
188
165# Give all dependencies on bc-*.h and insn-*.h explicitly (none here for
166# bc-*.h). This suffices for `make -j<any> depend', and after that all
189# Give all dependencies on insn-*.h explicitly
190# This suffices for `make -j depend', and after that all
167# the dependencies will be in .depend since all .c source files are in
168# SRCS.
169#
170genattrtab.o genextract.o: insn-config.h
171insn-attrtab.o: insn-attr.h insn-config.h
172insn-emit.o: insn-codes.h insn-config.h insn-flags.h
173insn-opinit.o: insn-codes.h insn-config.h insn-flags.h
174insn-output.o: insn-attr.h insn-codes.h insn-config.h insn-flags.h
175insn-recog.o: insn-config.h
191# the dependencies will be in .depend since all .c source files are in
192# SRCS.
193#
194genattrtab.o genextract.o: insn-config.h
195insn-attrtab.o: insn-attr.h insn-config.h
196insn-emit.o: insn-codes.h insn-config.h insn-flags.h
197insn-opinit.o: insn-codes.h insn-config.h insn-flags.h
198insn-output.o: insn-attr.h insn-codes.h insn-config.h insn-flags.h
199insn-recog.o: insn-config.h
200
201genattr.o gencodes.o genconfig.o genemit.o genextract.o genflags.o genopinit.o genoutput.o genpeep.o genrecog.o: genrtl.h
176.endif
202.endif