-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (67 loc) · 3.3 KB
/
Copy pathMakefile
File metadata and controls
77 lines (67 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# ============================================================================
# Build configuration for Master's thesis manuscript and defense presentation
# ============================================================================
# --- Manuscript Build Configuration ---
# MS_TEX: LaTeX engine (default: pdflatex)
# MS_TEXFLAGS: Flags passed to pdflatex
# -interaction=nonstopmode: non-interactive mode (skip prompts)
# -file-line-error: show errors in file:line format
# MS_BIB: Bibliography processor (optional, empty by default)
# MS_FILE: Main LaTeX source file (default: thesis)
MS_TEX = pdflatex
MS_TEXFLAGS ?=
#-interaction=nonstopmode -file-line-error
MS_BIB ?=
MS_FILE ?= paper
# LaTeX auxiliary files to remove during clean
# Includes: cross-references, bibliography, font database, logs, etc.
CLEAN_EXTS = *.aux *-blx.bib *.bcf *.blg *.bbl *.brf *.fdb_latexmk *.fls *.loa *.lof *.log *.lot *.lpr *.nav *.out *.run.xml *.snm *.toc *.vrb *.synctex.gz
.SUFFIXES: .aux .pdf .tex
.PHONY: all paper clean distclean help
# Build both manuscript and presentation
all: paper
# Build manuscript PDF
# Process: LaTeX → (Bibliography if configured) → LaTeX → LaTeX
# Three LaTeX passes ensure cross-references and citations are resolved
paper:
cd manuscript && $(MS_TEX) $(MS_TEXFLAGS) $(MS_FILE).tex
@if [ -n "$(MS_BIB)" ]; then cd manuscript && $(MS_BIB) $(MS_FILE); fi
cd manuscript && $(MS_TEX) $(MS_TEXFLAGS) $(MS_FILE).tex
cd manuscript && $(MS_TEX) $(MS_TEXFLAGS) $(MS_FILE).tex
# Remove temporary LaTeX files (keep PDFs)
clean:
cd manuscript && rm -f $(CLEAN_EXTS)
# Remove temporary files AND generated PDFs
distclean: clean
rm -f manuscript/$(MS_FILE).pdf presentation/$(PR_FILE).pdf
# Display help message with available targets and variables
help:
@echo "========== LaTeX Build System =========="
@echo ""
@echo "TARGETS:"
@echo " make / make all - Build BOTH manuscript and presentation"
@echo " make manuscript - Build ONLY manuscript/$(MS_FILE).pdf"
@echo " make presentation - Build ONLY presentation/$(PR_FILE).pdf"
@echo " make clean - Remove temporary LaTeX files (keeps PDFs)"
@echo " make distclean - Remove temporary files AND PDFs"
@echo " make help - Show this help message"
@echo ""
@echo "CONFIGURABLE VARIABLES (override via: make VAR=value):"
@echo " Manuscript:"
@echo " MS_FILE=$(MS_FILE) - Main source file (no .tex extension)"
@echo " MS_TEX=$(MS_TEX) - LaTeX engine"
@echo " MS_TEXFLAGS - Compiler flags"
@echo " MS_BIB=$(MS_BIB) - Bibliography processor (biber, bibtex, or empty)"
@echo ""
@echo " Presentation:"
@echo " PR_FILE=$(PR_FILE) - Main source file (no .tex extension)"
@echo " PR_TEX=$(PR_TEX) - LaTeX engine"
@echo " PR_TEXFLAGS - Compiler flags"
@echo " PR_BIB=$(PR_BIB) - Bibliography processor (biber, bibtex, or empty)"
@echo ""
@echo "EXAMPLES:"
@echo " make # Build both documents"
@echo " make manuscript # Build thesis only"
@echo " make clean # Clean all temporary files"
@echo " make MS_BIB=biber manuscript # Build with biber bibliography"
@echo " make help # Show this help message"