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