#  Makefile for the
#  MULTEXT-East (and MULTEXT) Morphosyntactic Specifications
#  Toma&#382; Erjavec <tomaz.erjavec@ijs.si>
#
#  2004-07-07
#

MASTER = msd
MULTEXT = msd-multext
EAGLES = msd-eagles

all: tex pdf html xml multext clean pack love

tex :
	latex ${MASTER}.tex
	bibtex ${MASTER}
	latex ${MASTER}.tex
	latex ${MASTER}.tex

pdf :
	dvipdf ${MASTER}
	dvips ${MASTER} -o
#	ps2pdf ${MASTER}.ps ${MASTER}.pdf
	psnup -2 ${MASTER}.ps ${MASTER}2up.ps
	ps2pdf ${MASTER}2up.ps ${MASTER}2up.pdf
	mv *.pdf ..

html :
	latex2html -html_version 3.2,latin2,unicode \
	-dir ../html -local_icons \
	-split 0 -toc_depth 3\
        -show_section_numbers \
	-up_title "Main MSD directory" -up_url ../ \
	-t "MULTEXT-East Morphosyntactic Specifications" \
	${MASTER}
	recode latin2..utf-8 <../html/index.html>0.tmp; mv 0.tmp ../html/index.html
	recode latin2..utf-8 <../html/msd.html>0.tmp; mv 0.tmp ../html/msd.html

xml :
	../bin/mtems2flib < ${MASTER}.tex > ../tei/${MASTER}-flib.xml
	../bin/lex2fslib
	rxp -Vs ../tei/msd-tei.xml
	xsltproc ../bin/pretty-print.xsl ../tei/msd-tei.xml > ../tei/msd.xml

multext :
	latex ${MULTEXT}.tex
	latex ${MULTEXT}.tex
	dvipdf ${MULTEXT}
	dvips ${MULTEXT} -o
	psnup -2 ${MULTEXT}.ps ${MULTEXT}2up.ps
	ps2pdf ${MULTEXT}2up.ps ${MULTEXT}2up.pdf
	mv *.pdf ../related
	latex2html -html_version 3.2 \
	-dir ../related/${MULTEXT} -local_icons \
	-split 3 -toc_depth 2 \
	-up_title "Main MSD directory" -up_url ../ \
	-t "MULTEXT Morphosyntactic Specifications" \
	${MULTEXT}

eagles :
	latex ${EAGLES}.tex
	latex ${EAGLES}.tex
	dvipdf ${EAGLES}
	dvips ${EAGLES} -o
	psnup -2 ${EAGLES}.ps ${EAGLES}2up.ps
	ps2pdf ${EAGLES}2up.ps ${EAGLES}2up.pdf
	mv *.pdf ../related
	latex2html -html_version 3.2 \
	-dir ../related/${EAGLES} -local_icons \
	-split 3 -toc_depth 2 \
	-up_title "Main MSD directory" -up_url ../ \
	-t "EAGLES Morphosyntactic Phenomena" \
	${EAGLES}

clean :
	\rm -f *.ps *.aux *.dvi *.log *.toc *.bbl *.blg
#	\rm -f auto/*
#	\rmdir auto

pack :
	cd ../..; \rm msd.zip; zip -r msd.zip msd
##	cd ../..; \rm msd.tgz; tar -cvf - msd | gzip > msd.tgz

love:
	@echo "...not war!"
