# be nice to generate this entirely; but difficult.
gtyp-input.list.tmp: ${GCCARCH}/gtyp-input.list
sed s#SRCDIR#${DIST}# < ${.ALLSRC} > ${.TARGET}
CLEANFILES+= gtyp-input.list.tmp
gtype-desc.cc: gtype-desc.h
gtype-desc.h: gengtype gtyp-input.list.tmp
${_MKTARGET_CREATE}
rm -f auto-host.h
ln -s ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/auto-host.h .
if [ -f ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/sysroot-suffix.h ]; then \
rm -f sysroot-suffix.h; \
ln -s ${.CURDIR}/../gcc/arch/${GCC_MACHINE_ARCH}/sysroot-suffix.h ; \
fi
./gengtype -S ${DIST}/gcc -I gtyp-input.list.tmp -w gtype.state
./gengtype -r gtype.state
# GCC 4.8 installs gtype-state and gengtype as a plugin
# gengtype is the real need for options.h
gengtype.lo gengtype-lex.lo gengtype-parse.lo gengtype-state.lo: ${HH} gtyp-gen.h config.h options.h version.h
gengtype: gengtype.lo gengtype-lex.lo gengtype-parse.lo gengtype-state.lo build-errors.lo
${_MKTARGET_LINK}
${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
# XXX fix this by properly marking all the files that should
# XXX be built with -DGENERATOR_FILE
COPTS.gengtype-lex.cc= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
COPTS.gengtype-parse.cc= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
COPTS.gengtype-state.cc= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
COPTS.gengtype.cc= -UGENERATOR_FILE -DHOST_GENERATOR_FILE
gtyp-gen.h: Makefile
${_MKTARGET_CREATE}
(\
unset empty ; \
echo "static const char *srcdir = \"$(G_GTFILES_SRCDIR)\";" ; \
echo "static const char *lang_files[] = {" ; \
for f in $$empty $(G_GTFILES_FILES_FILES); do echo "\"$$f\", "; done ; \
echo "NULL };" ; \
echo "static const char *langs_for_lang_files[] = {" ; \
for f in $$empty $(G_GTFILES_FILES_LANGS); do echo "\"$$f\", "; done ; \
echo "NULL };" ; \
echo "static const char *all_files[] = {" ; \
for f in $$empty $(G_GTFILES); do echo "\"$$f\", "; done ; \
echo " NULL };" ; \
echo "static const char *lang_dir_names[] = {" ; \
for f in c $(G_GTFILES_LANG_DIR_NAMES); do echo "\"$$f\", "; done ; \
echo "NULL };" ; \
) >${.TARGET}
insn-modes.cc: genmodes
${_MKTARGET_CREATE}
./genmodes >${.TARGET}
insn-modes.h-test: genmodes
${_MKTARGET_CREATE}
./genmodes -h >${.TARGET}
# Ensure that the checked in version matches
if ! cmp ${.TARGET} ${.CURDIR}/../gcc/arch/${MACHINE_ARCH}/insn-modes.h; then
echo "Checked in insn-modes.h does not match; rerun mknative-gcc." 1>&2
false
fi
min-insn-modes.cc: genmodes
${_MKTARGET_CREATE}
./genmodes -m >${.TARGET}
insn-modes-inline.h: genmodes
${_MKTARGET_CREATE}
./genmodes -i >${.TARGET}
genmodes.lo: ${HH_NORTL}
genmodes: genmodes.lo build-errors.lo
${_MKTARGET_LINK}
${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY}
#
# The normal insn-foo generators
#
for f in gensupport.cc read-rtl.cc dummy-conditions.cc read-md.cc
${f:R}.lo: ${HH}
endfor
#
# There are 5 main classes of generator programs. Ones
# that are self contained, ones that use error reporting
# mechanisms, ones that use the MD reader, and ones that
# use the RTL reader.
#
GENPROG_ERROR_DEPENDS= ${G_BUILD_ERRORS:.o=.lo}
GENPROG_READER_DEPENDS= ${G_BUILD_MD:.o=.lo} ${GENPROG_ERROR_DEPENDS}
GENPROG_RTL_DEPENDS= ${G_BUILD_RTL:.o=.lo} ${GENPROG_READER_DEPENDS} ${GENPROG_ERROR_DEPENDS}
#
# First we generate the rules for the generators.
#
for f in attr attr-common attrtab automata codes conditions config emit \
extract flags opinit output peep preds recog mddump condmd \
target-def cfn-macros
gen${f}.lo: ${HH} gen${f}.cc ${G_RTL_BASE_H} build-sort.lo
gen${f}: gen${f}.lo ${GENPROG_RTL_DEPENDS}
${_MKTARGET_LINK}
${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}} build-sort.lo
CLEANFILES+= gen${f} gen${f}.lo
endfor
for f in mddeps constants enums
gen${f}.lo: ${HH} gen${f}.cc ${G_RTL_BASE_H}
gen${f}: gen${f}.lo ${GENPROG_READER_DEPENDS}
${_MKTARGET_LINK}
${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
CLEANFILES+= gen${f} gen${f}.lo
endfor
for f in check checksum
gen${f}.lo: ${HH} gen${f}.cc ${G_RTL_BASE_H}
gen${f}: gen${f}.lo
${_MKTARGET_LINK}
${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
CLEANFILES+= gen${f} gen${f}.lo
endfor
include "../../Makefile.hooks"
#
# Second we generate the rules for the generated files. There
# are 3 main classes: RTL based or not, plus special cases.
#
# The special cases are: gencheck, genattrtab, genopinit,
# gencondmd
#
# RTL based files
for f in attr.h attr-common.h codes.h config.h flags.h \
automata.cc emit.cc extract.cc output.cc peep.cc recog.cc \
target-def.h
insn-${f}: gen${f:R} ${G_md_file} insn-conditions.md
${_MKTARGET_CREATE}
./gen${f:R} ${G_md_file} insn-conditions.md >${.TARGET}
CLEANFILES+= insn-${f}
endfor
# normal files
for f in constants.h enums.cc
insn-${f}: gen${f:R} ${G_md_file}
${_MKTARGET_CREATE}
./gen${f:R} ${G_md_file} >${.TARGET}
CLEANFILES+= insn-${f}
endfor
if ${MACHINE_CPU} == "arm"
# XXX insn-recog.cc:10304:7: error: this decimal constant is unsigned only in ISO C90 [-Werror]
#COPTS.insn-recog.cc+=-Wno-error
endif
if ${MACHINE_CPU} == "mips"
# XXX mips.md:3474:11: error: this decimal constant is unsigned only in ISO C90 [-Werror]
#COPTS.insn-recog.cc+=-Wno-error
endif
if ${GCC_MACHINE_ARCH} == "vax"
CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}