1 .include "../Makefile.inc"
2 .include "../Makefile.langs"
4 CONTRIBDIR= ${GCCDIR}/gcc
15 version.c: ${CONTRIBDIR}/version.c Makefile ../Makefile.inc
17 echo '#define BASEVER "${GCCCOMPLETEVER}"' >> ${.TARGET}
18 echo '#define DATESTAMP ""' >> ${.TARGET}
19 echo '#define DEVPHASE ""' >> ${.TARGET}
20 echo '#define REVISION " [DragonFly] Release/${GCCDATESTAMP}"' >> ${.TARGET}
21 echo '#define PKGVERSION ""' >> ${.TARGET}
22 echo '#define BUGURL "<http://bugs.dragonflybsd.org>"' >> ${.TARGET}
23 cat ${.ALLSRC:M*.c} >> ${.TARGET}
26 echo "#define BUILDING_GCC_MAJOR `echo $(GCCCOMPLETEVER) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > ${.TARGET}
27 echo "#define BUILDING_GCC_MINOR `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
28 echo "#define BUILDING_GCC_PATCHLEVEL `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> ${.TARGET}
29 echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> ${.TARGET}
32 echo '#include "configargs.h"' > ${.TARGET}
34 echo "#define GCCPLUGIN_VERSION_MAJOR `echo $(GCCCOMPLETEVER) | sed -e 's/^\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
35 echo "#define GCCPLUGIN_VERSION_MINOR `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
36 echo "#define GCCPLUGIN_VERSION_PATCHLEVEL `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> ${.TARGET}
37 echo "#define GCCPLUGIN_VERSION (GCCPLUGIN_VERSION_MAJOR*1000 + GCCPLUGIN_VERSION_MINOR)" >> ${.TARGET}
39 echo 'static char basever[] = "${GCCCOMPLETEVER}";' >> ${.TARGET}
40 echo "static char datestamp[] = \"`echo ${GCCDATESTAMP} | sed -e 's/\.//g'`\";" >> ${.TARGET}
41 echo 'static char devphase[] = "release";' >> ${.TARGET}
42 echo 'static char revision[] = "";' >> ${.TARGET}
44 echo 'static struct plugin_gcc_version gcc_version = {basever, datestamp,' >> ${.TARGET}
45 echo ' devphase, revision, configuration_arguments};' >> ${.TARGET}
47 configargs.h: Makefile
48 echo '/* Generated automatically. */' > ${.TARGET}
49 echo 'static const char configuration_arguments[] = ' >> ${.TARGET}
50 echo ' "DragonFly/${TARGET_ARCH} system compiler (${LANG1}${LANG2}${LANG3}${LANG4})";' >> ${.TARGET}
51 echo 'static const char thread_model[] = "posix";' >> ${.TARGET}
53 echo 'static const struct {' >> ${.TARGET}
54 echo ' const char *name, *value;' >> ${.TARGET}
55 echo '} configure_default_options[] =' >> ${.TARGET}
56 echo '{ { NULL, NULL} };' >> ${.TARGET}
59 echo '#ifndef GCC_BCONFIG_H' > ${.TARGET}
60 echo '#define GCC_BCONFIG_H' >> ${.TARGET}
61 echo '#include "auto-host.h"' >> ${.TARGET}
62 echo '#ifdef IN_GCC' >> ${.TARGET}
63 echo '# include "ansidecl.h"' >> ${.TARGET}
64 echo '#endif' >> ${.TARGET}
65 echo '#endif /* GCC_BCONFIG_H */' >> ${.TARGET}
68 echo '#ifndef GCC_TM_H' > ${.TARGET}
69 echo '#define GCC_TM_H' >> ${.TARGET}
70 echo '#ifdef IN_GCC' >> ${.TARGET}
71 .for H in ${TARGET_INC}
72 echo '# include "$H"' >> ${.TARGET}
74 echo '#if !defined GENERATOR_FILE && !defined USED_FOR_TARGET' >> ${.TARGET}
75 echo '# include "insn-constants.h"' >> ${.TARGET}
76 echo '# include "insn-flags.h"' >> ${.TARGET}
77 echo '#endif' >> ${.TARGET}
78 echo '#endif' >> ${.TARGET}
79 echo '# include "defaults.h"' >> ${.TARGET}
80 echo '#endif /* GCC_TM_H */' >> ${.TARGET}
83 echo '#ifndef GCC_TM_P_H' > ${.TARGET}
84 echo '#define GCC_TM_P_H' >> ${.TARGET}
85 echo '#ifdef IN_GCC' >> ${.TARGET}
86 echo '# include "config/${GCC_CPU}/${GCC_CPU}-protos.h"' >> ${.TARGET}
87 echo '# include "tm-preds.h"' >> ${.TARGET}
88 echo '#endif' >> ${.TARGET}
89 echo '#endif /* GCC_TM_P_H */' >> ${.TARGET}
91 optionlist: ${optionsfiles} Makefile
92 /usr/bin/awk -f ${GCCDIR}/gcc/opt-gather.awk \
93 ${optionsfiles} > optionlist
96 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
97 -f ${GCCDIR}/gcc/opt-read.awk \
98 -f ${GCCDIR}/gcc/optc-gen.awk \
99 -v header_name="config.h system.h coretypes.h tm.h" \
100 < optionlist > ${.TARGET}
102 options-save.c: optionlist
103 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
104 -f ${GCCDIR}/gcc/opt-read.awk \
105 -f ${GCCDIR}/gcc/optc-save-gen.awk \
106 -v header_name="config.h system.h coretypes.h tm.h" \
107 < optionlist > ${.TARGET}
109 options.h: optionlist
110 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
111 -f ${GCCDIR}/gcc/opt-read.awk \
112 -f ${GCCDIR}/gcc/opth-gen.awk \
113 < optionlist > ${.TARGET}
115 i386-builtin-types.inc:
116 /usr/bin/awk -f ${GCCDIR}/gcc/config/i386/i386-builtin-types.awk \
117 ${GCCDIR}/gcc/config/i386/i386-builtin-types.def \
123 .for F in ${LANG_SPECS_FILES}
124 echo "#include \"${F}\"" >> ${.TARGET}
129 echo '#include "tree.def"' >> ${.TARGET}
130 echo 'END_OF_BASE_TREE_CODES' >> ${.TARGET}
131 echo '#include "c-family/c-common.def"' >> ${.TARGET}
132 .for F in ${lang_tree_files}
133 echo '#include "$F"' >> ${.TARGET}
136 CLEANFILES+= version.c configargs.h bconfig.h tm.h tm_p.h
137 CLEANFILES+= options.c options-save.c options.h optionlist
138 CLEANFILES+= specs.h all-tree.def bversion.h plugin-version.h
141 afterdepend: version.c configargs.h bconfig.h tm.h tm_p.h options.h options.c
142 afterdepend: options-save.c specs.h all-tree.def bversion.h plugin-version.h
144 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "x86_64"
145 CLEANFILES+= i386-builtin-types.inc
146 afterdepend: i386-builtin-types.inc
149 .include <bsd.prog.mk>