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 PATCHES
!= echo
${.CURDIR
}/patches
/*.patch
7 CONTRIBDIR
= ${GCCDIR}/gcc
9 BASEVER_s
!= cat
${CONTRIBDIR}/BASE-VER
11 version.c
: ${CONTRIBDIR}/version.c Makefile BASE-VER
13 echo
'#define BASEVER "${BASEVER_s}"' >> ${.TARGET
}
14 echo
'#define DATESTAMP ""' >> ${.TARGET
}
15 echo
'#define DEVPHASE ""' >> ${.TARGET
}
16 echo
'#define VERSUFFIX " (DragonFly)"' >> ${.TARGET
}
17 sed
-e
'/^#define VERSUFFIX/d' < ${.ALLSRC
:M
*c
} >> ${.TARGET
}
19 configargs.h
: Makefile
20 echo
'/* Generated automatically. */' > ${.TARGET
}
21 echo
'static const char configuration_arguments[] = ' >> ${.TARGET
}
22 echo
' "DragonFly/${TARGET_ARCH} system compiler";' >> ${.TARGET
}
23 echo
'static const char thread_model[] = "posix";' >> ${.TARGET
}
25 echo
'static const struct {' >> ${.TARGET
}
26 echo
' const char *name, *value;' >> ${.TARGET
}
27 echo
'} configure_default_options[] =' >> ${.TARGET
}
28 echo
'{ { NULL, NULL} };' >> ${.TARGET
}
31 echo
'#ifndef GCC_BCONFIG_H' > ${.TARGET
}
32 echo
'#define GCC_BCONFIG_H' >> ${.TARGET
}
33 echo
'#include "dragonfly-native.h"' >> ${.TARGET
}
34 .if exists
(${GCCDIR}/gcc
/config
/${GCC_CPU}/${GCC_CPU}-modes.def
)
35 echo
'#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET
}
37 echo
'#ifdef IN_GCC' >> ${.TARGET
}
38 echo
'# include "ansidecl.h"' >> ${.TARGET
}
39 echo
'#endif' >> ${.TARGET
}
40 echo
'#endif /* GCC_BCONFIG_H */' >> ${.TARGET
}
43 echo
'#ifndef GCC_TM_H' > ${.TARGET
}
44 echo
'#define GCC_TM_H' >> ${.TARGET
}
45 .if defined
(TARGET_CPU_DEFAULT
)
46 echo
"#define TARGET_CPU_DEFAULT (${TARGET_CPU_DEFAULT})" >> ${.TARGET
}
48 echo
'#ifdef IN_GCC' >> ${.TARGET
}
49 .for H in
${TARGET_INC}
50 echo
'#include "$H"' >> ${.TARGET
}
52 echo
'#if !defined GENERATOR_FILE && !defined USED_FOR_TARGET' >> ${.TARGET
}
53 echo
'# include "insn-constants.h"' >> ${.TARGET
}
54 echo
'# include "insn-flags.h"' >> ${.TARGET
}
55 echo
'#endif' >> ${.TARGET
}
56 echo
'#endif' >> ${.TARGET
}
57 #.if exists(${GCCDIR}/gcc/config/${GCC_CPU}/${GCC_CPU}-modes.def)
58 # echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
60 echo
'#endif /* GCC_TM_H */' >> ${.TARGET
}
63 echo
'#include "${GCC_CPU}/${GCC_CPU}-protos.h"' >> ${.TARGET
}
64 echo
'#include "tm-preds.h"' >> ${.TARGET
}
66 optionlist
: ${optionsfiles} Makefile
67 /usr
/bin
/awk
-f
${GCCDIR}/gcc
/opt-gather.awk
${optionsfiles} > optionlist
70 /usr
/bin
/awk
-f
${GCCDIR}/gcc
/opt-functions.awk
-f
${GCCDIR}/gcc
/optc-gen.awk \
71 -v header_name
="config.h system.h coretypes.h tm.h" < optionlist
> options.c
74 /usr
/bin
/awk
-f
${GCCDIR}/gcc
/opt-functions.awk
-f
${GCCDIR}/gcc
/opth-gen.awk \
75 < optionlist
> options.h
77 CLEANFILES
+= version.c configargs.h bconfig.h tm.h tm_p.h
78 CLEANFILES
+= options.c options.h optionlist
80 .
include <bsd.prog.mk
>
83 depend
: version.c configargs.h bconfig.h tm.h tm_p.h options.h options.c
85 # we don't use SRCS, so we can't use the normal bsd.dep.mk code
86 .for _PSRC in
${PATCHES
:M
*.patch
}
87 .for _PC in
${_PSRC
:T
:S
/.patch
$//:S|
,|
/|g
}
89 ${_PC}: ${CONTRIBDIR}/${_PC} ${_PSRC}
91 patch
-o
${.TARGET
} -i
${.ALLSRC
:M
*.patch
} ${CONTRIBDIR}/${.TARGET
}
93 CLEANFILES
:= ${CLEANFILES} ${_PC}