Browse Source

Made makefile more generic

pull/3/head
Gregory Rudolph 4 years ago
parent
commit
adb5212ff9
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 12
      Makefile

12
Makefile

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
JCC = javac
MAIN_CLASS = Driver
OUT_JAR = MTGClone.jar
JFLAGS = -g
@ -9,21 +11,21 @@ default: @@ -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)

Loading…
Cancel
Save