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