#	BSDI Makefile,v 2.3 1995/12/18 21:10:10 donn Exp

# pared-down GCC2 library.
.include "../Makefile.symlinks"

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

NEED=	__gcc_bcmp __main _bb _ctors _eh _new_handler \
	_op_delete _op_new _op_vdel _op_vnew _pure

.if	${MACHINE} == "hp300"
NEED+=	_clear_cache
.elif	${MACHINE} == "i386"
NEED+=	_clear_cache
.elif	${MACHINE} == "powerpc"
NEED+=	_clear_cache
.elif	${MACHINE} == "sparc"
NEED+=	_clear_cache
.elif	${MACHINE} == "tahoe"
NEED+=	_clear_cache _shtab
.endif

LIB=	gcc
SRCS=	${NEED:S/$/.c/g}
CFLAGS+=-I. -I${.CURDIR} -I${CFG} -I${.CURDIR}/../common

${SRCS}: libgcc2.c tconfig.h
	${CC} ${CFLAGS} -E -DL${.TARGET:R} ${.ALLSRC:M*.c} > ${.TARGET}

all .depend: tm.h ${SRCS}

CLEANFILES+=${SRCS} tconfig.h tm.h

.include <bsd.lib.mk>
