Makefile 1.48 KB
Newer Older
Alija Sabic's avatar
Alija Sabic committed
1
2
3
4
5
6
7
8
include .utils
TEXENGINE   ?= xelatex
BASENAME     = project-overview
BUILDDIR     = build
BASEVARIANTS = presentation
# BASEVARIANTS = beamer,second,handout,trans,article
BASEARATIO  = 169
# BASEARATIO = 1610,169,149,141,54,43,32
9

Alija Sabic's avatar
Alija Sabic committed
10
11
12
# space separated list of requested variants
VARIANTSLIST = $(eval comma:=,) $(subst $(comma), ,$(VARIANTS))
ASPECTRATIOLIST = $(eval comma:=,) $(subst $(comma), ,$(ASPECTRATIO))
13
14

# Environment
Alija Sabic's avatar
Alija Sabic committed
15
16
17
18
TEXDIRS      = resources/latex:resources/latex-sty:resources/images:resources/listings
TEXDIRS     := $(TEXDIRS):resources/theme:resources/images
BIBDIRS      = resources/latex/
BSTDIR       = resources/latex-bst/
19
20

# cf. latexmkrc
Alija Sabic's avatar
Alija Sabic committed
21
22
LATEXMK      = latexmk $(OPTS) $2 $1.tex | fold -sw $(out_length)
VIEWER       = xdg-open
23

24
# main targets
Alija Sabic's avatar
Alija Sabic committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
all: build

build: setup
	$(call LATEXMK_SELECT, )

log: setup
	$(call LATEXMK_ERRS, $(TARGET))

view: setup
	$(call LATEXMK_SELECT, -pv)

open: setup
	$(call LATEXMK_OPEN)

preview: setup
	$(call LATEXMK_PREVIEW, -pvc)

clean: setup
	$(call LATEXMK_SELECT, -c)

distclean: setup
	$(call LATEXMK_SELECT, -C)

help:
	@echo $(INSTRUCTIONS)

51
52
53
%/:
	mkdir -p $@

54
55
setup: .FORCE | $(BUILDDIR)/

Alija Sabic's avatar
Alija Sabic committed
56
.PHONY: all build log view preview clean distclean .FORCE
57

58
.EXPORT_ALL_VARIABLES:
Alija Sabic's avatar
Alija Sabic committed
59
	export JOBNAME=$(JOBNAME)
60
61
62
63
64
TEXINPUTS := :.:$(TEXDIRS)
# bibtex invoked from BUILDDIR, thus prepend './../'
BSTINPUTS := ./../$(BSTDIR)
BIBINPUTS := :.:./../$(BIBDIRS)

65
66
67
# Disable implicit suffix and built-in rules (for performance and profit)
.SUFFIXES:
MAKEFLAGS += --no-builtin-rules