opnsense-src/gnu/usr.bin/cc/cc_tools/Makefile

554 lines
16 KiB
Makefile
Raw Normal View History

1999-08-27 19:37:10 -04:00
# $FreeBSD$
.include <bsd.own.mk>
#
# This could probably be merged with ../cc_int/Makefile, but bsd.lib.mk
# is such a !@#!*#% nightmare because of how it reprograms the dependencies,
# suffix rules, SRCS, etc. It's easiest to cheat by using bsd.prog.mk and
# SRCS to get dependencies.
#
#
# ../Makefile.inc will put an absolute path to our objdir in CFLAGS.
# Prevent mkdep from using it, so that we don't have to give rules for
# aliases of generated headers.
#
CFLAGS+= -I.
.include "../Makefile.inc"
2004-07-28 01:27:21 -04:00
.PATH: ${GCCDIR} ${GCCDIR}/f
CFLAGS+= -DGENERATOR_FILE
2004-07-28 01:27:21 -04:00
#
#-----------------------------------------------------------------------
# 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 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 splay-tree.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c
2004-07-28 01:27:21 -04:00
LIBIBERTY_OBJS= ${LIBIBERTY_SRCS:R:S/$/.o/g}
SRCS+= ${LIBIBERTY_SRCS}
LIBIBERTY=libiberty.a
${LIBIBERTY}: ${LIBIBERTY_OBJS}
@rm -f ${.TARGET}
@${AR} cq ${.TARGET} `lorder ${LIBIBERTY_OBJS} | tsort -q`
${RANLIB} ${.TARGET}
CLEANFILES+= ${LIBIBERTY}
#
#-----------------------------------------------------------------------
# options
OPTION_FILES=${GCCDIR}/f/lang.opt ${GCCDIR}/c.opt ${GCCDIR}/common.opt
.ORDER: options.h options.c
options.h options.c: opts.sh ${OPTION_FILES}
/bin/sh ${GCCDIR}/opts.sh mv options.c options.h ${OPTION_FILES}
GENSRCS+= options.c options.h
CLEANFILES+= options.c options.h
#-----------------------------------------------------------------------
# insn-* gunk
.for F in attr codes config flags constants
insn-$F.h: gen$F ${MD_FILE}
./gen$F ${MD_FILE} > insn-$F.h
GENSRCS+= insn-$F.h
.endfor
.for F in conditions
insn-$F.c: gen$F ${MD_FILE}
./gen$F ${MD_FILE} > insn-$F.c
GENSRCS+= insn-$F.c
.endfor
GENSRCS+= gen-time-stamp
gen-time-stamp: genattr genattrtab genconditions genconstants genemit \
genextract gengtype genopinit genoutput genpeep genrecog
touch ${.TARGET}
.for F in attr codes config emit extract flags opinit output peep recog
2004-07-28 01:27:21 -04:00
gen$F: gen$F.o rtl.o print-rtl.o bitmap.o gensupport.o ggc-none.o \
read-rtl.o insn-conditions.o min-insn-modes.o errors.o ${LIBIBERTY}
2002-04-05 05:23:19 -05:00
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
GENSRCS+= gen$F.c
CLEANFILES+= gen$F
.endfor
#
# genattrtab needs more complex build rule
#
2004-07-28 01:27:21 -04:00
genattrtab : genattrtab.o rtl.o print-rtl.o bitmap.o gensupport.o ggc-none.o \
read-rtl.o insn-conditions.o genautomata.o varray.o min-insn-modes.o \
errors.o ${LIBIBERTY}
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lm
GENSRCS+= genattrtab.c
CLEANFILES+= genattrtab
#
# genconstants and genconditions cannot depend on insn-conditions.o
# they should be liked with dummy-conditions.o stubs instead
#
.for F in constants conditions
gen$F: gen$F.o rtl.o bitmap.o gensupport.o ggc-none.o read-rtl.o dummy-conditions.o min-insn-modes.o errors.o ${LIBIBERTY}
2002-04-05 05:23:19 -05:00
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
GENSRCS+= gen$F.c
CLEANFILES+= gen$F
.endfor
2004-07-28 01:27:21 -04:00
.for F in modes check genrtl preds
gen$F: gen$F.o errors.o ${LIBIBERTY}
2002-04-05 05:23:19 -05:00
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
GENSRCS+= gen$F.c
CLEANFILES+= gen$F
.endfor
.ORDER: genrtl.c genrtl.h
genrtl.c genrtl.h: gengenrtl
./gengenrtl > genrtl.c
./gengenrtl -h > genrtl.h
GENSRCS+= genrtl.c genrtl.h
SRCS+= bitmap.c dummy-conditions.c errors.c genautomata.c gensupport.c \
ggc-none.c print-rtl.c read-rtl.c rtl.c varray.c
2004-07-28 01:27:21 -04:00
#-----------------------------------------------------------------------
# insn modes stuff.
.ORDER: insn-modes.c insn-modes.h
insn-modes.h: genmodes
./genmodes -h > insn-modes.h
insn-modes.c: genmodes
./genmodes > insn-modes.c
min-insn-modes.c: genmodes
./genmodes -m > min-insn-modes.c
GENSRCS+= insn-modes.c min-insn-modes.c insn-modes.h
#-----------------------------------------------------------------------
# Common parser stuff.
tree-check.h: gencheck
./gencheck > ${.TARGET}
GENSRCS+= tree-check.h
2002-04-06 18:18:01 -05:00
#-----------------------------------------------------------------------
# Predicates stuff.
tm-preds.h: genpreds
./genpreds > ${.TARGET}
GENSRCS+= tm-preds.h
#-----------------------------------------------------------------------
# Gengtype
gengtype-lex.c : gengtype-lex.l
${LEX} -t ${.ALLSRC} | \
sed 's/^\(char msg\[\];\)/yyconst \1/' > ${.TARGET}
.ORDER: gengtype-yacc.c gengtype-yacc.h
gengtype-yacc.c gengtype-yacc.h: gengtype-yacc.y
${YACC} -d -o gengtype-yacc.c ${.ALLSRC}
GENSRCS+= gengtype-yacc+%DIKED.c gengtype-yacc.h gengtype-lex.c
CLEANFILES+= gengtype-yacc.c
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}
2004-07-28 01:27:21 -04:00
gengtype: gengtype.o gengtype-yacc+%DIKED.o gengtype-lex.o ${LIBIBERTY}
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
GENSRCS+= gengtype.c
CLEANFILES+= gengtype
gengtype-lex.o: gengtype-yacc.h
.ORDER: gtype-desc.c gtype-desc.h
gtype-desc.c gtype-desc.h: gtype-time-stamp
@true
GENSRCS+= gtype-time-stamp
gtype-time-stamp: gengtype ${GTFILES}
./gengtype
touch ${.TARGET}
GENSRCS+= gtype-desc.c gtype-desc.h
CLEANFILES+= gt-*.h gtype-*.h
2004-07-28 01:27:21 -04:00
#
#-----------------------------------------------------------------------
# Fortran build tools
.if ${MK_FORTRAN} != "no"
2004-07-28 01:27:21 -04:00
gen-time-stamp: fini
fini: fini.o ${LIBIBERTY}
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
SRCS+= fini.c
CLEANFILES+= fini
.endif
#-----------------------------------------------------------------------
# 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
#
2004-07-28 01:27:21 -04:00
.if ${TARGET_ARCH} == "amd64"
TARGET_INC= i386/biarch64.h
.endif
.if ${TARGET_ARCH} != "arm"
TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h
.endif
.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/unix.h
TARGET_INC+= ${GCC_CPU}/att.h
.endif
.if ${TARGET_ARCH} != "alpha"
TARGET_INC+= dbxelf.h
TARGET_INC+= elfos.h
.endif
TARGET_INC+= freebsd-native.h
TARGET_INC+= freebsd-spec.h
TARGET_INC+= freebsd.h
.if ${TARGET_ARCH} == "alpha"
TARGET_INC+= ${GCC_CPU}/elf.h
.endif
.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
.if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
TARGET_INC+= ${GCC_CPU}/sysv4.h
.endif
.endif
.if ${TARGET_ARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/elf.h
TARGET_INC+= ${GCC_CPU}/aout.h
TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h
. if defined(TARGET_BIG_ENDIAN)
CFLAGS+= -DTARGET_ENDIAN_DEFAULT=ARM_FLAG_BIG_END
. endif
.endif
.if ${TARGET_ARCH} == "arm"
TARGET_INC+= freebsd-diked.h
.else
TARGET_INC+= ${GCC_CPU}/freebsd.h
.endif
.if ${TARGET_ARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/x86-64.h
TARGET_INC+= ${GCC_CPU}/freebsd64.h
TARGET_INC+= freebsd64-fix.h
.endif
2004-07-28 01:27:21 -04:00
.if ${TARGET_ARCH} == "powepc"
TARGET_INC+= altivec-defs.h
.endif
TARGET_INC+= defaults.h
#
# Use TARGET_INC as a template and build a list of target specific
# include files for gengtype to scan
#
2004-07-28 01:27:21 -04:00
GCONFIG_H= ${.CURDIR}/auto-host.h
.for H in ${TARGET_INC}
.for D in ${GCCDIR}/config ${GCCDIR} ${.CURDIR}
.if exists($D/$H)
GCONFIG_H+= $D/$H
.endif
.endfor
.endfor
#
# Define some variables to make blocks copied from Makefile.in happy
#
srcdir= ${GCCDIR}
HASHTAB_H= ${GCCDIR}/hashtab.h
2004-07-28 01:27:21 -04:00
SPLAY_TREE_H= ${GCCDIR}/splay-tree.h
out_file= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.c
GTFILES_SRCDIR= ${GCCDIR}
#
# Copied unchanged from gcc/Makefile.in
#
2004-07-28 01:27:21 -04:00
GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
$(GCONFIG_H) $(HASHTAB_H) $(SPLAY_TREE_H) \
$(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
$(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h \
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
$(srcdir)/c-common.h $(srcdir)/c-tree.h \
2004-07-28 01:27:21 -04:00
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
$(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
2005-06-03 00:21:04 -04:00
$(srcdir)/dojump.c \
2004-07-28 01:27:21 -04:00
$(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
$(srcdir)/fold-const.c $(srcdir)/function.c \
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
$(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \
2004-07-28 01:27:21 -04:00
$(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/langhooks.c \
$(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
2005-06-03 00:21:04 -04:00
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(out_file)
#
# Build a list of frontend directories to look into
#
GTFILES_LANG_DIR_NAMES=
.if ${MK_CXX} != "no"
GTFILES_LANG_DIR_NAMES+= cp
.endif
.if ${MK_OBJC} != "no"
GTFILES_LANG_DIR_NAMES+= objc
.endif
.if ${MK_FORTRAN} != "no"
GTFILES_LANG_DIR_NAMES+= f
.endif
#
# Build a list of language specific files for gengtype
#
.for L in ${GTFILES_LANG_DIR_NAMES} c
.if exists(${GCCDIR}/$L-config-lang.in)
# Source the language config file
L_GTFILES!= sh -c '. ${GCCDIR}/$L-config-lang.in; echo $$gtfiles'
.else
L_GTFILES!= sh -c '. ${GCCDIR}/$L/config-lang.in; echo $$gtfiles'
.endif
.for F in ${L_GTFILES}
GTFILES_FILES+= $F
GTFILES_LANGS+= $L
.endfor
.endfor
GTFILES+= ${GTFILES_FILES}
#-----------------------------------------------------------------------
# the host/target compiler config.
2004-07-28 01:27:21 -04:00
COMMONHDRS= bconfig.h config.h configargs.h gencheck.h multilib.h \
specs.h safe-ctype.h tconfig.h tm.h tm_p.h gcov-iov.h \
gtyp-gen.h
GENSRCS+= ${COMMONHDRS}
2002-04-06 18:18:01 -05:00
MFILE?= ${.CURDIR}/Makefile
${COMMONHDRS}: ${MFILE}
configargs.h:
echo 'static const char configuration_arguments[] =' > ${.TARGET}
echo ' "FreeBSD/${TARGET_ARCH} system compiler";' >> ${.TARGET}
echo 'static const char thread_model[] = "posix";' >> ${.TARGET}
2004-07-28 01:27:21 -04:00
echo 'static const struct {' >> ${.TARGET}
echo ' const char *name, *value;' >> ${.TARGET}
echo '} configure_default_options[] = {' >> ${.TARGET}
echo ' { "NULL", "NULL" } };' >> ${.TARGET}
tconfig.h:
echo '#ifndef GCC_TCONFIG_H' > ${.TARGET}
echo '#define GCC_TCONFIG_H' >> ${.TARGET}
echo '#ifdef IN_GCC' >> ${.TARGET}
echo '# include "ansidecl.h"' >> ${.TARGET}
echo '#endif' >> ${.TARGET}
echo '#define USED_FOR_TARGET' >> ${.TARGET}
echo '#endif /* GCC_TCONFIG_H */' >> ${.TARGET}
2004-07-28 01:27:21 -04:00
bconfig.h:
echo '#ifndef GCC_BCONFIG_H' > ${.TARGET}
echo '#define GCC_BCONFIG_H' >> ${.TARGET}
echo '#include "auto-host.h"' >> ${.TARGET}
.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
.endif
echo '#ifdef IN_GCC' >> ${.TARGET}
echo '# include "ansidecl.h"' >> ${.TARGET}
echo '#endif' >> ${.TARGET}
echo '#endif /* GCC_BCONFIG_H */' >> ${.TARGET}
gencheck.h:
echo '#include "cp/cp-tree.def"' > ${.TARGET}
echo '#include "objc/objc-tree.def"' >> ${.TARGET}
multilib.h:
echo 'static const char *const multilib_raw[] = { \
"aout maout;", "elf !maout;", NULL };' > ${.TARGET}
echo 'static const char *const multilib_matches_raw[] = { \
"maout maout;", "melf melf;", 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}
specs.h:
echo '#include "cp/lang-specs.h"' > ${.TARGET}
echo '#include "f/lang-specs.h"' >> ${.TARGET}
echo '#include "objc/lang-specs.h"' >> ${.TARGET}
2004-07-28 01:27:21 -04:00
config.h: bconfig.h
echo '#include <bconfig.h>' > ${.TARGET}
2004-07-28 01:27:21 -04:00
tm.h:
echo '#ifndef GCC_TM_H' > ${.TARGET}
echo '#define GCC_TM_H' >> ${.TARGET}
.if defined(TARGET_CPU_DEFAULT)
echo "#define TARGET_CPU_DEFAULT (${TARGET_CPU_DEFAULT})" >> ${.TARGET}
.endif
2004-07-28 01:27:21 -04:00
echo '#ifdef IN_GCC' >> ${.TARGET}
.for H in ${TARGET_INC}
echo '#include "$H"' >> ${.TARGET}
.endfor
2004-07-28 01:27:21 -04:00
echo '#if !defined GENERATOR_FILE && !defined USED_FOR_TARGET' >> ${.TARGET}
echo '# include "insn-constants.h"' >> ${.TARGET}
echo '# include "insn-flags.h"' >> ${.TARGET}
echo '#endif' >> ${.TARGET}
2002-04-06 18:18:01 -05:00
echo '#endif' >> ${.TARGET}
.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
.endif
2004-07-28 01:27:21 -04:00
echo '#endif /* GCC_TM_H */' >> ${.TARGET}
tm_p.h:
2002-04-06 18:18:01 -05:00
echo '#include "${GCC_CPU}/${GCC_CPU}-protos.h"' >> ${.TARGET}
echo '#include "tm-preds.h"' >> ${.TARGET}
2004-07-28 01:27:21 -04:00
safe-ctype.h:
2002-04-06 18:18:01 -05:00
echo '#include <ctype.h>' > ${.TARGET}
.for Z in TOUPPER TOLOWER ISDIGIT ISXDIGIT ISUPPER ISLOWER ISALPHA ISALNUM \
ISSPACE ISPUNCT ISGRAPH ISBLANK ISPRINT ISCNTRL
echo '#define ${Z} ${Z:L}' >> ${.TARGET}
.endfor
echo "#define ISIDST(x) \
((x) == '_' || isalpha(x))" >> ${.TARGET}
echo "#define ISIDNUM(x) \
(isdigit(x) || ISIDST(x))" >> ${.TARGET}
echo "#define IS_VSPACE(x) \
((x) == '\n' || (x) == '\r')" >> ${.TARGET}
echo "#define IS_NVSPACE(x) \
(!IS_VSPACE(x) && (isspace(x) || (x) == '\0'))" >> ${.TARGET}
echo "#define IS_SPACE_OR_NUL(x) \
(isspace(x) || (x) == '\0')" >> ${.TARGET}
gtyp-gen.h:
echo "/* This file is machine generated. Do not edit. */" > ${.TARGET}
echo "static const char *srcdir = " >> ${.TARGET}
echo "\"$(GTFILES_SRCDIR)\";" >> ${.TARGET}
echo "static const char *lang_files[] = {" >> ${.TARGET}
.for F in ${GTFILES_FILES}
echo "\"$F\", " >> ${.TARGET}
.endfor
echo "NULL};" >> ${.TARGET}
echo "static const char *langs_for_lang_files[] = {" >> ${.TARGET}
.for F in ${GTFILES_LANGS}
echo "\"$F\", " >> ${.TARGET}
.endfor
echo "NULL};" >> ${.TARGET}
echo "static const char *all_files[] = {" >> ${.TARGET}
.for F in ${GTFILES}
echo "\"$F\", " >> ${.TARGET}
.endfor
echo "NULL};" >> ${.TARGET}
echo "static const char *lang_dir_names[] = { \"c\", " >> ${.TARGET}
.for F in ${GTFILES_LANG_DIR_NAMES}
echo "\"$F\", " >> ${.TARGET}
.endfor
echo "NULL};" >> ${.TARGET}
2004-07-28 01:27:21 -04:00
gcov-iov.h:
echo "#define GCOV_VERSION ((gcov_unsigned_t)0x33303470)" >> ${.TARGET}
.if ${TARGET_ARCH} == "arm"
freebsd-diked.h: ${GCCDIR}/../../gnu/usr.bin/cc/cc_tools/arm-freebsd.h.diff
cp ${GCCDIR}/config/arm/freebsd.h freebsd.h
patch freebsd.h ${.ALLSRC}
mv freebsd.h ${.TARGET}
COMMONHDRS+= freebsd-diked.h
CLEANFILES+= freebsd.h.orig
# Make sure freebsd-diked.h is built when tm.h is built for csu's sake
tm.h: freebsd-diked.h
${MD_FILE}: ${MFILE}
cp ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md .
ln -sf ${GCCDIR}/config/${GCC_CPU}/fpa.md .
ln -sf ${GCCDIR}/config/${GCC_CPU}/cirrus.md .
ln -sf ${GCCDIR}/config/${GCC_CPU}/iwmmxt.md .
patch ${GCC_CPU}.md ${.CURDIR}/arm.md.diff
mv ${GCC_CPU}.md ${.TARGET}
CLEANFILES+= arm-diked.md ${GCC_CPU}.md.orig fpa.md cirrus.md iwmmxt.md
.endif
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
#-----------------------------------------------------------------------
# General things.
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
SRCS+= ${GENSRCS}
CLEANFILES+= ${GENSRCS}
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
2004-07-28 01:27:21 -04:00
all: ${SRCS}
.include <bsd.prog.mk>
#-----------------------------------------------------------------------
# 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.
#
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
2004-01-15 05:07:59 -05:00
CLEANFILES+= ${OBJS}
.if !exists(${DEPENDFILE})
# Fudge pre-dependfile dependencies of objects in much the same way as
2004-07-28 01:27:21 -04:00
# bsd.prog.mk would do if we defined PROG.
${OBJS}: ${COMMONHDRS}
dummy-conditions.o:
gencheck.o:
genmodes.o:
genpreds.o: insn-modes.h
genconstants.o: insn-modes.h genrtl.h
gengtype.o: insn-modes.h genrtl.h gtyp-gen.h
rtl.o: insn-modes.h gtype-desc.h genrtl.h
bitmap.o: insn-modes.h gtype-desc.h genrtl.h
ggc-none.o: gtype-desc.h
gensupport.o: insn-modes.h genrtl.h
varray.o: gtype-desc.h
genautomata.o: insn-modes.h genrtl.h
genconditions.o: insn-modes.h genrtl.h
gencodes.o: insn-modes.h genrtl.h
genconfig.o: insn-modes.h genrtl.h
print-rtl.o: insn-modes.h genrtl.h tm-preds.h tree-check.h
read-rtl.o: insn-modes.h genrtl.h
2004-07-28 01:27:21 -04:00
genattr.o: insn-modes.h genrtl.h
genemit.o: insn-modes.h genrtl.h
genflags.o: insn-modes.h genrtl.h
genopinit.o: insn-modes.h genrtl.h
genoutput.o: insn-modes.h genrtl.h
genpeep.o: insn-modes.h genrtl.h
genrecog.o: insn-modes.h genrtl.h
genextract.o: genrtl.h insn-config.h
genattrtab.o: insn-modes.h gtype-desc.h genrtl.h
genrtl.o: insn-modes.h genrtl.h gtype-desc.h
insn-conditions.o: insn-constants.h tm-preds.h
insn-modes.o: insn-modes.h
min-insn-modes.o: insn-modes.h
gtype-desc.o: insn-modes.h insn-config.h insn-codes.h tree-check.h
.endif