# Generated automatically from Makefile.in by configure.
#
# Makefile for the 'progs' subdirectory in the btparse distribution;
# builds the example/utility programs bibparse, biblex, and dumpnames.
#
# $Id: Makefile.in,v 1.1.1.1 2002/09/24 04:26:50 henkel Exp $
#

include ../Makefile.defs	# for CC, CFLAGS, etc.

# We put ../pccts in the include list because biblex is evil, naughty,
# and badly-behaved -- it evades the library and goes poking right
# into the guts of the lexical scanner in order to ferret out the
# token stream.  Thus, it needs access to the PCCTS header files in
# order to compile.
LIBDIR = ..
CPPFLAGS = -I$(LIBDIR) -I$(LIBDIR)/pccts -I$(LIBDIR)/src

LIBDIRS = -L$(LIBDIR) $(OTHERLIBDIRS)
LIBS    = -lbtparse $(OTHERLIBS)
LDFLAGS = $(LIBDIRS) $(LIBS)

BPSRC   = bibparse.c args.c 
BPOBJ   = $(BPSRC:.c=.o)

BXSRC	= bib2xml.c args.c 
BXOBJ	= $(BXSRC:.c=.o)

BLSRC   = biblex.c
BLOBJ   = $(BLSRC:.c=.o)

DNSRC   = dumpnames.c
DNOBJ   = $(DNSRC:.c=.o)

all : bibparse bib2xml biblex dumpnames

bibparse : $(BPOBJ) lib
	$(CC) -o $@ $(CFLAGS) $(BPOBJ) $(LDFLAGS)

bib2xml : $(BXOBJ) lib
	$(CC) -o $@ $(CFLAGS) $(BXOBJ) $(LDFLAGS)

biblex : $(BLOBJ) lib
	$(CC) -o $@ $(CFLAGS) $(BLOBJ) $(LDFLAGS)

dumpnames : $(DNOBJ) lib
	$(CC) -o $@ $(CFLAGS) $(DNOBJ) $(LDFLAGS)

lib:
	cd $(LIBDIR) ; make lib

clean:
	rm -f $(BPOBJ) $(BLOBJ) $(DNOBJ) $(BXOBJ) core logfile

scrub: clean
	rm -f bibparse biblex dumpnames bib2xml
	cat < /dev/null > .depend

dep .depend:
	$(CC) $(CFLAGS) -M $(BPSRC) $(BLSRC) $(BXSRC) > .depend

include .depend
