#
# makefile - htp
#
# HTML pre-processor
# Copyright (c) 2002 Jochen Hoenicke
#

TOP=../..
SUBDIRS = pic


#
# object files used
#

HTP_DEF = htp.def macros.def toc.def htp.htt
HTP_SRC = alttext.htp block.htp blockdef.htp bugs.htp comment.htp \
  def.htp default.htp expand.htp file.htp history.htp \
  if.htp img.htp imageurl.htp inc.htp index.htp intro.htp macros.htp \
  metatag.htp opt.htp options.htp output.htp quote.htp set.htp template.htp \
  undef.htp unset.htp usage.htp use.htp while.htp wishlist.htp \
  tutorial.htp include.htp license.htp

MISC = hlhtp.pl pphtp.pl styles.css

HTML = $(HTP_SRC:%.htp=%.html)

DISTFILES = Makefile $(HTP_SRC) $(HTP_DEF) $(MISC)

include $(TOP)/Makefile.config

export CGIBIN

all: run-htp-tut

run-htp $(HTML): tut

run-htp-tut: run-htp
	@cd tut; \
	for i in tut1 tut2 tut3 jh; do echo $$i.htp $$i.html; done > htp.rsp
	$(HTP) -quiet @tut/

tut:
	mkdir tut

install-doc: run-htp-tut
	mkdir -p $(pkgdocdir)
	for i in $(HTML) $(HTP_SRC) $(HTP_DEF) $(MISC); do \
	$(INSTALL) $$i $(pkgdocdir); done
	mkdir -p $(pkgdocdir)/tut
	for i in tut/*; do \
	$(INSTALL) $$i $(pkgdocdir)/tut; done

do-clean:
	rm -f *~ htp.rsp *.html
	rm -rf tut

do-rsync: run-htp-tut
	chmod a+r $(HTML) $(HTP_SRC) $(HTP_DEF) $(MISC)
	chmod a+rx tut
	chmod a+r tut/*
	$(RSYNC) $(HTML) $(HTP_SRC) $(HTP_DEF) $(MISC) $(RSYNCDIR)/ref/
	$(RSYNC) tut/* $(RSYNCDIR)/ref/tut/
	$(RSYNC) hlhtp.pl $(RSYNCCGI)
