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

TOP=../..

#
# object files used
#

HTP_DEF = htp.def
HTP_SRC = source.htp

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

DISTFILES = Makefile $(HTP_SRC) $(HTP_DEF) source.cgi.in

include $(TOP)/Makefile.config

export CGIBIN

all: run-htp source.cgi

source.cgi: source.cgi.in
	perl -pe 's#___REF_URL___#$(REF_URL)#g;s#___HTP_DIR___#$(HTP_DIR)#g' \
	 < $< > $@
	chmod a+x source.cgi

do-clean:
	rm -f *~ htp.rsp *.html source.cgi

do-rsync: run-htp source.cgi
	chmod a+r $(HTML) $(HTP_SRC) $(HTP_DEF)
	chmod a+rx source.cgi
	$(RSYNC) $(HTML) $(HTP_SRC) $(HTP_DEF) $(RSYNCDIR)/source/
	$(RSYNC) source.cgi $(RSYNCCGI)/
