Made makefile more generic
This commit is contained in:
12
Makefile
12
Makefile
@ -1,4 +1,6 @@
|
|||||||
JCC = javac
|
JCC = javac
|
||||||
|
MAIN_CLASS = Driver
|
||||||
|
OUT_JAR = MTGClone.jar
|
||||||
|
|
||||||
JFLAGS = -g
|
JFLAGS = -g
|
||||||
|
|
||||||
@ -9,21 +11,21 @@ default:
|
|||||||
@echo \"make clean\" to clean up artifacts
|
@echo \"make clean\" to clean up artifacts
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(JCC) $(JFLAGS) Driver.java
|
$(JCC) $(JFLAGS) $(MAIN_CLASS).java
|
||||||
|
|
||||||
run: jar
|
run: jar
|
||||||
java -jar MTGClone.jar
|
java -jar $(OUT_JAR)
|
||||||
|
|
||||||
jar: build
|
jar: build
|
||||||
@echo "Manifest-Version: 1.0" > manifest.txt
|
@echo "Manifest-Version: 1.0" > manifest.txt
|
||||||
@echo "Class-Path: ." >> manifest.txt
|
@echo "Class-Path: ." >> manifest.txt
|
||||||
@echo "Main-Class: Driver" >> manifest.txt
|
@echo "Main-Class: $(MAIN_CLASS)" >> manifest.txt
|
||||||
@echo "" >> manifest.txt
|
@echo "" >> manifest.txt
|
||||||
jar -cmf manifest.txt MTGClone.jar *.class
|
jar -cmf manifest.txt $(OUT_JAR) *.class
|
||||||
$(RM) manifest.txt
|
$(RM) manifest.txt
|
||||||
$(RM) *.class
|
$(RM) *.class
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) *.class
|
$(RM) *.class
|
||||||
$(RM) manifest.txt
|
$(RM) manifest.txt
|
||||||
$(RM) MTGClone.jar
|
$(RM) $(OUT_JAR)
|
||||||
|
|||||||
Reference in New Issue
Block a user