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