1 # $DragonFly: src/gnu/usr.bin/cc41/cc_prep/Makefile,v 1.1 2006/09/27 12:10:33 corecode Exp $
3 .include "../Makefile.inc"
4 .include "../Makefile.langs"
6 CONTRIBDIR= ${GCCDIR}/gcc
8 BASEVER_s!= cat ${CONTRIBDIR}/BASE-VER
10 version.c: ${CONTRIBDIR}/version.c Makefile BASE-VER
12 echo '#define BASEVER "${BASEVER_s}"' >> ${.TARGET}
13 echo '#define DATESTAMP ""' >> ${.TARGET}
14 echo '#define DEVPHASE ""' >> ${.TARGET}
15 echo '#define VERSUFFIX " (DragonFly)"' >> ${.TARGET}
16 sed -e '/^#define VERSUFFIX/d' < ${.ALLSRC:M*c} >> ${.TARGET}
18 configargs.h: Makefile
19 echo '/* Generated automatically. */' > ${.TARGET}
20 echo 'static const char configuration_arguments[] = ' >> ${.TARGET}
21 echo ' "DragonFly/${TARGET_ARCH} system compiler";' >> ${.TARGET}
22 echo 'static const char thread_model[] = "posix";' >> ${.TARGET}
24 echo 'static const struct {' >> ${.TARGET}
25 echo ' const char *name, *value;' >> ${.TARGET}
26 echo '} configure_default_options[] =' >> ${.TARGET}
27 echo '{ { NULL, NULL} };' >> ${.TARGET}
30 echo '#ifndef GCC_BCONFIG_H' > ${.TARGET}
31 echo '#define GCC_BCONFIG_H' >> ${.TARGET}
32 echo '#include "dragonfly-native.h"' >> ${.TARGET}
33 .if exists(${GCCDIR}/gcc/config/${GCC_CPU}/${GCC_CPU}-modes.def)
34 echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
36 echo '#ifdef IN_GCC' >> ${.TARGET}
37 echo '# include "ansidecl.h"' >> ${.TARGET}
38 echo '#endif' >> ${.TARGET}
39 echo '#endif /* GCC_BCONFIG_H */' >> ${.TARGET}
42 echo '#ifndef GCC_TM_H' > ${.TARGET}
43 echo '#define GCC_TM_H' >> ${.TARGET}
44 .if defined(TARGET_CPU_DEFAULT)
45 echo "#define TARGET_CPU_DEFAULT (${TARGET_CPU_DEFAULT})" >> ${.TARGET}
47 echo '#ifdef IN_GCC' >> ${.TARGET}
48 .for H in ${TARGET_INC}
49 echo '#include "$H"' >> ${.TARGET}
51 echo '#if !defined GENERATOR_FILE && !defined USED_FOR_TARGET' >> ${.TARGET}
52 echo '# include "insn-constants.h"' >> ${.TARGET}
53 echo '# include "insn-flags.h"' >> ${.TARGET}
54 echo '#endif' >> ${.TARGET}
55 echo '#endif' >> ${.TARGET}
56 #.if exists(${GCCDIR}/gcc/config/${GCC_CPU}/${GCC_CPU}-modes.def)
57 # echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
59 echo '#endif /* GCC_TM_H */' >> ${.TARGET}
62 echo '#include "${GCC_CPU}/${GCC_CPU}-protos.h"' >> ${.TARGET}
63 echo '#include "tm-preds.h"' >> ${.TARGET}
65 optionlist: ${optionsfiles} Makefile
66 /usr/bin/awk -f ${GCCDIR}/gcc/opt-gather.awk ${optionsfiles} > optionlist
69 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk -f ${GCCDIR}/gcc/optc-gen.awk \
70 -v header_name="config.h system.h coretypes.h tm.h" < optionlist > options.c
73 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk -f ${GCCDIR}/gcc/opth-gen.awk \
74 < optionlist > options.h
76 CLEANFILES+= version.c configargs.h bconfig.h tm.h tm_p.h
77 CLEANFILES+= options.c options.h optionlist
79 .include <bsd.prog.mk>
82 depend: version.c configargs.h bconfig.h tm.h tm_p.h options.h options.c