# This is the Makefile for the lib subdirectory of Taylor UUCP
#
# The file Makefile.in should be processed by configure to generate
# Makefile.  If you want to generate Makefile by hand, you must find
# all variables surrounded by @ and replace them with the correct
# value (e.g. @CC@ must be replaced by something like cc or gcc).

SHELL=/bin/sh

# These are overridden by the call from the top level Makefile
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
AR = @AR@
RANLIB = @RANLIB@

srcdir = @srcdir@
VPATH = @srcdir@

MORECFLAGS = -I.. -I$(srcdir)/..

OBJS = buffer.o crc.o debug.o escape.o getopt.o getop1.o parse.o spool.o \
	status.o xfree.o xmall.o xreall.o \
	@LIBOBJS@

all: libuucp.a

clean:
	rm -f $(OBJS) libuucp.a

distclean: clean
	rm -f Makefile

mostlyclean: clean
maintainer-clean realclean: distclean

libuucp.a: $(OBJS)
	rm -f libuucp.a
	$(AR) rc libuucp.a $(OBJS)
	-$(RANLIB) libuucp.a

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

dist:
	mkdir ../uucp-$(VERSION)/lib
	ln `cat $(srcdir)/MANIFEST | sed -e 's|^|$(srcdir)/|'` ../uucp-$(VERSION)/lib

Makefile: Makefile.in
	cd .. && CONFIG_FILES=lib/Makefile CONFIG_HEADERS= $(SHELL) ./config.status

# Header file dependencies.

$(OBJS): $(srcdir)/../uucp.h ../config.h $(srcdir)/../policy.h

buffer.o: $(srcdir)/../uudefs.h
crc.o: $(srcdir)/../prot.h
debug.o: $(srcdir)/../uudefs.h
escape.o: $(srcdir)/../uudefs.h
getopt.o: $(srcdir)/../getopt.h $(srcdir)/../uudefs.h
getop1.o: $(srcdir)/../getopt.h
parse.o: $(srcdir)/../uudefs.h
spool.o: $(srcdir)/../uudefs.h
status.o: $(srcdir)/../uudefs.h
xfree.o: $(srcdir)/../uudefs.h
xmall.o: $(srcdir)/../uudefs.h
xreall.o: $(srcdir)/../uudefs.h

.PHONY: all clean distclean mostlyclean maintainer-clean realclean dist
