From 260b86e5bb0a25a697e2aa85073594fbd3772a43 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 4 May 2026 10:41:59 -0400 Subject: [PATCH] feat(build): add Makefile for building Deedy-Resume with LaTeX --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c9496f2 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# Deedy-Resume (OpenFonts) build +# +# Requires: latexmk, xelatex, bibtex (TeX Live or MacTeX). +# Run all targets from the repo root — the .cls references fonts/ by +# relative path and only resolves correctly from here. + +TEX := deedy_resume-openfont.tex +NAME := $(basename $(TEX)) +DIST := dist +PDF := $(DIST)/$(NAME).pdf + +SOURCES := $(TEX) deedy-resume-openfont.cls publications.bib + +LATEXMK := latexmk +LATEXMK_FLAGS := -xelatex -interaction=nonstopmode -halt-on-error -output-directory=$(DIST) + +# Pick a PDF viewer: xdg-open on Linux, open on macOS. +VIEWER := $(shell command -v xdg-open 2>/dev/null || command -v open 2>/dev/null) + +.PHONY: all build watch preview clean distclean help + +all: build + +## build: compile the resume into dist/ +build: $(PDF) + +$(PDF): $(SOURCES) | $(DIST) + $(LATEXMK) $(LATEXMK_FLAGS) $(TEX) + +$(DIST): + mkdir -p $(DIST) + +## watch: rebuild + live-preview on every save (dev mode) +watch: | $(DIST) + $(LATEXMK) $(LATEXMK_FLAGS) -pvc $(TEX) + +## preview: build once and open the PDF +preview: build +ifeq ($(VIEWER),) + @echo "No PDF viewer found (install xdg-open or open). PDF is at $(PDF)." +else + $(VIEWER) $(PDF) +endif + +## clean: remove LaTeX aux files but keep the PDF +clean: + -$(LATEXMK) -c -output-directory=$(DIST) $(TEX) + +## distclean: remove dist/ entirely +distclean: + rm -rf $(DIST) + +## help: list available targets +help: + @grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //'