summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-09-07 14:33:29 -0600
committermo khan <mo@mokhan.ca>2025-09-07 14:33:29 -0600
commit15fa0622508be0382049e4ef8d1d0de7dea4f6b4 (patch)
treed961a0fdcd6e634d299ff4e7fff3c9100423a01f /Makefile
parent9d8eb298ac195ab4404287e64685df1f4b27f057 (diff)
chore: add Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bf840d1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+# COMP-347 Assignment 1 Makefile
+
+# Variables
+ASSIGNMENT = assignment1
+ASSIGNMENT_DIR = comp347/assignment1
+MD_FILE = $(ASSIGNMENT_DIR)/$(ASSIGNMENT).md
+PDF_FILE = $(ASSIGNMENT_DIR)/$(ASSIGNMENT).pdf
+ZIP_FILE = $(ASSIGNMENT_DIR)/$(ASSIGNMENT).zip
+
+# Default target
+all: pdf zip
+
+# Convert markdown to PDF
+pdf: $(PDF_FILE)
+
+$(PDF_FILE): $(MD_FILE)
+ pandoc $(MD_FILE) -o $(PDF_FILE) \
+ --pdf-engine=pdflatex \
+ --variable=geometry:margin=1in \
+ --variable=fontsize:11pt \
+ --toc \
+ --number-sections
+
+# Create submission zip file
+zip: $(ZIP_FILE)
+
+$(ZIP_FILE): $(PDF_FILE)
+ cd $(ASSIGNMENT_DIR) && zip -r $(ASSIGNMENT).zip . -x "*.zip" ".DS_Store"
+
+# Clean generated files
+clean:
+ rm -f $(PDF_FILE) $(ZIP_FILE)
+
+# Force rebuild
+rebuild: clean all
+
+# Help target
+help:
+ @echo "Available targets:"
+ @echo " all - Build PDF and create ZIP (default)"
+ @echo " pdf - Convert markdown to PDF"
+ @echo " zip - Create submission ZIP file"
+ @echo " clean - Remove generated files"
+ @echo " rebuild - Clean and rebuild all"
+ @echo " help - Show this help message"
+
+.PHONY: all pdf zip clean rebuild help