GROFF = groff
GS = gs
OUTPUT = work.ps work.pdf
PICS = 
all: work.ps work.pdf
work.ps: test.roff $(PICS)
	iconv -f utf8 -t koi8-r $< | preconv -e KOI8-R | \
		 pic | eqn | tbl | $(GROFF) -Tps -dpaper=a4 -mru -ms > $@
work.pdf: work.ps
	ps2pdf -dCompatibilityLevel=1.2 -dPDFSETTINGS=/printer \
		-dUseCIEColor=true -dEmbedAllFonts=true $< $@

clean:
	-rm *~ $(OUTPUT) $(PICS)

