#
#	SCCSID	@(#)Makefile	1.1 87/12/16
#

DEBUG		= -DEBUG=2
CFLAGS		= -O
CONFIG		=
DFLAGS		= $(DEBUG) $(CONFIG)

LINT		= lint
GET		= sccs get
RM		= /bin/rm -f

BIN		= Bin
DIRLIB		= Dirlib
INC		= Include
LIB		= Lib
LIBC		= Libc
ROUTE		= Route
STATE		= State
HEADER		= Header

BINARIES	= test-crc test-sprf

SLIBS		= $(SYSLIBS) -lc ../$(BIN)/$(LIBC).a

CFILES		= test-crc.c test-cprf.c
OBJECTS		= test-crc.o test-cprf.o

LFLAGS		= $(INCLUDE) $(DFLAGS)

NAME		= Admin
PRSPOOLER	= apr -i
PRSPOOL		= $(PRSPOOLER)$(NAME)
PRFORMATTER	= pr -l66 -w132 -f -n3

.DEFAULT:
		$(GET) SCCS/s.$<

.c.o:
		$(CC) $(CFLAGS) $(INCLUDE) $(DFLAGS) -c $<

.c.t:
		$(LINT) $(LFLAGS) $< \
		../$(LIB)/llib-$(LIB).ln \
		>$*.t 2>&1

.c.x:
		-cyntax $(LFLAGS) $< >$*.x 2>&1

.SUFFIXES:	.x .t .c

all:		$(BINARIES)

test-crc:	test-crc.o ../$(BIN)/$(LIB).a
		$(CC) $(LDFLAGS) -o test-crc test-crc.o ../$(BIN)/$(LIB).a $(SLIBS)

test-sprf:	test-sprf.o ../$(BIN)/$(LIB).a
		$(CC) $(LDFLAGS) -o test-sprf test-sprf.o ../$(BIN)/$(LIB).a $(SLIBS)

$(OBJECTS):	$(FRC)

print:		Makefile $(HEADERS) $(CFILES)
		$(PRFORMATTER) Makefile $(HEADERS) $(CFILES) | $(PRSPOOL)

clean:
		$(RM) $(OBJECTS) *.[tx]

clobber:	clean

llib:

lint:		test-crc.t test-sprf.t

test-crc.lint:	test-crc.t
		more test-crc.t

test-sprf.lint:	test-sprf.t
		more test-sprf.t

cyntax:		changestate.x linkstats.x purge.x request.x rundaemon.x state.x stats.x

test-crc.cyntax:	test-crc.x
		more test-crc.x

test-sprf.cyntax:	test-sprf.x
		more test-sprf.x

test:		all
		test-sprf
		test-crc

FRC:
