aboutsummaryrefslogtreecommitdiff
path: root/samples/Makefile
blob: 49bb11ba641fe3bcdf29c6107415d92c9d104f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SHELL = bash
CMP   = lualatex-dev
PWD   = $(shell pwd)

exts := .tex .pdf -tei.xml
texsamples := $(basename $(wildcard $(PWD)/*.tex))
findopts := $(foreach ext,$(exts),-or -iname "*$(ext)")

define dosamples
	$(CMP) --shell-escape $1 >/dev/null
	$(CMP) --shell-escape $1 >/dev/null
	$(CMP) --shell-escape $1 >/dev/null
	$(CMP) --shell-escape $1 >/dev/null
endef

all:
	cp ../ekdosis.{lua,sty} .
	$(foreach file,$(texsamples), $(call dosamples, $(file)))
	rm -rf auto
	find -iname "*~" -or -iname "*_out*.tex" | xargs rm -rf
	find ./* -type f -iname "Makefile" $(findopts) > ls-R
	rsync -aPr --files-from=ls-R . .backup
	rm -rf *
	cp -p -r .backup/* .
	rm -rf .backup

.PHONY: all