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