summaryrefslogtreecommitdiffstats
path: root/doc/report/makefile
blob: d88b1bb67201a64b796dec3076383922562c2472 (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
# documents 
BUILD_DIR := build
RES_DIR := res

SOURCES := z80uPC.tex z80uPC_nostyle.tex notes.tex
DOCUMENTS := $(patsubst %.tex,$(BUILD_DIR)/%.pdf,$(SOURCES))

RES_SRC := $(wildcard $(RES_DIR)/*.svg)
RES := $(patsubst %.svg,%.pdf,$(RES_SRC))

# compiler settings
TEX := texfot lualatex

# recipes
.PHONY: all dir clean
all: $(DOCUMENTS)

$(DOCUMENTS): $(BUILD_DIR)/%.pdf: %.tex $(SOURCES) $(RES) dir
	@printf "\nBuilding $< \n\n"
	$(TEX) --output-directory=$(BUILD_DIR) $<

$(RES): $(RES_DIR)/%.pdf: $(RES_DIR)/%.svg $(RES_SRC) dir
	inkscape -z -D --file=$< --export-pdf=$@

dir:
	mkdir -p $(BUILD_DIR)

clean:
	rm $(BUILD_DIR)/*