VERSION=1.3.1
include Makefile.sets
#LDFLAGS=-liconv - not needed apparently

# Note: If you get linkage errors from basic_string this and that,
#       try this kind of command to force using an older g++ version.
#CXX=/usr/gcc3/bin/i586-pc-linux-gnu-g++

CPPFLAGS := $(CPPFLAGS) -Iargh

ARCHDIR=archives/
ARCHNAME=htmlrecode-$(VERSION)

ARCHFILES=Makefile.sets COPYING progdesc.php configure \
          htmlparser1.cc htmlparser2.cc \
          htmlrecode.cc htmlrecode.hh autoptr entities.h \
          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

BINDIR=/usr/local/bin
INSTALL=install
INSTALLPROGS=htmlrecode
DEPFUN_INSTALL=sdirs
SUBDIRS=argh

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


all: subdirs htmlrecode

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


htmlrecode: htmlrecode.o
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(ARGHLINK)

include depfun.mak


install: installsdirs
	make -C argh install
uninstall: uninstallsdirs
	make -C argh uninstall



clean:
	rm -f htmlrecode htmlrecode.o
distclean: clean
	rm -f *~ preview.c
realclean: distclean



FORCE: ;
.PHONY: all FORCE \
        clean distclean realclean \
        subdirs $(SUBDIRS) \
        install uninstall
