Store intermediate files in separate build directory

This commit is contained in:
Daniel - 2018-08-19 16:08:47 +02:00
parent b14eaa7d09
commit 51ae3ad864
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
2 changed files with 16 additions and 9 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
*.synctex.gz *.synctex.gz
/presentations/*.pdf /presentations/*.pdf
/presentations/auto /presentations/auto
/presentations/build/

View File

@ -1,17 +1,23 @@
PRESENTATIONS=$(patsubst %.tex, %.pdf, $(wildcard presentations/*.tex)) PRESENTATIONS=$(patsubst %.tex, %.pdf, $(wildcard presentations/*.tex))
BUILD_DIR=build
BUILD_DECKS=$(subst presentations, presentations/$(BUILD_DIR), $(wildcard presentations/content/*))
LATEX=pdflatex -output-directory $(BUILD_DIR)
all: ${PRESENTATIONS} all: ${PRESENTATIONS}
clean: clean:
rm -f presentations/*.log rm -fr presentations/$(BUILD_DIR)
rm -f presentations/*.out
rm -f presentations/*.nav distclean: clean
rm -f presentations/*.aux rm -f presentations/*.pdf
rm -f presentations/*.snm
rm -f presentations/*.toc .SECONDARY: $(BUILD_DECKS)
presentations/$(BUILD_DIR)/%:
mkdir -p $@
.ONESHELL: .ONESHELL:
presentations/%.pdf : presentations/%.tex presentations/%.pdf : presentations/%.tex $(BUILD_DECKS)
cd presentations cd presentations
pdflatex $(notdir $<) $(LATEX) $(notdir $<)
pdflatex $(notdir $<) $(LATEX) $(notdir $<)
mv $(BUILD_DIR)/$*.pdf .