1999-08-27 19:37:10 -04:00
|
|
|
# $FreeBSD$
|
1996-09-19 11:53:53 -04:00
|
|
|
|
2006-03-17 13:54:44 -05:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
2004-02-26 02:08:33 -05:00
|
|
|
CFLAGS+= -I.
|
1998-04-23 12:30:51 -04:00
|
|
|
|
1996-09-19 11:53:53 -04:00
|
|
|
.include "../Makefile.inc"
|
|
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
CFLAGS+= -g
|
|
|
|
|
CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H
|
2003-07-11 01:37:23 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
# Override LIBIBERTY set by Makefile.inc, We use our own for
|
|
|
|
|
# build tools.
|
|
|
|
|
LIBIBERTY= libiberty.a
|
2003-07-11 01:37:23 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.PATH: ${GCCDIR} ${GCCLIB}/libiberty
|
2004-07-28 01:27:21 -04:00
|
|
|
|
2003-07-11 01:37:23 -04:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Determine content of variables used by the target/host config files
|
|
|
|
|
|
|
|
|
|
#
|
2004-07-28 01:27:21 -04:00
|
|
|
# The list of headers to go into tm.h
|
2003-07-11 01:37:23 -04:00
|
|
|
#
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= options.h
|
2004-07-28 01:27:21 -04:00
|
|
|
.if ${TARGET_ARCH} == "amd64"
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= i386/biarch64.h
|
2004-07-28 01:27:21 -04:00
|
|
|
.endif
|
2006-09-18 13:08:32 -04:00
|
|
|
.if ${TARGET_ARCH} != "arm"
|
2003-07-11 01:37:23 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h
|
2006-09-18 13:08:32 -04:00
|
|
|
.endif
|
2003-07-11 01:37:23 -04:00
|
|
|
.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
|
|
|
|
|
TARGET_INC+= ${GCC_CPU}/unix.h
|
|
|
|
|
TARGET_INC+= ${GCC_CPU}/att.h
|
|
|
|
|
.endif
|
|
|
|
|
TARGET_INC+= dbxelf.h
|
2008-09-01 14:46:03 -04:00
|
|
|
TARGET_INC+= elfos-undef.h
|
2003-07-11 01:37:23 -04:00
|
|
|
TARGET_INC+= elfos.h
|
|
|
|
|
TARGET_INC+= freebsd-native.h
|
|
|
|
|
TARGET_INC+= freebsd-spec.h
|
|
|
|
|
TARGET_INC+= freebsd.h
|
|
|
|
|
.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
|
2008-08-31 19:38:28 -04:00
|
|
|
. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
|
2003-07-11 01:37:23 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/sysv4.h
|
2008-08-31 19:38:28 -04:00
|
|
|
. endif
|
2003-07-11 01:37:23 -04:00
|
|
|
.endif
|
|
|
|
|
.if ${TARGET_ARCH} == "amd64"
|
|
|
|
|
TARGET_INC+= ${GCC_CPU}/x86-64.h
|
2008-08-31 19:38:28 -04:00
|
|
|
.endif
|
2008-09-01 14:46:03 -04:00
|
|
|
.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "mips"
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/elf.h
|
2008-08-31 19:38:28 -04:00
|
|
|
.endif
|
|
|
|
|
.if ${TARGET_ARCH} == "arm"
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/aout.h
|
2008-08-31 19:38:28 -04:00
|
|
|
.endif
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/freebsd.h
|
2008-08-31 19:38:28 -04:00
|
|
|
.if ${TARGET_ARCH} == "amd64"
|
|
|
|
|
TARGET_INC+= ${GCC_CPU}/freebsd64.h
|
|
|
|
|
.endif
|
|
|
|
|
.if ${TARGET_ARCH} == "arm"
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC+= ${GCC_CPU}/arm.h
|
2004-07-28 01:27:21 -04:00
|
|
|
.endif
|
2003-07-11 01:37:23 -04:00
|
|
|
TARGET_INC+= defaults.h
|
|
|
|
|
|
|
|
|
|
.for H in ${TARGET_INC}
|
|
|
|
|
.for D in ${GCCDIR}/config ${GCCDIR} ${.CURDIR}
|
|
|
|
|
.if exists($D/$H)
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_INC_FILES+= $D/$H
|
2003-07-11 01:37:23 -04:00
|
|
|
.endif
|
|
|
|
|
.endfor
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
#
|
2007-05-19 00:25:59 -04:00
|
|
|
# gtyp includes.
|
2003-07-11 01:37:23 -04:00
|
|
|
#
|
|
|
|
|
srcdir= ${GCCDIR}
|
2007-05-19 00:25:59 -04:00
|
|
|
CPPLIB_H= ${GCCLIB}/libcpp/include/line-map.h \
|
|
|
|
|
${GCCLIB}/libcpp/include/cpplib.h
|
|
|
|
|
SYMTAB_H= ${GCCLIB}/libcpp/include/symtab.h
|
|
|
|
|
CPP_ID_DATA_H= ${CPPLIB_H} ${GCCLIB}/libcpp/include/cpp-id-data.h
|
|
|
|
|
HASHTAB_H= ${GCCLIB}/include/hashtab.h
|
|
|
|
|
SPLAY_TREE_H= ${GCCLIB}/include/splay-tree.h
|
|
|
|
|
out_file= ${srcdir}/config/${GCC_CPU}/${GCC_CPU}.c
|
|
|
|
|
tm_file_list= ${TARGET_INC_FILES}
|
|
|
|
|
host_xm_file_list= ${.CURDIR}/auto-host.h ${GCCLIB}/include/ansidecl.h
|
|
|
|
|
GTFILES_SRCDIR= ${srcdir}
|
2003-07-11 01:37:23 -04:00
|
|
|
|
|
|
|
|
# Copied unchanged from gcc/Makefile.in
|
2007-05-19 00:25:59 -04:00
|
|
|
GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
|
|
|
|
|
$(CPP_ID_DATA_H) $(host_xm_file_list) \
|
|
|
|
|
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
|
|
|
|
|
$(srcdir)/coverage.c $(srcdir)/rtl.h \
|
|
|
|
|
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
|
|
|
|
|
$(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
|
|
|
|
|
$(srcdir)/ipa-reference.h $(srcdir)/output.h \
|
2004-07-28 01:27:21 -04:00
|
|
|
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/c-common.h $(srcdir)/c-tree.h $(srcdir)/reload.h \
|
2004-07-28 01:27:21 -04:00
|
|
|
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c \
|
2004-07-28 01:27:21 -04:00
|
|
|
$(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/dojump.c $(srcdir)/tree-profile.c \
|
2004-07-28 01:27:21 -04:00
|
|
|
$(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/function.c $(srcdir)/except.h \
|
2003-07-11 01:37:23 -04:00
|
|
|
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/profile.c $(srcdir)/regclass.c \
|
|
|
|
|
$(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \
|
|
|
|
|
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
|
2005-06-03 00:21:04 -04:00
|
|
|
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
|
2007-05-19 00:25:59 -04:00
|
|
|
$(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
|
|
|
|
|
$(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parser.c \
|
|
|
|
|
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
|
|
|
|
|
$(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
|
|
|
|
|
$(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
|
|
|
|
|
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
|
|
|
|
|
$(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \
|
|
|
|
|
$(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \
|
|
|
|
|
$(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
|
|
|
|
|
$(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \
|
|
|
|
|
$(srcdir)/tree-ssa-structalias.c \
|
|
|
|
|
$(srcdir)/c-pragma.h $(srcdir)/omp-low.c \
|
|
|
|
|
$(srcdir)/targhooks.c $(srcdir)/cgraphunit.c $(out_file) \
|
|
|
|
|
|
|
|
|
|
# The list of frontend directories to look into
|
2003-07-11 01:37:23 -04:00
|
|
|
GTFILES_LANG_DIR_NAMES=
|
|
|
|
|
|
2006-03-17 13:54:44 -05:00
|
|
|
.if ${MK_CXX} != "no"
|
2003-07-11 01:37:23 -04:00
|
|
|
GTFILES_LANG_DIR_NAMES+= cp
|
|
|
|
|
.endif
|
|
|
|
|
|
2006-03-17 13:54:44 -05:00
|
|
|
.if ${MK_OBJC} != "no"
|
2003-07-11 01:37:23 -04:00
|
|
|
GTFILES_LANG_DIR_NAMES+= objc
|
|
|
|
|
.endif
|
|
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
# The list of language specific files for gengtype
|
2003-07-11 01:37:23 -04:00
|
|
|
.for L in ${GTFILES_LANG_DIR_NAMES} c
|
|
|
|
|
.if exists(${GCCDIR}/$L-config-lang.in)
|
|
|
|
|
# Source the language config file
|
2004-01-26 11:12:29 -05:00
|
|
|
L_GTFILES!= sh -c '. ${GCCDIR}/$L-config-lang.in; echo $$gtfiles'
|
2003-07-11 01:37:23 -04:00
|
|
|
.else
|
2004-01-26 11:12:29 -05:00
|
|
|
L_GTFILES!= sh -c '. ${GCCDIR}/$L/config-lang.in; echo $$gtfiles'
|
2003-07-11 01:37:23 -04:00
|
|
|
.endif
|
2004-01-26 11:12:29 -05:00
|
|
|
.for F in ${L_GTFILES}
|
2003-07-11 01:37:23 -04:00
|
|
|
GTFILES_FILES+= $F
|
|
|
|
|
GTFILES_LANGS+= $L
|
|
|
|
|
.endfor
|
|
|
|
|
.endfor
|
2004-01-26 11:12:29 -05:00
|
|
|
GTFILES+= ${GTFILES_FILES}
|
2003-07-11 01:37:23 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
#
|
|
|
|
|
# Tree definition files.
|
|
|
|
|
#
|
|
|
|
|
TREE_DEF_FILES=
|
1996-09-19 11:53:53 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if ${MK_CXX} != "no"
|
|
|
|
|
TREE_DEF_FILES+= cp/cp-tree.def
|
|
|
|
|
.endif
|
1998-03-06 08:34:36 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if ${MK_OBJC} != "no"
|
|
|
|
|
TREE_DEF_FILES+= objc/objc-tree.def
|
|
|
|
|
.endif
|
2001-12-17 22:19:11 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
#
|
|
|
|
|
# Option files.
|
|
|
|
|
#
|
|
|
|
|
OPT_FILES= c.opt common.opt
|
2004-07-28 01:27:21 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt)
|
|
|
|
|
OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
|
|
|
|
|
.endif
|
2001-12-17 22:19:11 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt)
|
|
|
|
|
OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt
|
2004-07-28 01:27:21 -04:00
|
|
|
.endif
|
1999-11-14 23:16:19 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if ${TARGET_ARCH} == "powerpc"
|
|
|
|
|
OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
|
|
|
|
|
.endif
|
1999-04-04 12:36:35 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if ${TARGET_ARCH} == "sparc64"
|
|
|
|
|
OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
|
|
|
|
|
.endif
|
1999-04-04 12:36:35 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
.if exists(${.CURDIR}/freebsd.opt)
|
|
|
|
|
OPT_FILES+= ${.CURDIR}/freebsd.opt
|
|
|
|
|
.endif
|
1999-04-04 12:36:35 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Build rules for header files and generator tools
|
1999-04-11 00:32:42 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
# Host config
|
|
|
|
|
config.h:
|
|
|
|
|
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
|
|
|
|
|
HEADERS="auto-host.h ansidecl.h" \
|
|
|
|
|
DEFINES="" \
|
|
|
|
|
/bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= config.h
|
|
|
|
|
CLEANFILES+= cs-config.h
|
|
|
|
|
|
|
|
|
|
# Build config
|
|
|
|
|
bconfig.h:
|
|
|
|
|
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
|
|
|
|
|
HEADERS="auto-host.h ansidecl.h" \
|
|
|
|
|
DEFINES="" \
|
|
|
|
|
/bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
|
|
|
|
|
.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
|
|
|
|
|
echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
|
2002-05-15 17:59:46 -04:00
|
|
|
.endif
|
2007-05-19 00:25:59 -04:00
|
|
|
|
|
|
|
|
GENSRCS+= bconfig.h
|
|
|
|
|
CLEANFILES+= cs-bconfig.h
|
|
|
|
|
|
|
|
|
|
# tconfig.h
|
|
|
|
|
tconfig.h:
|
|
|
|
|
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
|
|
|
|
|
HEADERS="auto-host.h ansidecl.h" \
|
|
|
|
|
DEFINES="USED_FOR_TARGET" \
|
|
|
|
|
/bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= tconfig.h
|
|
|
|
|
CLEANFILES+= cs-tconfig.h
|
|
|
|
|
# Options
|
|
|
|
|
optionlist: ${OPT_FILES}
|
2007-11-18 06:59:44 -05:00
|
|
|
LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
|
|
|
|
|
options.h: optionlist
|
2007-11-18 06:59:44 -05:00
|
|
|
LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
|
2007-05-19 00:25:59 -04:00
|
|
|
-f ${GCCDIR}/opth-gen.awk \
|
|
|
|
|
< ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
|
|
options.c: optionlist
|
2007-11-18 06:59:44 -05:00
|
|
|
LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
|
2007-05-19 00:25:59 -04:00
|
|
|
-f ${GCCDIR}/optc-gen.awk \
|
|
|
|
|
-v header_name="config.h system.h coretypes.h tm.h" \
|
|
|
|
|
< ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
GENONLY+= optionlist options.h options.c
|
|
|
|
|
|
|
|
|
|
# Target machine config
|
|
|
|
|
tm.h:
|
|
|
|
|
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
|
|
|
|
|
HEADERS="${TARGET_INC}" \
|
|
|
|
|
DEFINES="" \
|
|
|
|
|
/bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
|
2003-07-11 01:37:23 -04:00
|
|
|
.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
|
|
|
|
|
echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
|
2002-05-10 13:42:19 -04:00
|
|
|
.endif
|
2001-12-17 22:19:11 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
GENSRCS+= tm.h
|
|
|
|
|
CLEANFILES+= cs-tm.h
|
|
|
|
|
|
|
|
|
|
# Target machine protos/preds.
|
2001-12-17 22:19:11 -05:00
|
|
|
tm_p.h:
|
2007-05-19 00:25:59 -04:00
|
|
|
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
|
|
|
|
|
HEADERS="${GCC_CPU}/${GCC_CPU}-protos.h tm-preds.h" \
|
|
|
|
|
DEFINES="" \
|
|
|
|
|
/bin/sh ${GCCDIR}/mkconfig.sh tm_p.h
|
|
|
|
|
|
|
|
|
|
GENSRCS+= tm_p.h
|
|
|
|
|
CLEANFILES+= cs-tm_p.h
|
|
|
|
|
|
|
|
|
|
# gencheck
|
2007-05-27 20:25:07 -04:00
|
|
|
gencheck.h: ${TREE_DEF_FILES}
|
2007-05-19 00:25:59 -04:00
|
|
|
.for F in ${TREE_DEF_FILES}
|
|
|
|
|
echo "#include \"$F\"" >> ${.TARGET}
|
2002-04-06 18:18:01 -05:00
|
|
|
.endfor
|
2007-05-27 20:25:07 -04:00
|
|
|
touch ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
|
|
|
|
|
GENSRCS+= gencheck.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Source header for gtyp generator.
|
|
|
|
|
gtyp-gen.h: ${GTFILES}
|
2003-07-11 01:37:23 -04:00
|
|
|
echo "/* This file is machine generated. Do not edit. */" > ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "static const char * const srcdir = " >> ${.TARGET}
|
2003-07-11 01:37:23 -04:00
|
|
|
echo "\"$(GTFILES_SRCDIR)\";" >> ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "static const char * const lang_files[] = {" >> ${.TARGET}
|
2003-07-11 01:37:23 -04:00
|
|
|
.for F in ${GTFILES_FILES}
|
|
|
|
|
echo "\"$F\", " >> ${.TARGET}
|
|
|
|
|
.endfor
|
|
|
|
|
echo "NULL};" >> ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "static const char * const langs_for_lang_files[] = {">> ${.TARGET}
|
2003-07-11 01:37:23 -04:00
|
|
|
.for F in ${GTFILES_LANGS}
|
|
|
|
|
echo "\"$F\", " >> ${.TARGET}
|
|
|
|
|
.endfor
|
|
|
|
|
echo "NULL};" >> ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "static const char * const all_files[] = {" >> ${.TARGET}
|
2003-07-11 01:37:23 -04:00
|
|
|
.for F in ${GTFILES}
|
|
|
|
|
echo "\"$F\", " >> ${.TARGET}
|
|
|
|
|
.endfor
|
|
|
|
|
echo "NULL};" >> ${.TARGET}
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "static const char * const lang_dir_names[] = {" >> ${.TARGET}
|
|
|
|
|
.for F in c ${GTFILES_LANG_DIR_NAMES}
|
2003-07-11 01:37:23 -04:00
|
|
|
echo "\"$F\", " >> ${.TARGET}
|
|
|
|
|
.endfor
|
|
|
|
|
echo "NULL};" >> ${.TARGET}
|
|
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
GENSRCS+= gtyp-gen.h
|
|
|
|
|
|
|
|
|
|
# Version header for gcov
|
2004-07-28 01:27:21 -04:00
|
|
|
gcov-iov.h:
|
2007-05-19 00:25:59 -04:00
|
|
|
echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= gcov-iov.h
|
|
|
|
|
|
|
|
|
|
# Multilib config file
|
|
|
|
|
multilib.h:
|
|
|
|
|
echo 'static const char *const multilib_raw[] = { \
|
|
|
|
|
". ;", NULL };' > ${.TARGET}
|
|
|
|
|
echo 'static const char *const multilib_matches_raw[] = { \
|
|
|
|
|
NULL };' >> ${.TARGET}
|
|
|
|
|
echo 'static const char *multilib_extra = "";' >> ${.TARGET}
|
|
|
|
|
echo 'static const char *multilib_options = "";' >> ${.TARGET}
|
|
|
|
|
echo 'static const char *const multilib_exclusions_raw[] = { \
|
|
|
|
|
NULL };' >> ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= multilib.h
|
|
|
|
|
|
|
|
|
|
configargs.h:
|
|
|
|
|
echo 'static const char configuration_arguments[] =' > ${.TARGET}
|
|
|
|
|
echo ' "FreeBSD/${TARGET_ARCH} system compiler";' >> ${.TARGET}
|
|
|
|
|
echo 'static const char thread_model[] = "posix";' >> ${.TARGET}
|
|
|
|
|
echo 'static const struct {' >> ${.TARGET}
|
|
|
|
|
echo ' const char *name, *value;' >> ${.TARGET}
|
|
|
|
|
echo '} configure_default_options[] = {' >> ${.TARGET}
|
|
|
|
|
echo ' { "NULL", "NULL" } };' >> ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= configargs.h
|
|
|
|
|
|
|
|
|
|
# Language spec files
|
|
|
|
|
specs.h:
|
|
|
|
|
echo '#include "cp/lang-specs.h"' > ${.TARGET}
|
|
|
|
|
echo '#include "objc/lang-specs.h"' >> ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= specs.h
|
|
|
|
|
|
|
|
|
|
gstdint.h:
|
|
|
|
|
echo '#include "sys/types.h"' > ${.TARGET}
|
|
|
|
|
echo '#include "sys/stdint.h"' >> ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= gstdint.h
|
|
|
|
|
|
|
|
|
|
# Linked headers
|
|
|
|
|
gthr-default.h: ${GCCDIR}/gthr-posix.h
|
|
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= gthr-default.h
|
|
|
|
|
|
|
|
|
|
unwind.h: ${GCCDIR}/unwind-generic.h
|
|
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= unwind.h
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# gtype gunk
|
|
|
|
|
#
|
|
|
|
|
gengtype-lex.c: gengtype-lex.l
|
|
|
|
|
flex -ogengtype-lex.c ${.ALLSRC}
|
|
|
|
|
|
|
|
|
|
gengtype-yacc.h: gengtype-yacc.y
|
|
|
|
|
yacc -d -o gengtype-yacc.c ${.ALLSRC}
|
|
|
|
|
|
|
|
|
|
gengtype-yacc.c: gengtype-yacc.h
|
|
|
|
|
|
|
|
|
|
gengtype-yacc+%DIKED.c: gengtype-yacc.c
|
|
|
|
|
cat ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
sed -e "s/xmalloc/malloc/g" \
|
|
|
|
|
-e "s/xrealloc/realloc/g" \
|
|
|
|
|
-e "s/malloc/xmalloc/g" \
|
|
|
|
|
-e "s/realloc/xrealloc/g" \
|
|
|
|
|
${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
|
|
GENSRCS+= gengtype-lex.c gengtype-yacc.h gengtype-yacc+%DIKED.c
|
|
|
|
|
CLEANFILES+= gengtype-yacc.c
|
|
|
|
|
|
|
|
|
|
gengtype: gengtype.o gengtype-yacc+%DIKED.o gengtype-lex.o errors.o \
|
|
|
|
|
${LIBIBERTY}
|
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
|
|
gtype-desc.h: gengtype
|
|
|
|
|
./gengtype
|
|
|
|
|
touch ${.TARGET}
|
|
|
|
|
|
|
|
|
|
gtype-desc.c: gtype-desc.h
|
|
|
|
|
|
|
|
|
|
GENONLY+= gtype-desc.c gtype-desc.h
|
|
|
|
|
CLEANFILES+= gt-*.h gtype-*.h
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Generator tools.
|
|
|
|
|
#
|
|
|
|
|
.for F in check checksum genrtl modes
|
|
|
|
|
gen$F: gen$F.o errors.o ${LIBIBERTY}
|
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
.for F in attr attrtab automata codes conditions config constants emit \
|
|
|
|
|
extract flags opinit output peep preds recog
|
|
|
|
|
gen$F: gen$F.o rtl.o read-rtl.o ggc-none.o vec.o min-insn-modes.o \
|
|
|
|
|
gensupport.o print-rtl.o errors.o ${LIBIBERTY}
|
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lm
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
gencondmd: gencondmd.o
|
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Generated .md files.
|
|
|
|
|
#
|
|
|
|
|
insn-conditions.md: gencondmd
|
|
|
|
|
./gencondmd > ${.TARGET}
|
|
|
|
|
GENSRCS+= insn-conditions.md
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Generated header files.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
.for F in constants
|
|
|
|
|
insn-$F.h: gen$F ${MD_FILE}
|
|
|
|
|
./gen$F ${MD_FILE} > ${.TARGET}
|
|
|
|
|
GENSRCS+= insn-$F.h
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
.for F in attr codes config flags
|
|
|
|
|
insn-$F.h: gen$F ${MD_FILE} insn-conditions.md
|
|
|
|
|
./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET}
|
|
|
|
|
GENSRCS+= insn-$F.h
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
# Header files with irregular names.
|
|
|
|
|
genrtl.h: gengenrtl
|
|
|
|
|
./gengenrtl -h > ${.TARGET}
|
|
|
|
|
GENSRCS+= genrtl.h
|
|
|
|
|
|
|
|
|
|
tm-preds.h: genpreds
|
|
|
|
|
./genpreds -h ${MD_FILE} > ${.TARGET}
|
|
|
|
|
GENSRCS+= tm-preds.h
|
|
|
|
|
|
|
|
|
|
tm-constrs.h: genpreds
|
|
|
|
|
./genpreds -c ${MD_FILE} > ${.TARGET}
|
|
|
|
|
GENSRCS+= tm-constrs.h
|
|
|
|
|
|
|
|
|
|
tree-check.h: gencheck
|
|
|
|
|
./gencheck > ${.TARGET}
|
|
|
|
|
GENSRCS+= tree-check.h
|
|
|
|
|
|
|
|
|
|
insn-modes.h: genmodes
|
|
|
|
|
./genmodes -h > ${.TARGET}
|
|
|
|
|
GENSRCS+= insn-modes.h
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Generated source files.
|
|
|
|
|
#
|
|
|
|
|
.for F in attrtab automata emit extract opinit output peep preds recog
|
|
|
|
|
insn-$F.c: gen$F ${MD_FILE} insn-conditions.md
|
|
|
|
|
./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET}
|
|
|
|
|
GENONLY+= insn-$F.c
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
.for F in conditions
|
|
|
|
|
insn-$F.c: gen$F ${MD_FILE}
|
|
|
|
|
./gen$F ${MD_FILE} > ${.TARGET}
|
|
|
|
|
GENSRCS+= insn-$F.c
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
# Source files with irregular names.
|
|
|
|
|
insn-modes.c: genmodes
|
|
|
|
|
./genmodes > ${.TARGET}
|
|
|
|
|
GENONLY+= insn-modes.c
|
|
|
|
|
|
|
|
|
|
min-insn-modes.c: genmodes
|
|
|
|
|
./genmodes -m > ${.TARGET}
|
|
|
|
|
GENSRCS+= min-insn-modes.c
|
|
|
|
|
|
|
|
|
|
genrtl.c: gengenrtl
|
|
|
|
|
./gengenrtl > ${.TARGET}
|
|
|
|
|
GENONLY+= genrtl.c
|
|
|
|
|
|
|
|
|
|
gencondmd.c: genconditions ${MD_FILE}
|
|
|
|
|
./genconditions ${MD_FILE} > ${.TARGET}
|
|
|
|
|
GENSRCS+= gencondmd.c
|
|
|
|
|
|
First round of changes to support generation of assembler for the old
a.out gas and the binutils gas (elf or a.out) with a single compiler.
This uses other infrastructure not yet committed, in order to support
both a.out and elf it needs to be able to get to both a.out and elf
gas, ld, libs, crt* etc. So for now, the support is pretty much dormant.
The new freebsd.h file is based on the old freebsd-elf.h file (which has a
long lineage, right back through linux and svr4 files). The change is
pretty dramatic from a gcc internals standpoint as it overrides a lot of
definitions in order to generate different output based on target mode.
There is potential for screw-ups, so please be on the lookout - gcc's
configuration mechanism wasn't really meant for this kind of thing.
It's believed to compile world etc just fine under both a.out and elf, can
handle global constructors and destructors, handles the differences in
a.out and elf stabs, and what sections things like exceptions go in.
The initial idea came from i386/osfrose.h which is a dual rose/elf format
target. These two are not as diverse as a.out and elf it would seem.
The cc front-end uses external configuration to determine default object
format (still being thrashed out, so read the source if you want to see
it so far), and has a '-aout' and '-elf' override command line switch.
There are some other internal switches that can be accessed, namely -maout,
-mno-aout, -munderscores and -mnounderscores. The underscore and local
symbol prefixing rules are controllable seperately to the output format.
(ie: it's possible to generate a.out without the _ prefixes on symbols and
also to generate elf with the _ prefixes. This isn't quite optimal, but
does seem to work pretty well, except the linkers don't always recognise
the local symbols without their normal names)
The default format is a.out (still), nobody should see any major changes.
With both elf and a.out tools and libraries installed:
[1:26pm]/tmp-223> cc -elf -o hello hello.c
peter@beast[1:27pm]/tmp-224> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped
[1:27pm]/tmp-225> ./hello
hello world!
[1:27pm]/tmp-226> cc -aout -o hello hello.c
[1:27pm]/tmp-227> file hello
hello: FreeBSD/i386 compact demand paged dynamically linked executable not stripped
1:27pm]/tmp-228> ./hello
hello world!
Since my co-conspirators put a lot of effort into this too, I'll add them
so they can share the blame^H^H^H^H^Hglory. :-)
Reviewed by: sos, jdp
1998-03-08 00:29:49 -05:00
|
|
|
#-----------------------------------------------------------------------
|
2007-05-19 00:25:59 -04:00
|
|
|
# Build tools.
|
First round of changes to support generation of assembler for the old
a.out gas and the binutils gas (elf or a.out) with a single compiler.
This uses other infrastructure not yet committed, in order to support
both a.out and elf it needs to be able to get to both a.out and elf
gas, ld, libs, crt* etc. So for now, the support is pretty much dormant.
The new freebsd.h file is based on the old freebsd-elf.h file (which has a
long lineage, right back through linux and svr4 files). The change is
pretty dramatic from a gcc internals standpoint as it overrides a lot of
definitions in order to generate different output based on target mode.
There is potential for screw-ups, so please be on the lookout - gcc's
configuration mechanism wasn't really meant for this kind of thing.
It's believed to compile world etc just fine under both a.out and elf, can
handle global constructors and destructors, handles the differences in
a.out and elf stabs, and what sections things like exceptions go in.
The initial idea came from i386/osfrose.h which is a dual rose/elf format
target. These two are not as diverse as a.out and elf it would seem.
The cc front-end uses external configuration to determine default object
format (still being thrashed out, so read the source if you want to see
it so far), and has a '-aout' and '-elf' override command line switch.
There are some other internal switches that can be accessed, namely -maout,
-mno-aout, -munderscores and -mnounderscores. The underscore and local
symbol prefixing rules are controllable seperately to the output format.
(ie: it's possible to generate a.out without the _ prefixes on symbols and
also to generate elf with the _ prefixes. This isn't quite optimal, but
does seem to work pretty well, except the linkers don't always recognise
the local symbols without their normal names)
The default format is a.out (still), nobody should see any major changes.
With both elf and a.out tools and libraries installed:
[1:26pm]/tmp-223> cc -elf -o hello hello.c
peter@beast[1:27pm]/tmp-224> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped
[1:27pm]/tmp-225> ./hello
hello world!
[1:27pm]/tmp-226> cc -aout -o hello hello.c
[1:27pm]/tmp-227> file hello
hello: FreeBSD/i386 compact demand paged dynamically linked executable not stripped
1:27pm]/tmp-228> ./hello
hello world!
Since my co-conspirators put a lot of effort into this too, I'll add them
so they can share the blame^H^H^H^H^Hglory. :-)
Reviewed by: sos, jdp
1998-03-08 00:29:49 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
GNTOOLS+= genattr genattrtab genautomata gencodes gencheck genchecksum \
|
|
|
|
|
genconditions gencondmd genconfig genconstants genemit \
|
|
|
|
|
genextract genflags gengenrtl gengtype genmodes genopinit \
|
|
|
|
|
genoutput genpeep genpreds genrecog
|
First round of changes to support generation of assembler for the old
a.out gas and the binutils gas (elf or a.out) with a single compiler.
This uses other infrastructure not yet committed, in order to support
both a.out and elf it needs to be able to get to both a.out and elf
gas, ld, libs, crt* etc. So for now, the support is pretty much dormant.
The new freebsd.h file is based on the old freebsd-elf.h file (which has a
long lineage, right back through linux and svr4 files). The change is
pretty dramatic from a gcc internals standpoint as it overrides a lot of
definitions in order to generate different output based on target mode.
There is potential for screw-ups, so please be on the lookout - gcc's
configuration mechanism wasn't really meant for this kind of thing.
It's believed to compile world etc just fine under both a.out and elf, can
handle global constructors and destructors, handles the differences in
a.out and elf stabs, and what sections things like exceptions go in.
The initial idea came from i386/osfrose.h which is a dual rose/elf format
target. These two are not as diverse as a.out and elf it would seem.
The cc front-end uses external configuration to determine default object
format (still being thrashed out, so read the source if you want to see
it so far), and has a '-aout' and '-elf' override command line switch.
There are some other internal switches that can be accessed, namely -maout,
-mno-aout, -munderscores and -mnounderscores. The underscore and local
symbol prefixing rules are controllable seperately to the output format.
(ie: it's possible to generate a.out without the _ prefixes on symbols and
also to generate elf with the _ prefixes. This isn't quite optimal, but
does seem to work pretty well, except the linkers don't always recognise
the local symbols without their normal names)
The default format is a.out (still), nobody should see any major changes.
With both elf and a.out tools and libraries installed:
[1:26pm]/tmp-223> cc -elf -o hello hello.c
peter@beast[1:27pm]/tmp-224> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped
[1:27pm]/tmp-225> ./hello
hello world!
[1:27pm]/tmp-226> cc -aout -o hello hello.c
[1:27pm]/tmp-227> file hello
hello: FreeBSD/i386 compact demand paged dynamically linked executable not stripped
1:27pm]/tmp-228> ./hello
hello world!
Since my co-conspirators put a lot of effort into this too, I'll add them
so they can share the blame^H^H^H^H^Hglory. :-)
Reviewed by: sos, jdp
1998-03-08 00:29:49 -05:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
all: ${GNTOOLS} ${GENSRCS} ${GENONLY}
|
|
|
|
|
beforedepend: ${GENONLY}
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Build 'pocket' libiberty exclusively for build tools use.
|
|
|
|
|
|
|
|
|
|
LIBIBERTY_SRCS= choose-temp.c concat.c cp-demangle.c cp-demint.c cplus-dem.c \
|
|
|
|
|
dyn-string.c fibheap.c fopen_unlocked.c getpwd.c getruntime.c \
|
|
|
|
|
hashtab.c hex.c lbasename.c make-temp-file.c md5.c obstack.c \
|
|
|
|
|
partition.c pex-unix.c physmem.c safe-ctype.c splay-tree.c xexit.c \
|
|
|
|
|
xmalloc.c xmemdup.c xstrdup.c xstrerror.c
|
|
|
|
|
LIBIBERTY_OBJS= ${LIBIBERTY_SRCS:R:S/$/.o/g}
|
|
|
|
|
|
|
|
|
|
.for _src in ${LIBIBERTY_SRCS}
|
|
|
|
|
${_src:R:S/$/.o/}: ${_src}
|
|
|
|
|
${CC} -c -I ${.CURDIR}/../libiberty ${CFLAGS} -o ${.TARGET} ${.IMPSRC}
|
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
${LIBIBERTY}: ${LIBIBERTY_OBJS}
|
|
|
|
|
@rm -f ${.TARGET}
|
|
|
|
|
@${AR} cq ${.TARGET} `lorder ${LIBIBERTY_OBJS} | tsort -q`
|
|
|
|
|
${RANLIB} ${.TARGET}
|
|
|
|
|
CLEANFILES+= ${LIBIBERTY} ${LIBIBERTY_OBJS}
|
1996-09-19 11:53:53 -04:00
|
|
|
|
1998-04-23 12:30:51 -04:00
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Fixups.
|
|
|
|
|
|
|
|
|
|
# Set OBJS the same as bsd.prog.mk would do if we defined PROG. We can't
|
|
|
|
|
# define PROG because we have multiple programs.
|
|
|
|
|
#
|
2007-05-19 00:25:59 -04:00
|
|
|
SRCS= errors.c genattr.c genattrtab.c \
|
|
|
|
|
genautomata.c gencheck.c genchecksum.c gencodes.c \
|
|
|
|
|
genconditions.c genconfig.c genconstants.c genemit.c \
|
|
|
|
|
genextract.c genflags.c gengenrtl.c gengtype.c genmodes.c \
|
|
|
|
|
genopinit.c genoutput.c genpeep.c genpreds.c genrecog.c \
|
|
|
|
|
gensupport.c ggc-none.c print-rtl.c read-rtl.c rtl.c \
|
|
|
|
|
vec.c
|
|
|
|
|
|
|
|
|
|
SRCS+= ${GENSRCS}
|
1998-04-23 12:30:51 -04:00
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
|
2007-05-19 00:25:59 -04:00
|
|
|
GENOBJS+= ${GENSRCS:N*.h:R:S/$/.o/g}
|
|
|
|
|
CLEANFILES+= ${GENSRCS} ${GENONLY} ${GENOBJS} ${GNTOOLS}
|
1998-04-23 12:30:51 -04:00
|
|
|
|
2007-05-19 00:25:59 -04:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Manual dependencies.
|
1998-04-23 12:30:51 -04:00
|
|
|
.if !exists(${DEPENDFILE})
|
2007-05-19 00:25:59 -04:00
|
|
|
.include "Makefile.dep"
|
1998-04-23 12:30:51 -04:00
|
|
|
.endif
|
2007-05-19 00:25:59 -04:00
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
# DO NOT DELETE
|