1# If we defined SRCS, the mkdep fails because it evaluates files with .c
2# extension with cc instead of c++ (go figure).  To avoid that, we need
3# to define OBJS directly
4
5GCC_LANG_DIR=	gcc/cp
6TOP_PREFIX=	../../
7
8.include "../../../Makefile.inc"
9.include "../../../Makefile.langs"
10
11PROG_CXX=	cc1plus
12NOMAN=		yes
13NOSHARED?=	yes
14
15CXX_OBJS=	cp/cp-lang.o cp/stub-objc.o
16CXXXX_OBJS=	${CXX_OBJS:T}
17OBJS=		${CXXXX_OBJS} cc1plus-checksum.o
18SRCS=
19
20GUTS=		../../guts/guts-cxx/libguts-cxx.a \
21		../../guts/guts-common/libguts-common.a \
22		../../guts/guts-target/libguts-target.a
23BACKEND=	${LIBBACKEND} ${LIBCOMMONTARG} ${LIBCOMMON} \
24		${LIBCPP} ${LIBDECNUMBER}
25LIBS=		${LIBCOMMON} ${LIBCPP} ${LIBBACKTRACE} ${LIBIBERTY} \
26		${LIBDECNUMBER}
27LDADD=		${GUTS} ${BACKEND} ${LIBS} ${BACKENDLIBS}
28DPADD=		${GUTS} ${BACKEND} ${LIBS} ${BACKENDLIBS}
29
30checksum-options:
31	echo "${LD} ${LDFLAGS}" > ${.TARGET}
32
33cc1plus-checksum.c: ${CXXXX_OBJS} ${GUTS} ${BACKEND} checksum-options
34	${TOOLDIR}/genchecksum.nx ${CXXXX_OBJS} ${GUTS} ${BACKEND} \
35	    checksum-options > ${.TARGET}
36
37# hack to force c++ compiler to compile *.c files to create library
38.for ofile in ${OBJS}
39${ofile}: ${ofile:.o=.c}
40	${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
41.endfor
42
43CLEANFILES=	cc1plus-checksum.* checksum-options
44
45.include <bsd.prog.mk>
46