43 lines
1.2 KiB
Makefile
43 lines
1.2 KiB
Makefile
export PATH:=/usr/local/texlive/2019/bin/x86_64-linux:$(PATH)
|
|
|
|
OUTPUT:=build
|
|
DOC:=$(wildcard *.tex)
|
|
DOCTYPE:=$(shell echo $(DOC) | cut -c1-3)
|
|
FIGURES:=$(wildcard figures/*)
|
|
PDF:=$(OUTPUT)/$(subst .tex,.pdf,$(DOC))
|
|
DEPS:=$(wildcard */*.tex)
|
|
DEPS+=$(wildcard */*/*.tex)
|
|
PDFLATEX_FLAGS:=--output-directory=$(OUTPUT) --shell-escape --file-line-error
|
|
|
|
all: $(PDF)
|
|
|
|
$(PDF): $(DOC) $(DEPS) $(FIGURES) $(OUTPUT)
|
|
@echo " [GEN] pdflatex $<"
|
|
@pdflatex $(PDFLATEX_FLAGS) -interaction=batchmode $< > $(OUTPUT)/pdflatex.log
|
|
@pdflatex $(PDFLATEX_FLAGS) -interaction=batchmode $< >> $(OUTPUT)/pdflatex.log
|
|
@pdflatex $(PDFLATEX_FLAGS) -interaction=nonstopmode $< >> $(OUTPUT)/pdflatex.log
|
|
|
|
copy: $(PDF)
|
|
@echo " [COPY] $^ -> /mnt/copydrive/$(USER)"
|
|
@mkdir -p /mnt/copydrive/$(USER)
|
|
@cp $^ /mnt/copydrive/$(USER)
|
|
|
|
check: $(DOC) $(DEPS)
|
|
@echo " [CHECK] lacheck"
|
|
@lacheck $<
|
|
|
|
# Populate PWD folders to build folder because pdflatex not creates itself
|
|
$(OUTPUT):
|
|
@mkdir -p $@
|
|
@rsync -a -f "+ */" -f "- *" ./ $@/
|
|
|
|
clean:
|
|
@echo " [CLEAN]"
|
|
@rm -rf release
|
|
@rm -rf $(OUTPUT)
|
|
@rm -rf *.pdf *.log *.lof *.lot *.lol *.aux *.toc *.bbl *.blg *.out
|
|
@rm -rf contents/*.aux
|
|
@rm -rf appendix/*.aux
|
|
|
|
.PHONY: all copy clean
|