gcc50: Plug in WARNS framework for tools.
[dragonfly.git] / gnu / usr.bin / cc47 / cc_tools / tools / Makefile
blob9b8f709b19ec448c489e50438e068d6b8cc9c906
1 .include "../Makefile.inc"
2 .include "../../Makefile.langs"
4 NXCFLAGS+= -DGENERATOR_FILE -I${.OBJDIR}
5 NXLDLIBS+= -lm
7 MIC= sh ${GCCDIR}/move-if-change
9 BUILD_LIBS= ../libiberty/libiberty.na
10 BUILD_RTL= rtl.no \
11 read-rtl.no \
12 ggc-none.no \
13 vec.no \
14 min-insn-modes.no \
15 gensupport.no \
16 print-rtl.no
17 BUILD_MD= read-md.no
18 BUILD_ERRORS= errors.no
21 ${BUILD_RTL}: tm.h insn-modes.h gtype-desc.h insn-constants.h
23 genprogrtl = attr attr-common attrtab automata codes conditions config emit \
24 extract flags opinit output peep preds recog
25 genprogmd = $(genprogrtl) mddeps constants enums
26 genprogerr = $(genprogmd) genrtl modes gtype hooks
28 # All these programs use the RTL reader ($(BUILD_RTL)).
29 ${genprogrtl:S/^/gen/g:S/$/.no/g}: ${BUILD_RTL}
30 # All these programs use the MD reader
31 ${genprogmd:S/^/gen/g:S/$/.no/g}: ${BUILD_MD}
32 # All these programs need to report errors.
33 ${genprogerr:S/^/gen/g:S/$/.no/g}: ${BUILD_ERRORS}
35 .for f in ${genprogrtl}
36 gen${f}.nx: ${BUILD_RTL}
37 .endfor
39 .for f in ${genprogmd}
40 gen${f}.nx: ${BUILD_MD}
41 .endfor
43 .for f in ${genprogerr}
44 gen${f}.nx: ${BUILD_ERRORS}
45 GENTOOLS+= gen${f}.nx
46 .endfor
48 gengtype.nx: gengtype-lex.no gengtype-parse.no gengtype-state.no version.no
50 genattrtab.o ggc-none.no vec.no: gtype-desc.h
52 GENTOOLS+= gencheck.nx gencondmd.nx gcov-iov.nx genchecksum.nx
54 .for f in ${GENTOOLS}
55 $f: ${f:.nx=.no} ${BUILD_LIBS}
56 ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC:M*.n[oa]} ${NXLDLIBS} -o ${.TARGET}
57 .endfor
59 gencheck.no: tm.h insn-constants.h
60 gencondmd.no: tree-check.h insn-constants.h
62 CLEANFILES+= ${GENTOOLS} ${GENTOOLS:.nx=.no}
63 CLEANFILES+= gengtype-lex.c gengtype-lex.no gengtype-parse.no
64 CLEANFILES+= gengtype-state.no version.no
65 CLEANFILES+= ${BUILD_RTL} ${BUILD_MD} ${BUILD_ERRORS}
68 MD_DEPS= ${md_file}
70 _MIC: .USE
71 ${MIC} ${.TARGET}.tmp ${.TARGET}
72 _PL: .USE
73 ${.OBJDIR}/${.ALLSRC:M*.nx} > ${.TARGET}.tmp
74 ${MIC} ${.TARGET}.tmp ${.TARGET}
75 _MD: .USE
76 ${.OBJDIR}/${.ALLSRC:M*.nx} ${md_file} > ${.TARGET}.tmp
77 ${MIC} ${.TARGET}.tmp ${.TARGET}
79 simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h \
80 insn-attr-common.h
82 simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \
83 insn-extract.c insn-opinit.c insn-output.c \
84 insn-peep.c insn-recog.c
86 .for f in ${simple_generated_h} ${simple_generated_c}
87 .for p in gen${f:R:S/^insn-//}.nx
88 $f: $p ${MD_DEPS} insn-conditions.md _MIC
89 ${.OBJDIR}/$p ${md_file} insn-conditions.md > ${.TARGET}.tmp
90 .endfor
91 .endfor
93 insn-constants.h: genconstants.nx ${MD_DEPS} _MD
94 tree-check.h: gencheck.nx _PL
95 gencondmd.c: genconditions.nx ${MD_DEPS} tm-preds.h tm-constrs.h _MD
96 insn-conditions.md: gencondmd.nx _PL
97 genrtl.c: gengenrtl.nx _PL
98 genrtl.h: gengenrtl.nx _MIC
99 ${.OBJDIR}/${.ALLSRC:M*.nx} -h > ${.TARGET}.tmp
100 insn-modes.c: genmodes.nx _PL
101 insn-modes.h: genmodes.nx _MIC
102 ${.OBJDIR}/${.ALLSRC:M*.nx} -h > ${.TARGET}.tmp
103 min-insn-modes.c: genmodes.nx _MIC
104 ${.OBJDIR}/${.ALLSRC:M*.nx} -m > ${.TARGET}.tmp
105 insn-preds.c: genpreds.nx _MD
106 insn-enums.c: genenums.nx _MD
107 tm-preds.h: genpreds.nx _MIC
108 ${.OBJDIR}/${.ALLSRC:M*.nx} -h ${md_file} > ${.TARGET}.tmp
109 tm-constrs.h: genpreds.nx _MIC
110 ${.OBJDIR}/${.ALLSRC:M*.nx} -c ${md_file} > ${.TARGET}.tmp
111 gtype.state: gengtype.nx gtyp-input.list ${GTFILES:N[*]} _MIC
112 ${.OBJDIR}/${.ALLSRC:M*.nx} -S ${GCCDIR}/gcc -I ${.ALLSRC:M*.list} \
113 -w gtype.state.tmp
114 gtype-desc.c gtype-desc.h: gengtype.nx gtype.state
115 ${.OBJDIR}/${.ALLSRC:M*.nx} -r gtype.state
116 gcov-iov.h: gcov-iov.nx BASE-VER _MIC
117 ${.OBJDIR}/${.ALLSRC:M*.nx} "$$(cat ${.ALLSRC:M*BASE-VER})" "" > ${.TARGET}.tmp
118 target-hooks-def.h: genhooks.nx _MIC
119 ${.OBJDIR}/${.ALLSRC:M*.nx} "Target Hook" > ${.TARGET}.tmp
120 c-family/c-target-hooks-def.h: genhooks.nx _MIC
121 ${.OBJDIR}/${.ALLSRC:M*.nx} "C Target Hook" > ${.TARGET}.tmp
122 common/common-target-hooks-def.h: genhooks.nx _MIC
123 ${.OBJDIR}/${.ALLSRC:M*.nx} "Common Target Hook" > ${.TARGET}.tmp
125 gtyp-input.list: _MIC
126 rm -f ${.TARGET}.tmp
127 for f in ${GTFILES}; do \
128 echo "$$f" >> ${.TARGET}.tmp; \
129 done
131 GENFILES= \
132 ${simple_generated_h} ${simple_generated_c} \
133 insn-constants.h tree-check.h gencondmd.c insn-conditions.md \
134 genrtl.c genrtl.h insn-modes.c insn-modes.h min-insn-modes.c \
135 insn-preds.c tm-preds.h tm-constrs.h gtype-desc.c gtype-desc.h \
136 gcov-iov.h insn-enums.c target-hooks-def.h \
137 c-family/c-target-hooks-def.h \
138 common/common-target-hooks-def.h
140 CLEANFILES+= ${GENFILES} gtyp-input.list gtype.state
141 CLEANFILES+= gt-* gtype-*.h
142 CLEANDIRS+= common c-family
144 dossier:
145 mkdir -p common c-family
147 genfiles: ${GENTOOLS} ${GENFILES}
148 depend all: dossier genfiles
150 .include <bsd.obj.mk>
151 .include <bsd.dep.mk>
152 .include <bsd.sys.mk>