Makefile revision 1.8.2.2 1 # $NetBSD: Makefile,v 1.8.2.2 2018/11/26 01:52:03 pgoyette Exp $
2
3 LIBISPRIVATE= yes
4
5 LIB= backend
6
7 SRCS= ${G_OBJS} ${G_out_file:T} regsub.c
8
9 # XXX: something misses these.
10 CLEANDIRFILES+= ${G_OBJS:.o=.d}
11
12 # Make sure we use the pre-generated C files
13 .l.c:
14 @true
15
16 BOTH_CPPFLAGS+= -I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*}
17 CPPFLAGS+= ${BOTH_CPPFLAGS} -DTARGET_NAME=\"${MACHINE_GNU_PLATFORM}\"
18 HOST_CPPFLAGS+= -I${HOST_LIBIBERTYOBJ}/libiberty
19 HOST_CPPFLAGS+= ${BOTH_CPPFLAGS} -DGENERATOR_FILE
20 DPSRCS+= insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h
21 DPSRCS+= ${DIST}/gcc/BASE-VER
22 CPPFLAGS+= -I${DIST}/libgcc
23 CPPFLAGS+= -I${.CURDIR}/../../lib/libgcc/libgcov/arch/${MACHINE_ARCH}
24
25 CPPFLAGS.cppdefault.c+= -DPREFIX=\"/usr\" \
26 -DNATIVE_SYSTEM_HEADER_DIR=\"${G_NATIVE_SYSTEM_HEADER_DIR}\"
27
28 HOST_CXXFLAGS+= -std=gnu++98
29
30 HOSTPROG_CXX= 1
31
32 .include <bsd.init.mk>
33
34 HOST_LIBIBERTYOBJ!= cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
35
36 .include <bsd.lib.mk>
37
38 # Force using C++ for this
39 ORIGHOST_CC:= ${HOST_CC}
40 HOST_CC:= ${HOST_CXX}
41 CC:= ${CXX}
42 CFLAGS:= ${CXXFLAGS}
43
44 # Check PREPROCESSOR_DEFINES for cppbuiltin.c and cppdefault.c
45 CPPFLAGS.cppbuiltin.c+= -DBASEVER="\"${BASEVER}"\"
46
47 #
48 # Independent generation programs.
49 #
50 CLEANFILES+= gengenrtl genrtl.h \
51 gengtype gtyp-gen.h gtype-desc.c gtype-desc.h \
52 gtype-c.h gtype-cp.h gtype-f.h gtype-objc.h \
53 genflags genflags.h \
54 gencheck tree-check.h \
55 insn-preds.c genpreds tm-preds.h tm_p.h cs-tm_p.h \
56 auto-host.h \
57 gt-*.h *.o *.lo \
58 cs-config.h \
59 gcov-iov gcov-iov.h \
60 gtype-go.h gtype.state \
61 pass-instances.def
62
63 # XXX
64 COPTS.varasm.c= -Wno-error
65
66 # XXX Override the normal rule to use HOST_COMPILE.cc
67 .c.lo:
68 ${_MKTARGET_COMPILE}
69 ${HOST_COMPILE.cc} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
70 mv ${.TARGET}.o ${.TARGET}
71
72 # Headers that host objects depend on (except gen*rtl*)
73 HH_NORTL= ${G_tm_file_list} ${G_build_xm_include_list}
74 HH= ${HH_NORTL} genrtl.h insn-modes.h
75
76 #
77 # Generate the various header files we need.
78 #
79 genrtl.h: gengenrtl
80 ${_MKTARGET_CREATE}
81 ./gengenrtl >${.TARGET}
82 gengenrtl.lo: ${HH_NORTL}
83 gengenrtl: gengenrtl.lo build-errors.lo
84 ${_MKTARGET_LINK}
85 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
86
87 insn-preds.c: genpreds ${G_md_file}
88 ${_MKTARGET_CREATE}
89 ./genpreds ${G_md_file} >${.TARGET}
90 tm-preds.h: genpreds ${G_md_file}
91 ${_MKTARGET_CREATE}
92 ./genpreds -h ${G_md_file} >${.TARGET}
93 tm-constrs.h: genpreds ${G_md_file}
94 ${_MKTARGET_CREATE}
95 ./genpreds -c ${G_md_file} >${.TARGET}
96
97 # be nice to generate this entirely; but difficult.
98 gtyp-input.list.tmp: ${GCCARCH}/gtyp-input.list
99 sed s#SRCDIR#${DIST}# < ${.ALLSRC} > ${.TARGET}
100 CLEANFILES+= gtyp-input.list.tmp
101
102 # XXX
103 CLEANFILES+= gtype-lto.h gtype-objcp.h tm-constrs.h gtype-jit.h
104
105 gtype-desc.c: gtype-desc.h
106 gtype-desc.h: gengtype gtyp-input.list.tmp
107 ${_MKTARGET_CREATE}
108 rm -f auto-host.h
109 ln -s ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/auto-host.h .
110 if [ -f ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/sysroot-suffix.h ]; then \
111 rm -f sysroot-suffix.h; \
112 ln -s ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/sysroot-suffix.h ; \
113 fi
114 ./gengtype -S ${DIST}/gcc -I gtyp-input.list.tmp -w gtype.state
115 ./gengtype -r gtype.state
116 # GCC 4.8 installs gtype-state and gengtype as a plugin
117
118 # gengtype is the real need for options.h
119 gengtype.lo gengtype-lex.lo gengtype-parse.lo gengtype-state.lo version.lo: ${HH} gtyp-gen.h config.h options.h
120 gengtype: gengtype.lo gengtype-lex.lo gengtype-parse.lo gengtype-state.lo build-errors.lo version.lo
121 ${_MKTARGET_LINK}
122 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
123
124 # XXX fix this by properly marking all the files that should
125 # XXX be built with -DGENERATOR_FILE
126 COPTS.gengtype-lex.c= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
127 COPTS.gengtype-parse.c= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
128 COPTS.gengtype-state.c= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
129 COPTS.gengtype.c= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
130
131 gtyp-gen.h: Makefile
132 ${_MKTARGET_CREATE}
133 (\
134 unset empty ; \
135 echo "static const char *srcdir = \"$(G_GTFILES_SRCDIR)\";" ; \
136 echo "static const char *lang_files[] = {" ; \
137 for f in $$empty $(G_GTFILES_FILES_FILES); do echo "\"$$f\", "; done ; \
138 echo "NULL };" ; \
139 echo "static const char *langs_for_lang_files[] = {" ; \
140 for f in $$empty $(G_GTFILES_FILES_LANGS); do echo "\"$$f\", "; done ; \
141 echo "NULL };" ; \
142 echo "static const char *all_files[] = {" ; \
143 for f in $$empty $(G_GTFILES); do echo "\"$$f\", "; done ; \
144 echo " NULL };" ; \
145 echo "static const char *lang_dir_names[] = {" ; \
146 for f in c $(G_GTFILES_LANG_DIR_NAMES); do echo "\"$$f\", "; done ; \
147 echo "NULL };" ; \
148 ) >${.TARGET}
149
150 insn-modes.c: genmodes
151 ${_MKTARGET_CREATE}
152 ./genmodes >${.TARGET}
153 insn-modes.h-test: genmodes
154 ${_MKTARGET_CREATE}
155 ./genmodes -h >${.TARGET}
156 # Ensure that the checked in version matches
157 if ! cmp ${.TARGET} ${.CURDIR}/../gcc/arch/${MACHINE_ARCH}/insn-modes.h; then
158 echo "Checked in insn-modes.h does not match; rerun mknative-gcc." 1>&2
159 false
160 fi
161 min-insn-modes.c: genmodes
162 ${_MKTARGET_CREATE}
163 ./genmodes -m >${.TARGET}
164 genmodes.lo: ${HH_NORTL}
165 genmodes: genmodes.lo build-errors.lo
166 ${_MKTARGET_LINK}
167 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
168
169 CLEANFILES+= genmodes insn-modes.c insn-modes.h-test min-insn-modes.c
170
171 gimple-match.c: genmatch cfn-operators.pd
172 ./genmatch --gimple ${GNUHOSTDIST}/gcc/match.pd > gimple-match.c.tmp
173 mv gimple-match.c.tmp gimple-match.c
174 generic-match.c: genmatch cfn-operators.pd
175 ./genmatch --generic ${GNUHOSTDIST}/gcc/match.pd > generic-match.c.tmp
176 mv generic-match.c.tmp generic-match.c
177 genmatch.lo: ${HH_NORTL} ${G_GGC_H}
178 genmatch: genmatch.lo build-errors.lo build-vec.lo build-hash-table.lo
179 ${_MKTARGET_LINK}
180 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBCPP} ${HOSTLIBIBERTY}
181
182 CLEANFILES+= genmatch gimple-match.c generic-match.c
183
184 gcov-iov.h: gcov-iov
185 ${_MKTARGET_CREATE}
186 ./gcov-iov "${BASEVER}" "${DEVPHASE}" >${.TARGET}
187 gcov-iov.lo: ${HH_NORTL}
188 gcov-iov: gcov-iov.lo
189 ${_MKTARGET_CREATE}
190 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
191
192 tm_p.h: Makefile tm-preds.h
193 ${_MKTARGET_CREATE}
194 TARGET_CPU_DEFAULT="" \
195 HEADERS="$(G_tm_p_include_list)" DEFINES="" \
196 ${HOST_SH} ${GNUHOSTDIST}/gcc/mkconfig.sh ${.TARGET}
197
198 # XXX crude
199 ${G_OBJS} ${G_OBJS:.o=.d}: tm.h tm_p.h insn-opinit.h
200
201 .include "../Makefile.options"
202
203 # Yuck, we have to run configure to generate this one...
204 # We use ORIGHOST_CC here because GCC's ./configure expects (and
205 # depends upon) it.
206 CLEANFILES+= auto-build.h
207 HOST_CFLAGS+= -I${.OBJDIR}
208 HOST_CXXFLAGS+= -I${.OBJDIR}
209
210 # Set this to "true" to leave .ab around
211 HOST_AB_CLEAN?= rm -rf .ab
212
213 auto-build.h: gmp.h Makefile
214 ${_MKTARGET_CREATE}
215 rm -rf .ab && \
216 mkdir .ab && \
217 (cd .ab && \
218 AWK=${TOOL_AWK:Q} \
219 CC=${ORIGHOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
220 CXX=${HOST_CXX:Q} CXXFLAGS=${HOST_CXXFLAGS:Q} \
221 MAKE=${TOOL_GMAKE:Q} \
222 CONFIG_SHELL=${HOST_SH:Q} \
223 gcc_cv_ld=${LD:Q} \
224 gcc_cv_as=${AS:Q} \
225 ${HOST_SH} ${GNUHOSTDIST}/gcc/configure \
226 --build=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
227 --host=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
228 --target=${MACHINE_GNU_PLATFORM} && \
229 mv auto-host.h ../auto-build.h) && \
230 ${HOST_AB_CLEAN}
231
232 pass-instances.def: passes.def gen-pass-instances.awk
233 ${_MKTARGET_CREATE}
234 ${TOOL_AWK} -f ${GNUHOSTDIST}/gcc/gen-pass-instances.awk \
235 ${GNUHOSTDIST}/gcc/passes.def > pass-instances.def
236 CLEANFILES+= pass-instances.def
237
238 #
239 # These are copies of files we build for the build host that are used
240 # by the genfoo programs.
241 #
242
243 build-rtl.c: rtl.c \
244 ${G_RTL_H} real.h ${G_GCC_H} ${G_RTL_BASE_H} ${G_GGC_H} errors.h
245 ${_MKTARGET_CREATE}
246 rm -f build-rtl.c
247 ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
248 ${GNUHOSTDIST}/gcc/rtl.c >${.TARGET}
249 build-rtl.lo: ${HH} insn-constants.h
250 CLEANFILES+= build-rtl.c
251
252 build-print-rtl.c: print-rtl.c \
253 ${G_RTL_BASE_H} ${G_GTM_H} hard-reg-set.h
254 ${_MKTARGET_CREATE}
255 rm -f build-print-rtl.c
256 ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
257 ${GNUHOSTDIST}/gcc/print-rtl.c >${.TARGET}
258 build-print-rtl.lo: ${HH}
259 build-print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
260 $(GTM_H) $(RTL_BASE_H)
261 CLEANFILES+= build-print-rtl.c
262
263 build-bitmap.c: bitmap.c \
264 ${G_RTL_H} flags.h ${G_BASIC_BLOCK_H} ${REGS_H} ${G_GCC_H} ${G_GGC_H}
265 ${_MKTARGET_CREATE}
266 rm -f build-bitmap.c
267 ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
268 ${GNUHOSTDIST}/gcc/bitmap.c >${.TARGET}
269 build-bitmap.lo: ${HH}
270 CLEANFILES+= build-bitmap.c
271
272 build-errors.c: errors.c errors.h
273 ${_MKTARGET_CREATE}
274 rm -f build-errors.c
275 cat ${GNUHOSTDIST}/gcc/errors.c >${.TARGET}
276 build-errors.lo: ${HH_NORTL}
277 CLEANFILES+= build-errors.c
278
279 build-varray.c: varray.c \
280 ${G_RTL_H} ${G_GCC_H} ${TREE_H} bitmap.h errors.h
281 ${_MKTARGET_CREATE}
282 rm -f build-varray.c
283 ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
284 ${GNUHOSTDIST}/gcc/varray.c >${.TARGET}
285 build-varray.lo: ${HH} gtype-desc.h
286 CLEANFILES+= build-varray.c
287
288 build-ggc-none.c: ggc-none.c \
289 ${G_GCC_H} gtype-desc.h
290 ${_MKTARGET_CREATE}
291 rm -f build-ggc-none.c
292 ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
293 ${GNUHOSTDIST}/gcc/ggc-none.c >${.TARGET}
294 build-ggc-none.lo: ${HH}
295 CLEANFILES+= build-ggc-none.c
296
297 build-hash-table.c: hash-table.c hash-table.h ${G_GGC_H}
298 ${_MKTARGET_CREATE}
299 rm -f build-hash-table.c
300 cat ${GNUHOSTDIST}/gcc/hash-table.c >${.TARGET}
301 build-hash-table.lo: ${HH_NORTL}
302 CLEANFILES+= build-hash-table.c
303
304 build-vec.c: vec.c vec.h ${G_GGC_H}
305 ${_MKTARGET_CREATE}
306 rm -f build-vec.c
307 cat ${GNUHOSTDIST}/gcc/vec.c >${.TARGET}
308 build-vec.lo: ${HH_NORTL}
309 CLEANFILES+= build-vec.c
310
311 build-genattrtab.o: ${G_GGC_H}
312
313 #
314 # The normal insn-foo generators
315 #
316 .for f in gensupport.c read-rtl.c dummy-conditions.c
317 ${f:R}.lo: ${HH}
318 .endfor
319
320 #
321 # There are 5 main classes of generator programs. Ones
322 # that are self contained, ones that use error reporting
323 # mechanisms, ones that use the MD reader, and ones that
324 # use the RTL reader.
325 #
326 GENPROG_ERROR_DEPENDS= ${G_BUILD_ERRORS:.o=.lo}
327 GENPROG_READER_DEPENDS= ${G_BUILD_MD:.o=.lo} ${GENPROG_ERROR_DEPENDS}
328 GENPROG_RTL_DEPENDS= ${G_BUILD_RTL:.o=.lo} ${GENPROG_READER_DEPENDS} ${GENPROG_ERROR_DEPENDS}
329
330 #
331 # First we generate the rules for the generators.
332 #
333 .for f in attr attr-common attrtab automata codes conditions config emit \
334 extract flags opinit output peep preds recog mddump condmd \
335 target-def cfn-macros
336 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
337 gen${f}: gen${f}.lo ${GENPROG_RTL_DEPENDS}
338 ${_MKTARGET_LINK}
339 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
340 CLEANFILES+= gen${f} gen${f}.lo
341 .endfor
342
343 .for f in mddeps constants enums
344 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
345 gen${f}: gen${f}.lo ${GENPROG_READER_DEPENDS}
346 ${_MKTARGET_LINK}
347 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
348 CLEANFILES+= gen${f} gen${f}.lo
349 .endfor
350
351 .for f in check checksum
352 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
353 gen${f}: gen${f}.lo
354 ${_MKTARGET_LINK}
355 ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
356 CLEANFILES+= gen${f} gen${f}.lo
357 .endfor
358
359 .include "../../Makefile.hooks"
360
361 #
362 # Second we generate the rules for the generated files. There
363 # are 3 main classes: RTL based or not, plus special cases.
364 #
365 # The special cases are: gencheck, genattrtab, genopinit,
366 # gencondmd
367 #
368
369 # RTL based files
370 .for f in attr.h attr-common.h codes.h config.h flags.h \
371 automata.c emit.c extract.c output.c peep.c recog.c \
372 target-def.h
373 insn-${f}: gen${f:R} ${G_md_file} insn-conditions.md
374 ${_MKTARGET_CREATE}
375 ./gen${f:R} ${G_md_file} insn-conditions.md >${.TARGET}
376 CLEANFILES+= insn-${f}
377 .endfor
378
379 # normal files
380 .for f in constants.h enums.c
381 insn-${f}: gen${f:R} ${G_md_file}
382 ${_MKTARGET_CREATE}
383 ./gen${f:R} ${G_md_file} >${.TARGET}
384 CLEANFILES+= insn-${f}
385 .endfor
386
387 # genconditions outputs gencondmd.c
388 gencondmd.c: genconditions ${G_md_file}
389 ${_MKTARGET_CREATE}
390 ./genconditions ${G_md_file} >${.TARGET}
391 CLEANFILES+= gencondmd.c
392
393 # gencheck outputs tree-check.h
394 tree-check.h: gencheck
395 ${_MKTARGET_CREATE}
396 ./gencheck >${.TARGET}
397 CLEANFILES+= tree-check.h
398
399 # genattrtab has three output files
400 insn-dfatab.c insn-latencytab.c: insn-attrtab.c
401 cp -p ${.TARGET}.tmp ${.TARGET}
402 insn-attrtab.c: genattrtab ${G_md_file} insn-conditions.md
403 ${_MKTARGET_CREATE}
404 ./genattrtab ${G_md_file} insn-conditions.md \
405 -A${.TARGET}.tmp -Dinsn-dfatab.c.tmp -Linsn-latencytab.c.tmp && \
406 mv ${.TARGET}.tmp ${.TARGET}
407 CLEANFILES+= insn-attrtab.c insn-dfatab.c insn-latencytab.c
408
409 # genopinit has two output files
410 insn-opinit.h: insn-opinit.c
411 cp -p ${.TARGET}.tmp ${.TARGET}
412 insn-opinit.c: genopinit ${G_md_file} insn-conditions.md
413 ${_MKTARGET_CREATE}
414 ./genopinit ${G_md_file} insn-conditions.md \
415 -hinsn-opinit.h.tmp -c${.TARGET}.tmp && \
416 mv ${.TARGET}.tmp ${.TARGET}
417 CLEANFILES+= insn-opinit.h insn-opinit.c
418
419 LDFLAGS.genautomata+= -lm
420
421 # gencondmd outputs a special .md file
422 insn-conditions.md: gencondmd
423 ./gencondmd >${.TARGET}
424 CLEANFILES+= insn-conditions.md
425
426 # build params.list for params.h.
427 params.h: params.list
428 ${SRCS}: params.list
429 params-list.h: params.def
430 params.list: params-list.h
431 ${CPP} ${.ALLSRC} | sed 's/^#.*//;/^$$/d' > params.list.tmp && \
432 mv params.list.tmp params.list
433 CLEANFILES+= params.list.tmp params.list
434
435 # build case-cfn-macros.h and cfn-operators.pd
436 case-cfn-macros.h: gencfn-macros
437 ./gencfn-macros -c > case-cfn-macros.h.tmp && \
438 mv case-cfn-macros.h.tmp case-cfn-macros.h
439 cfn-operators.pd: gencfn-macros
440 ./gencfn-macros -o > cfn-operators.pd.tmp && \
441 mv cfn-operators.pd.tmp cfn-operators.pd
442 CLEANFILES+= case-cfn-macros.h.tmp case-cfn-macros.h \
443 cfn-operators.pd.tmp cfn-operators.pd
444
445 CASECFNDEPS= aarch64-builtins.c arm-builtins.c i386.c rs6000.c builtins.c \
446 fold-const.c tree-ssa-math-opts.c tree-ssa-reassoc.c \
447 tree-vect-patterns.c tree-vrp.c generic-match-head.c \
448 gimple-match-head.c ChangeLog-2015 fold-const-call.c \
449 gimple-ssa-backprop.c
450 ${CASECFNDEPS}: case-cfn-macros.h
451
452 aarch64-builtin-iterators.h: ${DIST}/gcc/config/aarch64/geniterators.sh \
453 ${DIST}/gcc/config/aarch64/iterators.md
454 $(HOST_SH) ${.ALLSRC} > ${.TARGET}
455
456 CLEANFILES+= aarch-builtin-iterators.h
457
458 #
459 # Required hard-coded dependancies.
460 #
461 aarch64-builtins.o: aarch64-builtin-iterators.h
462 tm.h: insn-constants.h
463 genextract.lo: insn-config.h
464 gencondmd.lo: tm_p.h tm-constrs.h
465 read-rtl.lo gencodes.lo genattrtab.lo genautomata.lo: tm.h gtype-desc.h
466 genattr-common.lo gensupport.lo genconditions.lo gentarget-def.lo: tm.h
467 genattr.lo genflags.lo genemit.lo genconfig.lo gencheck.lo: gtype-desc.h tm.h
468 genopinit.lo genrecog.lo genpreds.lo genoutput.lo genpeep.lo: tm.h
469 build-ggc-none.lo: gtype-desc.h
470 ggc-none.o: gtype-desc.h
471 insn-attrtab.o: insn-config.h
472 insn-extract.o: insn-config.h
473 toplev.d toplev.o: options.h
474 coverage.d: gcov-iov.h
475 gcov-io.h: gcov-iov.h
476 cgraph.d cgraphunit.d cgraphunit.o: gcov-io.h
477 vec.lo: gtype-desc.h
478 insn-emit.d insn-emit.o: tm-constrs.h
479 insn-attr.h: insn-attr-common.h
480 gcov-io.h: gcov-iov.h
481 df-scan.d df-scan.o: target-hooks-def.h
482 read-md.d read-md.o read-md.lo: auto-build.h
483 hash-table.d hash-table.o hash-table.lo: auto-build.h gtype-desc.h
484 gencfn-macros.d gencfn-macros.o gencfn-macros.lo: gtype-desc.h
485 pass_manager.h passes.c: pass-instances.def
486 context.d coverage.d lto-cgraph.d passes.d statistics.d toplev.d cgraphunit.d: pass_manager.h
487 context.o coverage.o lto-cgraph.o passes.o statistics.o toplev.o cgraphunit.o: pass_manager.h
488 insn-opinit.o insn-opinit.d: insn-flags.h
489 .for _f in insn-attrtab insn-automata insn-dfatab insn-latencytab insn-output
490 ${_f}.o ${_f}.d: insn-attr-common.h insn-attr.h
491 .endfor
492 .for _f in insn-attrtab insn-automata insn-dfatab insn-emit insn-extract \
493 insn-latencytab insn-opinit insn-output insn-peep insn-preds \
494 insn-recog
495 ${_f}.o ${_f}.d: insn-codes.h insn-config.h insn-constants.h insn-flags.h
496 .endfor
497 .for _f in insn-enums insn-modes
498 ${_f}.o ${_f}.d: insn-constants.h
499 .endfor
500 .for _f in data-streamer data-streamer-out coverage gcov-dump gcov-io \
501 gcov-iov gcov libgcov lto-cgraph mcf modulo-sched profile value-prof
502 ${_f}.o ${_f}.d: gcov-io.h
503 .endfor
504
505 ${G_out_file:T:.c=.o}: insn-target-def.h target-hooks-def.h tm-constrs.h
506
507 # XXX make all hooks generated for now.
508 final.o: target-hooks-def.h c-family/c-target-hooks-def.h common/common-target-hooks-def.h
509
510 .if ${MACHINE_CPU} == "arm"
511 # XXX insn-recog.c:10304:7: error: this decimal constant is unsigned only in ISO C90 [-Werror]
512 COPTS.insn-recog.c+=-Wno-error
513 .endif
514
515 .if ${GCC_MACHINE_ARCH} == "i386" || ${GCC_MACHINE_ARCH} == "x86_64"
516 i386.d i386.o: pass_manager.h
517 .endif
518
519 .if ${MACHINE_CPU} == "mips"
520 # XXX mips.md:3474:11: error: this decimal constant is unsigned only in ISO C90 [-Werror]
521 COPTS.insn-recog.c+=-Wno-error
522 .endif
523
524 .if ${GCC_MACHINE_ARCH} == "vax"
525 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
526 COPTS.builtins.c+=-O0
527 COPTS.convert.c+=-O0
528 COPTS.dwarf2out.c+=-O0
529 COPTS.dse.c+=-O0 # XXX port-vax/51967
530 COPTS.expmed.c+=-O0
531 COPTS.expr.c+=-O0 -Wno-error=tautological-compare
532 COPTS.fixed-value.c+=-O0
533 COPTS.fold-const.c+=-O0
534 COPTS.gimple-fold.c+=-O0
535 COPTS.gimple-ssa-strength-reduction.c+=-O0
536 COPTS.gimple.c+=-O0
537 COPTS.internal-fn.c+=-O0
538 COPTS.lto-streamer-out.c+=-O0
539 COPTS.omp-low.c+=-O0
540 COPTS.predict.c+=-O0
541 COPTS.recog.c+=-O0
542 COPTS.sanopt.c+=-O0
543 COPTS.stmt.c+=-O0
544 COPTS.stor-layout.c+=-O0
545 COPTS.targhooks.c+=-O0
546 COPTS.tree-affine.c+=-O0
547 COPTS.tree-cfg.c+=-O0
548 COPTS.tree-eh.c+=-O0
549 COPTS.tree-object-size.c+=-O0
550 COPTS.tree-parloops.c+=-O0
551 COPTS.tree-predcom.c+=-O0
552 COPTS.tree-pretty-print.c+=-O0
553 COPTS.tree-ssa-alias.c+=-O0
554 COPTS.tree-ssa-ccp.c+=-O0
555 COPTS.tree-ssa-forwprop.c+=-O0
556 COPTS.tree-ssa-loop-ivopts.c+=-O0
557 COPTS.tree-ssa-loop-manip.c+=-O0
558 COPTS.tree-ssa-loop-niter.c+=-O0
559 COPTS.tree-ssa-math-opts.c+=-O0
560 COPTS.tree-ssa-pre.c+=-O0
561 COPTS.tree-ssa-reassoc.c+=-O0
562 COPTS.tree-ssa-uninit.c+=-O0
563 COPTS.tree-switch-conversion.c+=-O0
564 COPTS.tree-vect-data-refs.c+=-O0
565 COPTS.tree-vect-loop-manip.c+=-O0
566 COPTS.tree-vect-patterns.c+=-O0
567 COPTS.tree-vect-stmts.c+=-O0
568 COPTS.tree-vrp.c+=-O0
569 COPTS.tree.c+=-O0
570 COPTS.ubsan.c+=-O0
571 COPTS.varasm.c+=-O0
572 COPTS.wide-int.cc+=-O0
573 .else
574 COPTS.tree.c= ${${ACTIVE_CC} == "clang" :? -O0 :}
575 .endif
576
577 CFLAGS+= -Wno-stack-protector
578
579 .if ${GCC_MACHINE_ARCH} == "m68000" || ${GCC_MACHINE_ARCH} == "m68k" || \
580 ${GCC_MACHINE_ARCH} == "coldfire"
581 COPTS.tree-loop-distribution.c+=-O2
582 COPTS.generic-match.c+=-fno-jump-tables
583 COPTS.gimple-match.c+=-fno-jump-tables
584 .endif
585
586 # Don't fight with decimal128Local.h.
587 # The GCC build only ignores the warning?
588 COPTS.dfp.c+= -fno-strict-aliasing
589
590 CFLAGS+= -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
591
592 .PATH: ${DIST}/gcc ${DIST}/libiberty ${GCCARCH} ${G_out_file:H} ${DIST}/include
593 .PATH: ${DIST}/gcc/config
594 .if ${MACHINE_ARCH} == "aarch64"
595 .PATH: ${DIST}/gcc/config/arm
596 .endif
597