Home | History | Annotate | Line # | Download | only in backend
Makefile revision 1.48
      1 #	$NetBSD: Makefile,v 1.48 2018/04/13 01:14:19 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 # XXX crude
    198 ${G_OBJS} ${G_OBJS:.o=.d}:	tm.h tm_p.h insn-opinit.h
    199 
    200 .include "../Makefile.options"
    201 
    202 # Yuck, we have to run configure to generate this one...
    203 # We use ORIGHOST_CC here because GCC's ./configure expects (and
    204 # depends upon) it.
    205 CLEANFILES+=	auto-build.h
    206 HOST_CFLAGS+= -I${.OBJDIR}
    207 HOST_CXXFLAGS+= -I${.OBJDIR}
    208 
    209 # Set this to "true" to leave .ab around
    210 HOST_AB_CLEAN?=	rm -rf .ab
    211 
    212 auto-build.h: gmp.h Makefile
    213 	${_MKTARGET_CREATE}
    214 	rm -rf .ab && \
    215 	mkdir .ab && \
    216 	(cd .ab && \
    217 		AWK=${TOOL_AWK:Q} \
    218 		CC=${ORIGHOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
    219 		CXX=${HOST_CXX:Q} CXXFLAGS=${HOST_CXXFLAGS:Q} \
    220 		MAKE=${TOOL_GMAKE:Q} \
    221 		CONFIG_SHELL=${HOST_SH:Q} \
    222 		gcc_cv_ld=${LD:Q} \
    223 		gcc_cv_as=${AS:Q} \
    224 		${HOST_SH} ${GNUHOSTDIST}/gcc/configure \
    225 			--build=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
    226 			--host=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
    227 			--target=${MACHINE_GNU_PLATFORM} && \
    228 		mv auto-host.h ../auto-build.h) && \
    229 	${HOST_AB_CLEAN}
    230 
    231 pass-instances.def: passes.def gen-pass-instances.awk
    232 	${_MKTARGET_CREATE}
    233 	${TOOL_AWK} -f ${GNUHOSTDIST}/gcc/gen-pass-instances.awk \
    234 	  ${GNUHOSTDIST}/gcc/passes.def > pass-instances.def
    235 CLEANFILES+=	pass-instances.def
    236 
    237 #
    238 # These are copies of files we build for the build host that are used
    239 # by the genfoo programs.
    240 #
    241 
    242 build-rtl.c: rtl.c \
    243   ${G_RTL_H} real.h ${G_GCC_H} ${G_RTL_BASE_H} ${G_GGC_H} errors.h
    244 	${_MKTARGET_CREATE}
    245 	rm -f build-rtl.c
    246 	${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
    247 		${GNUHOSTDIST}/gcc/rtl.c >${.TARGET}
    248 build-rtl.lo: ${HH} insn-constants.h
    249 CLEANFILES+=	build-rtl.c
    250 
    251 build-print-rtl.c: print-rtl.c \
    252   ${G_RTL_BASE_H} ${G_GTM_H} hard-reg-set.h
    253 	${_MKTARGET_CREATE}
    254 	rm -f build-print-rtl.c
    255 	${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
    256 		${GNUHOSTDIST}/gcc/print-rtl.c >${.TARGET}
    257 build-print-rtl.lo: ${HH}
    258 build-print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h     \
    259   $(GTM_H) $(RTL_BASE_H)
    260 CLEANFILES+=	build-print-rtl.c
    261 
    262 build-bitmap.c: bitmap.c \
    263   ${G_RTL_H} flags.h ${G_BASIC_BLOCK_H} ${REGS_H} ${G_GCC_H} ${G_GGC_H}
    264 	${_MKTARGET_CREATE}
    265 	rm -f build-bitmap.c
    266 	${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
    267 		${GNUHOSTDIST}/gcc/bitmap.c >${.TARGET}
    268 build-bitmap.lo: ${HH}
    269 CLEANFILES+=	build-bitmap.c
    270 
    271 build-errors.c: errors.c errors.h
    272 	${_MKTARGET_CREATE}
    273 	rm -f build-errors.c
    274 	cat ${GNUHOSTDIST}/gcc/errors.c >${.TARGET}
    275 build-errors.lo: ${HH_NORTL}
    276 CLEANFILES+=	build-errors.c
    277 
    278 build-varray.c: varray.c \
    279   ${G_RTL_H} ${G_GCC_H} ${TREE_H} bitmap.h errors.h
    280 	${_MKTARGET_CREATE}
    281 	rm -f build-varray.c
    282 	${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
    283 		${GNUHOSTDIST}/gcc/varray.c >${.TARGET}
    284 build-varray.lo: ${HH} gtype-desc.h
    285 CLEANFILES+=	build-varray.c
    286 
    287 build-ggc-none.c: ggc-none.c \
    288   ${G_GCC_H} gtype-desc.h
    289 	${_MKTARGET_CREATE}
    290 	rm -f build-ggc-none.c
    291 	${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
    292 		${GNUHOSTDIST}/gcc/ggc-none.c >${.TARGET}
    293 build-ggc-none.lo: ${HH}
    294 CLEANFILES+=	build-ggc-none.c
    295 
    296 build-hash-table.c: hash-table.c hash-table.h ${G_GGC_H}
    297 	${_MKTARGET_CREATE}
    298 	rm -f build-hash-table.c
    299 	cat ${GNUHOSTDIST}/gcc/hash-table.c >${.TARGET}
    300 build-hash-table.lo: ${HH_NORTL}
    301 CLEANFILES+=	build-hash-table.c
    302 
    303 build-vec.c: vec.c vec.h ${G_GGC_H}
    304 	${_MKTARGET_CREATE}
    305 	rm -f build-vec.c
    306 	cat ${GNUHOSTDIST}/gcc/vec.c >${.TARGET}
    307 build-vec.lo: ${HH_NORTL}
    308 CLEANFILES+=	build-vec.c
    309 
    310 build-genattrtab.o: ${G_GGC_H}
    311 
    312 #
    313 # The normal insn-foo generators
    314 #
    315 .for f in gensupport.c read-rtl.c dummy-conditions.c
    316 ${f:R}.lo: ${HH}
    317 .endfor
    318 
    319 #
    320 # There are 5 main classes of generator programs.  Ones
    321 # that are self contained, ones that use error reporting
    322 # mechanisms, ones that use the MD reader, and ones that
    323 # use the RTL reader.
    324 #
    325 GENPROG_ERROR_DEPENDS=	${G_BUILD_ERRORS:.o=.lo}
    326 GENPROG_READER_DEPENDS=	${G_BUILD_MD:.o=.lo} ${GENPROG_ERROR_DEPENDS}
    327 GENPROG_RTL_DEPENDS=	${G_BUILD_RTL:.o=.lo} ${GENPROG_READER_DEPENDS} ${GENPROG_ERROR_DEPENDS}
    328 
    329 #
    330 # First we generate the rules for the generators.
    331 #
    332 .for f in attr attr-common attrtab automata codes conditions config emit \
    333 	  extract flags opinit output peep preds recog mddump condmd \
    334 	  target-def cfn-macros
    335 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
    336 gen${f}: gen${f}.lo ${GENPROG_RTL_DEPENDS} 
    337 	${_MKTARGET_LINK}
    338 	${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
    339 CLEANFILES+=	gen${f} gen${f}.lo
    340 .endfor
    341 
    342 .for f in mddeps constants enums
    343 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
    344 gen${f}: gen${f}.lo ${GENPROG_READER_DEPENDS}
    345 	${_MKTARGET_LINK}
    346 	${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
    347 CLEANFILES+=	gen${f} gen${f}.lo
    348 .endfor
    349 
    350 .for f in check checksum
    351 gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
    352 gen${f}: gen${f}.lo
    353 	${_MKTARGET_LINK}
    354 	${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
    355 CLEANFILES+=	gen${f} gen${f}.lo
    356 .endfor
    357 
    358 .include "../../Makefile.hooks"
    359 
    360 #
    361 # Second we generate the rules for the generated files.  There
    362 # are 3 main classes:  RTL based or not, plus special cases.
    363 #
    364 # The special cases are:  gencheck, genattrtab, genopinit,
    365 # gencondmd
    366 #
    367 
    368 # RTL based files
    369 .for f in attr.h attr-common.h codes.h config.h flags.h \
    370 	  automata.c emit.c extract.c output.c peep.c recog.c \
    371 	  target-def.h
    372 insn-${f}: gen${f:R} ${G_md_file} insn-conditions.md
    373 	${_MKTARGET_CREATE}
    374 	./gen${f:R} ${G_md_file} insn-conditions.md >${.TARGET}
    375 CLEANFILES+=	insn-${f}
    376 .endfor
    377 
    378 # normal files
    379 .for f in constants.h enums.c
    380 insn-${f}: gen${f:R} ${G_md_file}
    381 	${_MKTARGET_CREATE}
    382 	./gen${f:R} ${G_md_file} >${.TARGET}
    383 CLEANFILES+=	insn-${f}
    384 .endfor
    385 
    386 # genconditions outputs gencondmd.c
    387 gencondmd.c: genconditions ${G_md_file}
    388 	${_MKTARGET_CREATE}
    389 	./genconditions ${G_md_file} >${.TARGET}
    390 CLEANFILES+=	gencondmd.c
    391 
    392 # gencheck outputs tree-check.h
    393 tree-check.h: gencheck
    394 	${_MKTARGET_CREATE}
    395 	./gencheck >${.TARGET}
    396 CLEANFILES+=	tree-check.h
    397 
    398 # genattrtab has three output files
    399 insn-dfatab.c insn-latencytab.c: insn-attrtab.c
    400 	cp -p ${.TARGET}.tmp ${.TARGET}
    401 insn-attrtab.c: genattrtab ${G_md_file} insn-conditions.md 
    402 	${_MKTARGET_CREATE}
    403 	./genattrtab ${G_md_file} insn-conditions.md \
    404 		-A${.TARGET}.tmp -Dinsn-dfatab.c.tmp -Linsn-latencytab.c.tmp && \
    405 	mv ${.TARGET}.tmp ${.TARGET}
    406 CLEANFILES+=	insn-attrtab.c insn-dfatab.c insn-latencytab.c
    407 
    408 # genopinit has two output files
    409 insn-opinit.h: insn-opinit.c
    410 	cp -p ${.TARGET}.tmp ${.TARGET}
    411 insn-opinit.c: genopinit ${G_md_file} insn-conditions.md
    412 	${_MKTARGET_CREATE}
    413 	./genopinit ${G_md_file} insn-conditions.md \
    414 		-hinsn-opinit.h.tmp -c${.TARGET}.tmp && \
    415 	mv ${.TARGET}.tmp ${.TARGET}
    416 CLEANFILES+=	insn-opinit.h insn-opinit.c
    417 
    418 LDFLAGS.genautomata+=	-lm
    419 
    420 # gencondmd outputs a special .md file
    421 insn-conditions.md: gencondmd
    422 	./gencondmd >${.TARGET}
    423 CLEANFILES+=	insn-conditions.md 
    424 
    425 # build params.list for params.h.
    426 params.h: params.list
    427 ${SRCS}: params.list
    428 params-list.h: params.def
    429 params.list: params-list.h
    430 	${CPP} ${.ALLSRC} | sed 's/^#.*//;/^$$/d' > params.list.tmp && \
    431 	mv params.list.tmp params.list
    432 CLEANFILES+=	params.list.tmp params.list
    433 
    434 # build case-cfn-macros.h and cfn-operators.pd
    435 case-cfn-macros.h: gencfn-macros
    436 	./gencfn-macros -c > case-cfn-macros.h.tmp && \
    437 	mv case-cfn-macros.h.tmp case-cfn-macros.h
    438 cfn-operators.pd: gencfn-macros
    439 	./gencfn-macros -o > cfn-operators.pd.tmp && \
    440 	mv cfn-operators.pd.tmp cfn-operators.pd
    441 CLEANFILES+=	case-cfn-macros.h.tmp case-cfn-macros.h \
    442 		cfn-operators.pd.tmp cfn-operators.pd
    443 
    444 CASECFNDEPS=	aarch64-builtins.c arm-builtins.c i386.c rs6000.c builtins.c \
    445 		fold-const.c tree-ssa-math-opts.c tree-ssa-reassoc.c \
    446 		tree-vect-patterns.c tree-vrp.c generic-match-head.c \
    447 		gimple-match-head.c ChangeLog-2015 fold-const-call.c \
    448 		gimple-ssa-backprop.c
    449 ${CASECFNDEPS}: case-cfn-macros.h
    450 
    451 #
    452 # Required hard-coded dependancies.
    453 #
    454 tm.h: insn-constants.h
    455 genextract.lo: insn-config.h
    456 gencondmd.lo: tm_p.h tm-constrs.h
    457 read-rtl.lo gencodes.lo genattrtab.lo genautomata.lo: tm.h gtype-desc.h
    458 genattr-common.lo gensupport.lo genconditions.lo gentarget-def.lo: tm.h
    459 genattr.lo genflags.lo genemit.lo genconfig.lo gencheck.lo: gtype-desc.h tm.h
    460 genopinit.lo genrecog.lo genpreds.lo genoutput.lo genpeep.lo: tm.h
    461 build-ggc-none.lo: gtype-desc.h
    462 ggc-none.o: gtype-desc.h
    463 insn-attrtab.o: insn-config.h
    464 insn-extract.o: insn-config.h
    465 toplev.d toplev.o: options.h
    466 coverage.d: gcov-iov.h
    467 gcov-io.h: gcov-iov.h
    468 cgraph.d cgraphunit.d cgraphunit.o: gcov-io.h
    469 vec.lo: gtype-desc.h
    470 insn-emit.d insn-emit.o: tm-constrs.h
    471 insn-attr.h: insn-attr-common.h
    472 gcov-io.h: gcov-iov.h
    473 df-scan.d df-scan.o: target-hooks-def.h
    474 read-md.d read-md.o read-md.lo: auto-build.h
    475 hash-table.d hash-table.o hash-table.lo: auto-build.h gtype-desc.h
    476 gencfn-macros.d gencfn-macros.o gencfn-macros.lo: gtype-desc.h
    477 pass_manager.h passes.c: pass-instances.def
    478 context.d coverage.d lto-cgraph.d passes.d statistics.d toplev.d: pass_manager.h
    479 context.o coverage.o lto-cgraph.o passes.o statistics.o toplev.o: pass_manager.h
    480 insn-opinit.o insn-opinit.d: insn-flags.h
    481 .for _f in insn-attrtab insn-automata insn-dfatab insn-latencytab insn-output
    482 ${_f}.o ${_f}.d: insn-attr-common.h insn-attr.h
    483 .endfor
    484 .for _f in insn-attrtab insn-automata insn-dfatab insn-emit insn-extract \
    485 	   insn-latencytab insn-opinit insn-output insn-peep insn-preds \
    486 	   insn-recog
    487 ${_f}.o ${_f}.d: insn-codes.h insn-config.h insn-constants.h insn-flags.h
    488 .endfor
    489 .for _f in insn-enums insn-modes
    490 ${_f}.o ${_f}.d: insn-constants.h
    491 .endfor
    492 .for _f in data-streamer data-streamer-out coverage gcov-dump gcov-io \
    493 	   gcov-iov gcov libgcov lto-cgraph mcf modulo-sched profile value-prof
    494 ${_f}.o ${_f}.d: gcov-io.h
    495 .endfor
    496 
    497 ${G_out_file:T:.c=.o}: insn-target-def.h target-hooks-def.h tm-constrs.h
    498 
    499 # XXX make all hooks generated for now.
    500 final.o: target-hooks-def.h c-family/c-target-hooks-def.h common/common-target-hooks-def.h
    501 
    502 .if ${MACHINE_CPU} == "arm"
    503 # XXX insn-recog.c:10304:7: error: this decimal constant is unsigned only in ISO C90 [-Werror]
    504 COPTS.insn-recog.c+=-Wno-error
    505 .endif
    506 
    507 .if ${GCC_MACHINE_ARCH} == "i386" || ${GCC_MACHINE_ARCH} == "x86_64"
    508 i386.d i386.o: pass_manager.h
    509 .endif
    510 
    511 .if ${MACHINE_CPU} == "mips"
    512 # XXX mips.md:3474:11: error: this decimal constant is unsigned only in ISO C90 [-Werror]
    513 COPTS.insn-recog.c+=-Wno-error
    514 .endif
    515 
    516 .if ${GCC_MACHINE_ARCH} == "vax"
    517 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
    518 COPTS.builtins.c+=-O0
    519 COPTS.convert.c+=-O0
    520 COPTS.dwarf2out.c+=-O0
    521 COPTS.dse.c+=-O0					# XXX port-vax/51967
    522 COPTS.expmed.c+=-O0
    523 COPTS.expr.c+=-O0 -Wno-error=tautological-compare
    524 COPTS.fixed-value.c+=-O0
    525 COPTS.fold-const.c+=-O0
    526 COPTS.gimple-fold.c+=-O0
    527 COPTS.gimple-ssa-strength-reduction.c+=-O0
    528 COPTS.gimple.c+=-O0
    529 COPTS.internal-fn.c+=-O0
    530 COPTS.lto-streamer-out.c+=-O0
    531 COPTS.omp-low.c+=-O0
    532 COPTS.predict.c+=-O0
    533 COPTS.recog.c+=-O0
    534 COPTS.sanopt.c+=-O0
    535 COPTS.stmt.c+=-O0
    536 COPTS.stor-layout.c+=-O0
    537 COPTS.targhooks.c+=-O0
    538 COPTS.tree-affine.c+=-O0
    539 COPTS.tree-cfg.c+=-O0
    540 COPTS.tree-eh.c+=-O0
    541 COPTS.tree-object-size.c+=-O0
    542 COPTS.tree-parloops.c+=-O0
    543 COPTS.tree-predcom.c+=-O0
    544 COPTS.tree-pretty-print.c+=-O0
    545 COPTS.tree-ssa-alias.c+=-O0
    546 COPTS.tree-ssa-ccp.c+=-O0
    547 COPTS.tree-ssa-forwprop.c+=-O0
    548 COPTS.tree-ssa-loop-ivopts.c+=-O0
    549 COPTS.tree-ssa-loop-manip.c+=-O0
    550 COPTS.tree-ssa-loop-niter.c+=-O0
    551 COPTS.tree-ssa-math-opts.c+=-O0
    552 COPTS.tree-ssa-pre.c+=-O0
    553 COPTS.tree-ssa-reassoc.c+=-O0
    554 COPTS.tree-ssa-uninit.c+=-O0
    555 COPTS.tree-switch-conversion.c+=-O0
    556 COPTS.tree-vect-data-refs.c+=-O0
    557 COPTS.tree-vect-loop-manip.c+=-O0
    558 COPTS.tree-vect-patterns.c+=-O0
    559 COPTS.tree-vect-stmts.c+=-O0
    560 COPTS.tree-vrp.c+=-O0
    561 COPTS.tree.c+=-O0
    562 COPTS.ubsan.c+=-O0
    563 COPTS.varasm.c+=-O0
    564 COPTS.wide-int.cc+=-O0
    565 .else
    566 COPTS.tree.c=	${${ACTIVE_CC} == "clang" :? -O0 :}
    567 .endif
    568 
    569 CFLAGS+=	-Wno-stack-protector
    570 
    571 .if ${GCC_MACHINE_ARCH} == "m68000" || ${GCC_MACHINE_ARCH} == "m68k" || \
    572 	${GCC_MACHINE_ARCH} == "coldfire"
    573 COPTS.tree-loop-distribution.c+=-O2
    574 COPTS.generic-match.c+=-fno-jump-tables
    575 COPTS.gimple-match.c+=-fno-jump-tables
    576 .endif
    577 
    578 # Don't fight with decimal128Local.h.
    579 # The GCC build only ignores the warning?
    580 COPTS.dfp.c+=	-fno-strict-aliasing
    581 
    582 CFLAGS+= -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
    583 
    584 .PATH: ${DIST}/gcc ${DIST}/libiberty ${GCCARCH} ${G_out_file:H} ${DIST}/include
    585 .PATH: ${DIST}/gcc/config
    586