#!/bin/make -f
# @(#)pd/strlib/Makefile	1.6 9/6/92 04:39:51

# Makefile for the public domain string library for smail

SHELL=/bin/sh
MAKE=make
GET=sccs get
AR=ar
LINT=lint
CLEAN=sccs clean
MK=${MAKE} -${MAKEFLAGS} SHELL=${SHELL}
SRC_PREFIX=
MKDEPEND=${ROOT}/conf/lib/mkdepend.sh
MKDEFS=${ROOT}/conf/lib/mkdefs.sh
CHECKDEFS=${ROOT}/conf/lib/checkdefs.sh
MKDIRS=${ROOT}/conf/lib/mkdirs.sh
INST=${ROOT}/conf/lib/inst.sh
INSTM=${ROOT}/conf/lib/instm.sh
XEXEC=${SHELL} ${ROOT}/conf/lib/xexec.sh
DEFS_SH=defs.sh
DEFS_H=defs.h
DEFS_SED=defs.sed

ROOT=../..
OBJ=_str2set.o strpbrk.o strspn.o strcspn.o bcopy.o bzero.o bcmp.o
CSRC=_str2set.c strpbrk.c strspn.c strcspn.c bcopy.c bzero.c bcmp.c
HSRC=_str2set.h strings.h
MISCSRC=Makefile README
SRC=${CSRC} ${HSRC} ${MISCSRC}

.c.o:
	@. ./${DEFS_SH}; ${XEXEC} $$CC $$CFLAGS $$INCLUDES -c $*.c

all:	libstr.a

libstr.a: ${OBJ} Makefile
	${AR} cr libstr.a ${OBJ}
	@. ./${DEFS_SH}; \
	   ${XEXEC} $$RANLIB libstr.a

sources: ${SRC}

${SRC}:
	${GET} $@

${DEFS_H} ${DEFS_SH} ${DEFS_SED}:
	ROOT=${ROOT} ${SHELL} ${MKDEFS}

${OBJ}:	${DEFS_SH}

names:
	@for i in ${SRC}; do echo ${SRC_PREFIX}$$i; done

lint:	${CSRC}
	@. ./${DEFS_SH}; ${XEXEC} ${LINT} ${LINTFLAGS} ${CSRC}

depend local_depend: check_defs
	@. ./${DEFS_SH}; \
		${XEXEC} ${SHELL} ${MKDEPEND} $$CPPFLAGS $$INCLUDES \
		Makefile ${CSRC}
	. ./${DEFS_SH}; echo "$$DEFS_DEPEND" >> Makefile
	chmod -w Makefile

check_defs:
	SHELL=${SHELL} ROOT=${ROOT} ${SHELL} ${CHECKDEFS}

install:

clean:
	rm -f ${DEFS_SH} ${DEFS_H} ${DEFS_SED}
	rm -f .${DEFS_SH} .${DEFS_H} .${DEFS_SED} .Makefile
	rm -f a.out core ${OBJ}

clobber: clean
	rm -f libstr.a

nuke:	clobber
	-${CLEAN}
	-${GET} Makefile

# DO NOT REMOVE THIS LINE OR "make depend" WILL NOT WORK
