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/lto
6TOP_PREFIX=	../../
7
8.include "../../../Makefile.inc"
9.include "../../../Makefile.langs"
10
11PROG_CXX=	lto1
12NOMAN=		yes
13
14# verbatim from gcc/lto/Make-lang.in
15LTO_OBJS=	lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o \
16		lto/lto-partition.o lto/lto-symtab.o
17OBJS=		${LTO_OBJS:T} main.o
18SRCS=
19
20BACKEND=	${LIBBACKEND} ${LIBCOMMONTARG} ${LIBCOMMON} \
21		${LIBCPP} ${LIBDECNUMBER}
22LIBS=		${LIBCOMMON} ${LIBCPP} ${LIBBACKTRACE} ${LIBIBERTY} \
23		${LIBDECNUMBER}
24LDADD=		${BACKEND} ${BACKENDLIBS} ${LIBS}
25DPADD=		${BACKEND} ${BACKENDLIBS} ${LIBS}
26
27
28# hack to force c++ compiler to compile *.c files to create library
29.for ofile in ${OBJS}
30${ofile}: ${ofile:.o=.c}
31	${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
32.endfor
33
34.include <bsd.prog.mk>
35