# Makefile for UNIX. 

# Build these files
LIB	= libclient.a
TESTPROG= testclient

#Uncomment these to use the GNU Readline library (needed by gets.o)
# READLINEDEF=	-DUSE_READLINE
# READLINELIB=	-lreadline -termcap

CC	= gcc -W
CFLAGS	= -g
CPPFLAGS= -I$(INCDIR) $(READLINEDEF)
LD	= $(CC)
LIBES	= $(LIB) $(READLINELIB)
AR	= ar
RANLIB	= ranlib

LIBOBJ	= allocpacket.o backend.o func.o logger.o newrec.o octetstring.o \
	  smalloc.o sr_structcodec.o strdup.o strsafe.o structcodec.o
TESTOBJ	= testclient.o gets.o

INCDIR	= include


all: $(LIB) $(TESTPROG) ;
lib: $(LIB) ;
test: $(TESTPROG) ;

clean: force
	-rm -f *.[ao] $(TESTPROG) core *.log a.out *.bak *.BAK *~ \#*\#

$(TESTPROG): $(TESTOBJ)
	$(LD) $(CFLAGS) $(LDFLAGS) $(TESTOBJ) $(LIBES) -o $@

$(LIB): $(LIBOBJ)
	-@rm -f libtmp.a
	$(AR) cr libtmp.a $(LIBOBJ)
	$(RANLIB) libtmp.a && mv libtmp.a $@

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

force:

# DO NOT DELETE THIS LINE -- make depend depends on it.

allocpacket.o: client.h include/sr-general.h include/sr-logger.h
allocpacket.o: include/sr-oid.h include/high/client-structs.h
allocpacket.o: include/high/common-structs.h include/high/sr-api.h
allocpacket.o: include/high/sr-address.h include/high/sr_structcodec.h
allocpacket.o: include/high/structcodec.h include/high/sr_structproto.h
backend.o: client.h include/sr-general.h
backend.o: include/sr-logger.h include/sr-oid.h
backend.o: include/high/client-structs.h include/high/common-structs.h
backend.o: include/high/sr-api.h
backend.o: include/high/sr-address.h include/high/sr_structcodec.h
backend.o: include/high/structcodec.h include/high/sr_structproto.h
func.o: client.h include/sr-general.h include/sr-logger.h
func.o: include/sr-oid.h include/high/client-structs.h
func.o: include/high/common-structs.h include/high/sr-api.h
func.o: include/high/sr-address.h
func.o: include/high/sr_structcodec.h include/high/structcodec.h
func.o: include/high/sr_structproto.h
logger.o: include/sr-logger.h include/sr-general.h
logger.o: include/sr-oid.h
newrec.o: include/sr-util.h include/high/sr-api.h
newrec.o: include/sr-general.h
newrec.o: include/sr-logger.h include/sr-oid.h
newrec.o: include/high/sr-address.h
octetstring.o: include/sr-general.h include/sr-logger.h
octetstring.o: include/sr-oid.h
smalloc.o: include/sr-util.h include/high/sr-api.h
smalloc.o: include/sr-general.h
smalloc.o: include/sr-logger.h include/sr-oid.h
smalloc.o: include/high/sr-address.h
sr_structcodec.o: include/sr-general.h
sr_structcodec.o: include/sr-logger.h include/sr-oid.h
sr_structcodec.o: include/high/sr-api.h include/high/sr-address.h
sr_structcodec.o: include/high/eapi.h include/high/sr_structcodec.h
sr_structcodec.o: include/high/structcodec.h
structcodec.o: include/high/structcodec.h include/sr-general.h
structcodec.o: include/sr-logger.h
structcodec.o: include/sr-oid.h
structcodec.o: include/high/structproto.h
testclient.o: include/sr-util.h include/high/sr-api.h
testclient.o: include/sr-general.h include/sr-logger.h
testclient.o: include/sr-oid.h include/high/sr-address.h
testclient.o: include/high/client-structdesc.h
testclient.o: include/high/structcodec.h
testclient.o: include/high/common-structdesc.h
testclient.o: include/high/common-structs.h
testclient.o: include/high/client-structs.h
