summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-02-05 19:30:08 +0100
committermjkwiatkowski <mati.rewa@gmail.com>2026-02-05 19:30:08 +0100
commit6a76f57432dd942cc68b248486a28c523c4dd382 (patch)
tree9611b986355d8a9fce7fc62e5a97b41044ce9a2e /Makefile
parent3e8e2ea55ae43a6463f8f1d793f132e09fa951ce (diff)
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile63
1 files changed, 63 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a0f9602
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,63 @@
+# Configuration
+NAME = Thesis
+MAIN = thesis.tex
+BUILD_DIR = build
+
+# Do not change below this line
+# --------------------------------------------------------------------
+
+.PHONY: pdf clean zip init
+SOURCES = $(wildcard *.tex) $(wildcard content/*) $(wildcard style/*) $(wildcard images/*) $(wildcard/appendix/*) $(wildcard main.bib)
+ARCHIVE=$(NAME).zip
+LATEX=pdflatex -halt-on-error -interaction=nonstopmode -output-directory $(BUILD_DIR) -jobname=$(NAME) $(MAIN) >/dev/null
+BIB=bibtex $(BUILD_DIR)/$(NAME)
+GLOSSARIES=makeglossaries -d $(BUILD_DIR) $(NAME) >/dev/null
+
+pdf: $(BUILD_DIR)/$(NAME).pdf
+
+# Rule to build the PDF
+# Need to run pdflatex three times to get the references right
+$(BUILD_DIR)/$(NAME).pdf: $(SOURCES) $(BUILD_DIR)
+ @echo "Building PDF..."
+ @$(LATEX)
+ $(BIB)
+ $(GLOSSARIES)
+ @$(LATEX)
+ $(LATEX)
+
+$(BUILD_DIR):
+ mkdir -p $@
+
+# Zip target
+zip: $(NAME).zip
+
+$(NAME).zip: $(SOURCES)
+ zip -r $(NAME).zip $(SOURCES)
+
+# Clean rule
+clean:
+ trash -f $$(tr '\n' ' ' < .gitignore)
+
+# Create new project
+init: LICENSE
+
+LICENSE:
+ @echo -e "*.aux\\n\
+*.bbl\\n\
+*.brf\\n\
+*.nlo\\n\
+*.blg\\n\
+*.log\\n\
+*.fls\\n\
+*.fdb_latexmk\\n\
+*.toc\\n\
+*.lof\\n\
+*.lot\\n\
+*.out\\n\
+*.tdo\\n\
+main.synctex.gz\\n\
+main.pdf\\n\
+.idea\\n\
+out\\n\
+*.zip\\n\
+build" > .gitignore