# title	   makefile for scripts

depth = ..

SEXECUTABLES = \
 striproff \
 yodl2dvi \
 yodl2less \
 yodl2manless \
 yodl2msless \
 yodl2man-post \
 yodl2ms-post \
 yodl2msps \
 yodl2txt-post \
 yodl2whatever \
 yodl2texinfo-post \


SCRIPTS = yodl2html yodl2latex yodl2man yodl2ms yodl2sgml yodl2tex yodl2texinfo yodl2txt

STEPMAKE_TEMPLATES=script executable

include $(depth)/make/stepmake.make 


$(outdir)/%.sh: yodl2less.sh
	cp $< $@

$(outdir)/yodl2manless: $(outdir)/yodl2less
	cat $< | sed 's!@YODL2LESS_DIR@!man!g' | sed 's!@INEXT@!man!g' > $@
	chmod 755 $@

$(outdir)/yodl2msless: $(outdir)/yodl2less
	cat $< | sed 's!@YODL2LESS_DIR@!man!g' | sed 's!@INEXT@!ms!g' > $@
	chmod 755 $@

$(outdir)/yodl2ms-post: $(outdir)/yodl2man-post
	cp $< $@

default: $(addprefix $(outdir)/, $(SEXECUTABLES)) check-script-links

check-script-links:
	-for i in $(SCRIPTS); do ln -s yodl2whatever $(outdir)/$$i; done

localinstall:
	(cd $(bindir); for i in $(SCRIPTS); do \
	    rm -f $$i; \
	    ln -s yodl2whatever $$i; \
	done)

localuninstall:
	for i in $(SCRIPTS); do rm -f $(bindir)/$$i; done
