VERSION=2.2.0.1
DEFS=-DNEED_ARGH_H
include Makefile.sets

PROG=erec

BINDIR=/usr/local/bin
INSTALLPROGS=${PROG}

ARCHDIR=archives/
ARCHNAME=${PROG}-${VERSION}
ARCHFILES=erec.c cat.h \
          COPYING README Makefile.sets progdesc.php \
          argh/argh.cc argh/argh.hh argh/argh.h argh/argh-c.inc argh/docmaker.php \
          argh/Makefile argh/depfun.mak argh/Makefile.sets argh/progdesc.php \
          argh/COPYING argh/README.html

OBJS = erec.o
SUBDIRS=argh

# For DYNAMIC argh-linking, use:
ARGHLINK=-Largh -largh
# For STATIC argh-linking, use:
#ARGHLINK=argh/libargh.a

all: subdirs ${PROG}

subdirs: $(SUBDIRS)
$(SUBDIRS):
	@$(MAKE) -C $@

${PROG}: $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(ARGHLINK)

include depfun.mak

erec.o: Makefile

install: installbin
	make -C argh install
uninstall: uninstallbin
	make -C argh uninstall

thisclean: FORCE
	rm -f $(PROG) $(OBJS)
clean: thisclean
distclean: thisclean
	rm -f *~ core .depend

FORCE: ;
.PHONY: install installbin thisclean clean distclean FORCE subdirs $(SUBDIRS)
