summaryrefslogtreecommitdiffstats
path: root/techwsw/makefile
blob: 240e9072602afbd9a7b434b16f2197a014061e94 (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
28
29
# file settings
BUILD_DIR 	:= build
DOCUMENT	:= essence_of_hwsw.tex

# tex settings
TEX := xelatex \
		-interaction=nonstopmode \
		-halt-on-error \
		-output-directory=$(BUILD_DIR)

# automated stuff
_DOCUMENT := $(BUILD_DIR)/$(DOCUMENT)

_SVGS := $(shell find res/ -type f -name '*.svg')
_PDFS := $(patsubst %.svg, %.pdf,$(_SVGS))


# recipes
.PHONY: build_dir
all: $(_DOCUMENT)

$(_DOCUMENT): $(DOCUMENT) $(_PDFS) build_dir
	$(TEX) $<

$(_PDFS): res/%.pdf: res/%.svg $(_SVGS)
	inkscape -z -D --file=$< --export-pdf=$@

build_dir:
	mkdir -p $(BUILD_DIR)/tex