1 .include "../Makefile.inc"
2 .include "../Makefile.langs"
4 CONTRIBDIR= ${GCCDIR}/gcc
6 LANGUAGES= c c++ objc LTO
8 version.c: ${CONTRIBDIR}/version.c Makefile ../Makefile.inc
10 echo '#define BASEVER "${GCCCOMPLETEVER}"' >> ${.TARGET}
11 echo '#define DATESTAMP ""' >> ${.TARGET}
12 echo '#define DEVPHASE ""' >> ${.TARGET}
13 echo '#define REVISION " [DragonFly] ${GCCRELEASE}/${GCCDATESTAMP}"' >> ${.TARGET}
14 echo '#define PKGVERSION ""' >> ${.TARGET}
15 echo '#define BUGURL "<http://bugs.dragonflybsd.org>"' >> ${.TARGET}
16 cat ${.ALLSRC:M*.c} >> ${.TARGET}
19 echo "#define BUILDING_GCC_MAJOR `echo $(GCCCOMPLETEVER) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > ${.TARGET}
20 echo "#define BUILDING_GCC_MINOR `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
21 echo "#define BUILDING_GCC_PATCHLEVEL `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> ${.TARGET}
22 echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> ${.TARGET}
25 echo '#include "configargs.h"' > ${.TARGET}
26 echo "#define GCCPLUGIN_VERSION_MAJOR `echo $(GCCCOMPLETEVER) | sed -e 's/^\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
27 echo "#define GCCPLUGIN_VERSION_MINOR `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> ${.TARGET}
28 echo "#define GCCPLUGIN_VERSION_PATCHLEVEL `echo $(GCCCOMPLETEVER) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> ${.TARGET}
29 echo "#define GCCPLUGIN_VERSION (GCCPLUGIN_VERSION_MAJOR*1000 + GCCPLUGIN_VERSION_MINOR)" >> ${.TARGET}
30 echo 'static char basever[] = "${GCCCOMPLETEVER}";' >> ${.TARGET}
31 echo "static char datestamp[] = \"`echo ${GCCDATESTAMP} | sed -e 's/\.//g'`\";" >> ${.TARGET}
32 echo 'static char devphase[] = "release";' >> ${.TARGET}
33 echo 'static char revision[] = "";' >> ${.TARGET}
34 echo 'static struct plugin_gcc_version gcc_version = {basever,' >> ${.TARGET}
35 echo ' datestamp, devphase, revision, configuration_arguments};' >> ${.TARGET}
37 configargs.h: Makefile
38 echo 'static const char configuration_arguments[] = ' > ${.TARGET}
39 echo ' "DragonFly/${TARGET_ARCH} system compiler (${LANGUAGES}${LANG3}${LANG4})";' >> ${.TARGET}
40 echo 'static const char thread_model[] = "posix";' >> ${.TARGET}
41 echo 'static const struct {' >> ${.TARGET}
42 echo ' const char *name, *value;' >> ${.TARGET}
43 echo '} configure_default_options[] =' >> ${.TARGET}
44 echo ' { { "cpu", "generic" } };' >> ${.TARGET}
47 echo '#ifndef GCC_BCONFIG_H' > ${.TARGET}
48 echo '#define GCC_BCONFIG_H' >> ${.TARGET}
49 echo '#include "auto-host.h"' >> ${.TARGET}
50 echo '#ifdef IN_GCC' >> ${.TARGET}
51 echo '# include "ansidecl.h"' >> ${.TARGET}
52 echo '#endif' >> ${.TARGET}
53 echo '#endif' >> ${.TARGET}
56 echo '#ifndef GCC_TM_H' > ${.TARGET}
57 echo '#define GCC_TM_H' >> ${.TARGET}
58 echo '#ifndef LIBC_GLIBC' >> ${.TARGET}
59 echo '# define LIBC_GLIBC 1' >> ${.TARGET}
60 echo '#endif' >> ${.TARGET}
61 echo '#ifndef LIBC_UCLIBC' >> ${.TARGET}
62 echo '# define LIBC_UCLIBC 2' >> ${.TARGET}
63 echo '#endif' >> ${.TARGET}
64 echo '#ifndef LIBC_BIONIC' >> ${.TARGET}
65 echo '# define LIBC_BIONIC 3' >> ${.TARGET}
66 echo '#endif' >> ${.TARGET}
67 .if defined(REALLY_NOSHARED)
68 echo '#undef HAVE_LTO_PLUGIN' >> ${.TARGET}
69 echo '#define HAVE_LTO_PLUGIN 0'>> ${.TARGET}
71 echo '#ifdef IN_GCC' >> ${.TARGET}
72 .for H in ${TARGET_INC}
73 echo '# include "$H"' >> ${.TARGET}
75 echo '#endif' >> ${.TARGET}
76 echo '#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET' >> ${.TARGET}
77 echo '# include "insn-flags.h"' >> ${.TARGET}
78 echo '#endif' >> ${.TARGET}
79 echo '#if defined IN_GCC && !defined GENERATOR_FILE' >> ${.TARGET}
80 echo '# include "insn-modes.h"' >> ${.TARGET}
81 echo '#endif' >> ${.TARGET}
82 echo '#if defined IN_GCC && defined GENERATOR_FILE && !defined BITS_PER_UNIT' >> ${.TARGET}
83 echo '#include "machmode.h"' >> ${.TARGET}
84 echo '#endif' >> ${.TARGET}
85 echo '# include "defaults.h"' >> ${.TARGET}
86 echo '#endif' >> ${.TARGET}
89 echo '#ifndef GCC_TM_P_H' > ${.TARGET}
90 echo '#define GCC_TM_P_H' >> ${.TARGET}
91 echo '#ifdef IN_GCC' >> ${.TARGET}
92 echo '# include "config/i386/i386-protos.h"' >> ${.TARGET}
93 echo '# include "tm-preds.h"' >> ${.TARGET}
94 echo '#endif' >> ${.TARGET}
95 echo '#endif' >> ${.TARGET}
98 .for F in ${LANG_SPECS_FILES}
99 echo "#include \"${F}\"" >> ${.TARGET}
103 echo '#include "tree.def"' >> ${.TARGET}
104 echo 'END_OF_BASE_TREE_CODES' >> ${.TARGET}
105 echo '#include "c-family/c-common.def"' >> ${.TARGET}
106 echo '#include "cp/cp-tree.def"' >> ${.TARGET}
107 echo '#include "objc/objc-tree.def"' >> ${.TARGET}
109 optionlist: ${optionsfiles} Makefile
110 /usr/bin/awk -f ${GCCDIR}/gcc/opt-gather.awk \
111 ${optionsfiles} > ${.TARGET}
113 options.c: optionlist
114 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
115 -f ${GCCDIR}/gcc/opt-read.awk \
116 -f ${GCCDIR}/gcc/optc-gen.awk \
117 -v header_name="${header_name_save}" \
118 < optionlist > ${.TARGET}
120 options-save.c: optionlist
121 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
122 -f ${GCCDIR}/gcc/opt-read.awk \
123 -f ${GCCDIR}/gcc/optc-save-gen.awk \
124 -v header_name="${header_name}" \
125 < optionlist > ${.TARGET}
127 options.h: optionlist
128 /usr/bin/awk -f ${GCCDIR}/gcc/opt-functions.awk \
129 -f ${GCCDIR}/gcc/opt-read.awk \
130 -f ${GCCDIR}/gcc/opth-gen.awk \
131 < optionlist > ${.TARGET}
133 i386-builtin-types.inc:
134 /usr/bin/awk -f ${GCCDIR}/gcc/config/i386/i386-builtin-types.awk \
135 ${GCCDIR}/gcc/config/i386/i386-builtin-types.def > ${.TARGET}
137 CLEANFILES+= version.c configargs.h bconfig.h tm.h tm_p.h
138 CLEANFILES+= options.c options-save.c options.h optionlist
139 CLEANFILES+= specs.h all-tree.def bversion.h plugin-version.h
142 afterdepend: version.c configargs.h bconfig.h tm.h tm_p.h options.h options.c
143 afterdepend: options-save.c specs.h all-tree.def bversion.h plugin-version.h
145 CLEANFILES+= i386-builtin-types.inc
146 afterdepend: i386-builtin-types.inc
148 .include <bsd.prog.mk>