mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
34 lines
1,014 B
Makefile
34 lines
1,014 B
Makefile
SOURCES = $(wildcard *.tex)
|
|
PDF_VIEWER ?= $(firstword $(shell which okular acroread))
|
|
PNG_VIEWER ?= $(firstword $(shell which qiv gimp))
|
|
MAIN_TEX ?= $(firstword $(wildcard main.tex *.tex))
|
|
MAIN ?= $(patsubst %.tex,$(MAIN_TEX))
|
|
OUT_PDF ?= $(notdir $(shell $(PWD))).pdf
|
|
OUT_PNG ?= $(patsubst %.pdf,%.png,$(OUT_PDF))
|
|
PNG_WIDTH ?= 200
|
|
|
|
all: pdf
|
|
clean: clean.files
|
|
install:
|
|
distclean:
|
|
|
|
pdf: $(OUT_PDF)
|
|
png: $(OUT_PNG)
|
|
|
|
view: $(OUT_PDF)
|
|
$(PDF_VIEWER) $<
|
|
|
|
view-png: $(OUT_PNG)
|
|
$(PNG_VIEWER) $<
|
|
|
|
$(OUT_PDF): $(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 $@
|
|
|
|
$(OUT_PNG): $(OUT_PDF)
|
|
convert -density 400 -scale x$(PNG_WIDTH) $< $@
|
|
|
|
clean.files:
|
|
$(RM) -rf *.done *.aux *.log *.pdf *.nav *.out *.snm *.toc .*.swp $(OUT_PNG) *.vrb
|