#	BSDI Makefile,v 1.1 1995/12/18 21:08:16 donn Exp

# crt*.o additions for ELF g++

.include "../Makefile.symlinks"

# The functions we want.  These are extracted from crtstuff.c individually,
# and the code is left in a separate file.  It would be nice to have all
# of crtstuff.c split into separate files already, but...

NEED=	crtbegin crtend

SRCS=	${NEED:S/$/.c/g} values-Xa.c values-Xc.c values-Xt.c
CFLAGS+=-I. -I${.CURDIR} -I${CFG} -I${.CURDIR}/../libgcc2 -I${.CURDIR}/../common

crtbegin.c crtend.c: crtstuff.c tm.h
	${CC} ${CFLAGS} -E -DL${.TARGET:R} ${.ALLSRC:M*.c} > ${.TARGET}
values-Xa.c values-Xc.c:
	echo 'const int _lib_version = 1;' > ${.TARGET}
values-Xt.c:
	echo 'const int _lib_version = 0;' > ${.TARGET}

OBJS=	crtbegin.o crtend.o values-Xa.o values-Xc.o values-Xt.o

.MAIN:	${OBJS}

depend: .depend

.depend: ${SRCS}
	${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}

install:
	install ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
	    ${DESTDIR}/usr/lib

CLEANFILES+=${SRCS} tm.h

.include <bsd.prog.mk>
