m-thesis-documentation/documents/thesis/Makefile

39 lines
900 B
Makefile
Raw Normal View History

2022-07-12 04:20:00 +02:00
# vim:ft=make
-include config.mk
2022-08-24 17:24:49 +02:00
.PHONY: all clean dist-clean chapters chapters-clean
2022-07-12 04:20:00 +02:00
### Variables
MAIN_SRC ?= main.tex
TEXENGINE ?= latexmk --pdf
2022-08-24 17:24:49 +02:00
CHAPTERS_DIR = ./chapters
2022-07-12 04:20:00 +02:00
MAIN_TARGET = $(patsubst %.tex,%.pdf,$(MAIN_SRC))
2022-08-24 17:24:49 +02:00
CHAPTER_SRC = $(wildcard $(CHAPTERS_DIR)/*.tex)
CHAPTER_TARGET = $(patsubst %.tex,%.pdf,$(CHAPTER_SRC))
CHAPTER_TARGET_NAMES = $(notdir $(CHAPTER_TARGET))
2022-07-12 04:20:00 +02:00
### Targets
all: $(MAIN_TARGET)
dist: all clean
2022-08-24 17:24:49 +02:00
chapters: $(CHAPTER_TARGET)
make -C "chapters" all
chapters-clean:
make -C "chapters" clean
$(CHAPTER_TARGET) $(CHAPTER_TARGET_NAMES) : %.pdf:
#$(TEXENGINE) -cd $^
make -C "chapters" $(patsubst $(CHAPTERS_DIR),,$@)
2022-08-25 16:04:54 +02:00
$(MAIN_TARGET): $(MAIN_SRC) $(CHAPTER_SRC) preamble.tex
2022-08-24 17:24:49 +02:00
$(TEXENGINE) $<
2022-07-12 04:20:00 +02:00
dist-clean: clean
@rm -vf *.pdf *.eps *.dvi *.ps
clean:
@rm -vf *.dat *.log *.out *.aux *.nav *.snm *.toc *.vrb *~ *.fls *.fdb_latexmk *-blx.bib *.bbl *.blg *.run.xml