From adb5212ff9c58ebdc6468fe5e8dbb54ebb7a143c Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Sun, 20 Sep 2020 17:43:44 -0400 Subject: [PATCH] Made makefile more generic --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6f5feb9..01849b9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ JCC = javac +MAIN_CLASS = Driver +OUT_JAR = MTGClone.jar JFLAGS = -g @@ -9,21 +11,21 @@ default: @echo \"make clean\" to clean up artifacts build: - $(JCC) $(JFLAGS) Driver.java + $(JCC) $(JFLAGS) $(MAIN_CLASS).java run: jar - java -jar MTGClone.jar + java -jar $(OUT_JAR) jar: build @echo "Manifest-Version: 1.0" > manifest.txt @echo "Class-Path: ." >> manifest.txt - @echo "Main-Class: Driver" >> manifest.txt + @echo "Main-Class: $(MAIN_CLASS)" >> manifest.txt @echo "" >> manifest.txt - jar -cmf manifest.txt MTGClone.jar *.class + jar -cmf manifest.txt $(OUT_JAR) *.class $(RM) manifest.txt $(RM) *.class clean: $(RM) *.class $(RM) manifest.txt - $(RM) MTGClone.jar + $(RM) $(OUT_JAR)