# GNU Makefile
# 01/15/98 C. Ludescher
# 08/25/98 CAL add texi
#
# Check for new $(CODESYSDIR)/source/doc/*.hlp
# Convert to .html
#
# Must be run from ...help directory for perl to work
# Also: old files must be deleted; otherwise perl script will append.
#
SRC = $(TRANSPROOT)/codesys/source/doc
f_new = transp.hlp pspline.hlp nubeam.hlp trread.hlp trxplib.hlp \
trgraf.hlp ufiles.hlp uread.hlp sg.hlp xplasma.hlp tek2ps.hlp \
xplot.hlp xtc.hlp port_strategy.hlp supralu.hlp \
trbugs.hlp trnews.hlp common_errors.hlp trdatbuf_lib.hlp
files =
tfiles = ufiles.texi
new_Up = $(shell date --date= +"%D" )
help: help0 help1 tex help_new ../transp/index.html
help0:
@echo hlp Files: $(files)
@echo texi Files: $(tfiles)
@echo TRANSPROOT: $(TRANSPROOT)
# Note: $* = target stem; $@ = current target
# $< is the source
# 12/10/98 replaced "cp $< ." with sed
# 02/11/03 convert http to URL
help1: $(foreach file,$(files),$(file))
%.hlp: $(SRC)/%.hlp
-rm $@ $*_hlp.html body_$*_hlp.html
@sed -e"s/\</g" -e "s/>/\>/g" $< > $@.foo1
@sed -e's#http://\([^ ]* \|[^ ]*$$\)# http://\1 #g' $@.foo1 > $@
$(TRANSPROOT)/bin/hlptohtml.perl $@
rm $@ $@.foo*
touch $@
help_new: $(foreach file,$(f_new),$(file))
%.hlp: $(SRC)/%.hlp
-rm $@ $*_hlp.html body_$*_hlp.html
echo new
@sed -e"s/\</g" -e "s/>/\>/g" $< > $@.foo1
@sed -e's#http://\([^ ]* \|[^ ]*$$\)# http://\1 #g' $@.foo1 > $@
$(TRANSPROOT)/bin/hlptohtml.perl $@
@sed -e's/html"/html" Target="main"/' $*_hlp.html > $*_hlp.htm
rm $@ $@.foo*
touch $@
tex: $(foreach file,$(tfiles),$(file))
%.texi: $(SRC)/%.texi
-rm $*_manual.html
cp $< $*_manual.texi
texi2html $*_manual.texi
rm $*_manual.texi
touch $@
../transp/index.html: trbugs_hlp.html
sed -e "s# Updated: .* # Updated: ${new_Up} #" $@ > foo
mv foo $@