# -*- sh -*-

FILES = jedfuns libfuns quickref
SL_LIBDIR = ../../lib

TM_FILES =  $(addsuffix .tm,$(FILES))
SGML_FILES =  $(addsuffix .sgml,$(FILES))
HTML_FILES = $(addsuffix .html,$(FILES))
TXT_FILES = $(addsuffix .txt,$(FILES))
TEX_FILES = $(addsuffix .tex,$(FILES))

RM = /bin/rm
MV = /bin/mv
CP = /bin/cp

SGML2LATEX = sgml2latex
SGML2HTML = sgml2html
SGML2TXT = sgml2txt -f
TM2TXT = tm2txt #$(HOME)/src/slang/doc/tm/tools/$(ARCH)objs/tm2txt
SL2TM = sl2tm

text: jedfuns.txt libfuns.txt
all: $(HTML_FILES) $(TEX_FILES)
jedfuns.txt : jedfuns.tm
	cat rtl/*.tm | $(TM2TXT) > jedfuns.txt
libfuns.txt :
	$(SL2TM) -sl $(SL_LIBDIR)/*.sl | $(TM2TXT) > libfuns.txt
#
%.tex : %.sgml
	$(SGML2LATEX) $*.sgml
%.html : %.sgml
	$(SGML2HTML) $*.sgml
%.txt : %.sgml
	$(SGML2TXT) $*.sgml
%.sgml : %.tm
	jed -script tm2sgml.sl $*
clean:
	-rm -f *~ *.dvi *.log *.aux *.toc rtl/*.BAK rtl/*~ *.html *.txt

