-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 1.08 KB
/
Makefile
File metadata and controls
44 lines (34 loc) · 1.08 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
# Makefile for building CV with pdflatex
# Variables
SRCDIR = src
BUILDDIR = build
MAIN = eivindml-cv
TEXFILE = $(SRCDIR)/$(MAIN).tex
PDFFILE = $(BUILDDIR)/$(MAIN).pdf
# Compiler flags
PDFLATEX = pdflatex
PDFLATEX_FLAGS = -shell-escape -interaction=nonstopmode
# Default target
all: $(PDFFILE)
# Create build directory if it doesn't exist
$(BUILDDIR):
mkdir -p $(BUILDDIR)
# Compile the PDF (run twice for references)
$(PDFFILE): $(TEXFILE) $(BUILDDIR)
cd $(SRCDIR) && $(PDFLATEX) $(PDFLATEX_FLAGS) -output-directory=../$(BUILDDIR) $(MAIN).tex
cd $(SRCDIR) && $(PDFLATEX) $(PDFLATEX_FLAGS) -output-directory=../$(BUILDDIR) $(MAIN).tex
# Clean temporary files
clean:
rm -f $(BUILDDIR)/*.aux $(BUILDDIR)/*.log $(BUILDDIR)/*.out
# Clean all generated files including PDF
distclean: clean
rm -f $(PDFFILE)
rm -rf $(BUILDDIR)
# Watch for changes (requires entr: brew install entr)
watch:
@echo "Watching for changes... (requires 'entr' to be installed)"
@find $(SRCDIR) -name "*.tex" | entr -c make
# Open the PDF (macOS)
open: $(PDFFILE)
open $(PDFFILE)
.PHONY: all clean distclean watch open