Deleted Added
sdiff udiff text old ( 40457 ) new ( 45299 )
full compact
1#
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#
16CFLAGS+= -I${GCCDIR}/objc
17
18.include "../Makefile.inc"
19
20.PATH: ${GCCDIR} ${GCCDIR}/cp
21
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
40gen$i: gen$i.o rtl.o obstack.o bitmap.o
41 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
42
43GENSRCS+= gen$i.c
44CLEANFILES+= gen$i
45.endfor
46
47.for i in check genrtl
48build-tools: gen$i
49
50gen$i: gen$i.o
51 ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
52
53GENSRCS+= gen$i.c
54CLEANFILES+= gen$i
55.endfor
56
57genrtl.h genrtl.c: gengenrtl
58 ./gengenrtl genrtl.h genrtl.c
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
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#-----------------------------------------------------------------------
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
134COMMONHDRS= config.h hconfig.h options.h specs.h tconfig.h tm.h multilib.h
135GENSRCS+= ${COMMONHDRS}
136
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
144options.h:
145 echo '#include "cp/lang-options.h"' > ${.TARGET}
146 #echo '#include "f/lang-options.h"' >> ${.TARGET}
147
148specs.h:
149 echo '#include "cp/lang-specs.h"' > ${.TARGET}
150 #echo '#include "f/lang-specs.h"' >> ${.TARGET}
151
152tm.h:
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}
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
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
185# insn-*.h because these dependencies would be circular.
186#
187${OBJS}: ${SRCS:M*.h:Ninsn-*.h}
188
189# Give all dependencies on insn-*.h explicitly
190# This suffices for `make -j depend', and after that all
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
202.endif