.PHONY : all all: pdf epub build/%.pdf : src/%.tex @echo "Building $@... $^" @if [ ! -d "./build" ]; then mkdir ./build; fi @pdflatex --output-dir ./build $< @pdflatex --output-dir ./build $< build/%.epub : src/%.tex @echo "Building $@... $^" @if [ ! -d "./build" ]; then mkdir ./build; fi @pandoc -f latex $< -o $@ pdf : build/aetherials.pdf epub : build/aetherials.epub .PHONY : release release : pdf epub @echo "Building release.... $<" @if [ ! -d "./release" ]; then mkdir ./release; fi @cp ./build/*.pdf ./release/ @cp ./build/*.epub ./release/ clean : @rm -rf *.aux *.dvi *.log *.out *.pdf *.bak ./build/ ./release/