# Generic lib Makefile

# RCSid:
#	$Id: Makefile,v 1.15 1997/03/11 20:42:20 sjg Exp $
#
#	@(#) Copyright (c) 1994 Simon J. Gerraty
#
#	This file is provided in the hope that it will
#	be of use.  There is absolutely NO WARRANTY.
#	Permission to copy, redistribute or otherwise
#	use this file is hereby granted provided that 
#	the above copyright notice and this notice are
#	left intact. 
#      
#	Please send copies of changes and bug-fixes to:
#	sjg@quick.com.au
#

LIB=	${.CURDIR:T}

# for transition to official port of 614
CFLAGS+= -DALT_SSHELL_PORT=414

#SRCS=	${.CURDIR}/*.c

.if exists(${.CURDIR}/.srcs)
.include "${.CURDIR}/.srcs"
.else
all: .srcs
.endif


NOMAN=no
NOPROFILE=no
NOPIC=no

.include "lib.mk"

.if exists(${.CURDIR}/.cfg)
.include "${.CURDIR}/.cfg"
.endif

.PRECIOUS: .srcs

.ifnmake .srcs
_x=false
.endif

.srcs:
	@echo "SRCS= \\" > ${.CURDIR}/.srcs
	@cd ${.CURDIR} && /bin/ls -1 *.c | paste -s -d"     \n" - | sed -e 's/^/	/' -e 's/$$/ \\/' >> ${.CURDIR}/.srcs
	@echo >> ${.CURDIR}/.srcs
	@echo Updated .srcs now re-run ${MAKE}; ${_x}

# for testing
LDADD+= -L${.CURDIR}/${.OBJDIR:T} -l${LIB}

.SUFFIXES:	.test

.c.test:
	${CC} ${CFLAGS} ${LDSTATIC} -DMAIN -o ${.TARGET} ${.IMPSRC} ${LDADD}

