Made makefile more generic
This commit is contained in:
12
Makefile
12
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)
|
||||
|
||||
Reference in New Issue
Block a user