SHELL=	     /bin/sh
CC=	     @CC@
INSTALL=     @INSTALL@
prefix=      @prefix@
exec_prefix= @exec_prefix@
libdir=      @libdir@

COMPILE_ET= compile_et

DEFS=	@DEFS@
CFLAGS= -O
all:	libusp.a

SRCS=	block.c get.c internal.c main.c put.c usp_et.et
INCLUDES=  -I../include

libusp.a: usp_et.o main.o block.o get.o put.o internal.o
	ar r libusp.a main.o block.o get.o put.o internal.o usp_et.o
	@RANLIB@ libusp.a

install: all
	$(INSTALL) -m 644 libusp.a $(libdir)

clean:
	rm -f *.o libusp.a *~ core

distclean: clean
	rm -f Makefile usp_et.c

.c.o:
	${CC} ${CFLAGS} ${INCLUDES} ${DEFS} -c $*.c

.SUFFIXES:	.h

usp_et.o : usp_et.c

usp_et.c: ../ets/usp_et.et
	$(COMPILE_ET) ../ets/usp_et.et; rm usp_et.h

.et.h:
	rm -f $*.o $*.h
	$(COMPILE_ET) $*.et
