diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 47 |
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 |
