jw-pkg/make/textest.mk
2016-04-19 16:23:30 +00:00

25 lines
617 B
Makefile

SOURCES = $(wildcard *.tex)
PDF_VIEWER ?= okular
MAIN ?= $(patsubst %.tex,%,$(firstword $(wildcard main.tex *.tex)))
MAIN_TEX = $(MAIN).tex
OUT_PDF = $(MAIN).pdf
all: build.done
clean: clean.files
install:
distclean:
pdf: build.done
view: build.done
$(PDF_VIEWER) $(OUT_PDF)
build.done: $(SOURCES)
pdflatex $(MAIN_TEX)
test -e $(basename $(MAIN_TEX)).pdf
if [ "$(basename $(MAIN_TEX)).pdf" != "$(OUT_PDF)" ]; then mv $(basename $(MAIN_TEX)).pdf $(OUT_PDF); fi
touch $@
clean.files:
rm -rf *.done *.aux *.log *.pdf *.nav *.out *.snm *.toc