-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
62 lines (48 loc) · 1.98 KB
/
makefile
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
# Define the PDF engine
PDF_ENGINE = xelatex
# Use `find` to dynamically get lists of markdown files
LETTER_MD := $(shell find job_postings -type f -name "letter_*.md")
RESUME_MD := $(shell find job_postings -type f -name "resume_*.md")
# Define the corresponding PDF files
LETTER_PDF := $(LETTER_MD:.md=.pdf)
RESUME_PDF := $(RESUME_MD:.md=.pdf)
# Default target: build all PDFs
all: $(LETTER_PDF) $(RESUME_PDF)
# Rule to build cover letters
job_postings/%/letter_%.pdf: job_postings/%/letter_%.md src/cover_letter_template.tex
@echo "Building cover letter PDF: $@"
@pandoc $< -o $@ --pdf-engine=$(PDF_ENGINE) --template=src/cover_letter_template.tex
# Rule to build resumes
job_postings/%/resume_%.pdf: job_postings/%/resume_%.md src/template.tex
@echo "Building resume PDF: $@"
@pandoc $< -o $@ --pdf-engine=$(PDF_ENGINE) --template=src/template.tex
# Clean target
clean:
@echo "Cleaning all generated PDFs..."
find job_postings -type f -name "*.pdf" -delete
@echo "All PDFs have been removed."
.PHONY: all clean
# Define the PDF engine
PDF_ENGINE = xelatex
# Use `find` to dynamically get lists of markdown files
LETTER_MD := $(shell find job_postings -type f -name "letter_*.md")
RESUME_MD := $(shell find job_postings -type f -name "resume_*.md")
# Define the corresponding PDF files by replacing .md with .pdf
LETTER_PDF := $(LETTER_MD:.md=.pdf)
RESUME_PDF := $(RESUME_MD:.md=.pdf)
# Default target: build all PDFs
all: $(LETTER_PDF) $(RESUME_PDF)
# Rule to build cover letters
$(LETTER_PDF): %.pdf: %.md src/cover_letter_template.tex
@echo "Building cover letter PDF: $@"
pandoc $< -o $@ --pdf-engine=$(PDF_ENGINE) --template=src/cover_letter_template.tex
# Rule to build resumes
$(RESUME_PDF): %.pdf: %.md src/template.tex
@echo "Building resume PDF: $@"
pandoc $< -o $@ --pdf-engine=$(PDF_ENGINE) --template=src/template.tex
# Clean target
clean:
@echo "Cleaning all generated PDFs..."
find job_postings -type f -name "*.pdf" -delete
@echo "All PDFs have been removed."
.PHONY: all clean