Commit | Line | Data |
---|---|---|
dc2075d6 NR |
1 | ### |
2 | ### You can use this Makefile to generate an executable JAR file | |
3 | ### The available options are: | |
4 | ### - make: will create the default (or currently compiled) JAR | |
5 | ### - make bin/5 && make: will create a Java 1.5 JAR | |
6 | ### - make bin/6 && make: will create a Java 1.6 JAR | |
7 | ### - make bin/7 && make: will create a Java 1.7 JAR | |
8 | ### - make bin/8 && make: will create a Java 1.8 JAR | |
9 | ### - make clean: will clean temporary files | |
10 | ### - make mrpropre: will clean temporary files and remove the JAR file | |
11 | ||
203ace76 NR |
12 | ALL: jvcard.jar |
13 | ||
14 | # Default: Java 1.5 | |
15 | bin/be/nikiroo/jvcard/launcher/Main.class: bin/5 | |
152ba78f | 16 | |
dc2075d6 NR |
17 | .PHONY: ALL clean mrproper mrpropre love |
18 | ||
19 | love: | |
20 | @echo ...not war? | |
21 | ||
22 | clean: | |
23 | @echo Cleaning files... | |
24 | @rm -f bin/[0-9] bin/files bin/lanterna | |
25 | ||
26 | mrproper: mrpropre | |
27 | ||
28 | mrpropre: clean | |
29 | @echo Removing jar files... | |
6435013a | 30 | @rm -f jvcard.jar jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar |
dc2075d6 | 31 | |
203ace76 | 32 | jvcard.jar: bin/be/nikiroo/jvcard/launcher/Main.class src/be/nikiroo/jvcard/*/* src/be/nikiroo/jvcard/* |
dc2075d6 NR |
33 | @echo 'Main-Class: be.nikiroo.jvcard.launcher.Main' > bin/manifest |
34 | @echo >> bin/manifest | |
6435013a NR |
35 | @echo Creating jar file jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar... |
36 | jar cfm jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar bin/manifest -C bin/ be -C bin/ com | |
dc2075d6 NR |
37 | @rm bin/manifest |
38 | @echo Copying to jvcard.jar... | |
6435013a | 39 | @cp jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar jvcard.jar |
152ba78f | 40 | |
203ace76 NR |
41 | bin/5: bin/lanterna bin/files |
42 | @cp -r src/* bin/ | |
dc2075d6 | 43 | @echo Compiling in Java 1.5 mode "('make bin/5')"... |
50f45fac | 44 | javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 5 -target 5 @bin/files -d bin/ |
dc2075d6 NR |
45 | @rm -f bin/[0-9] |
46 | @touch bin/5 | |
152ba78f | 47 | |
203ace76 NR |
48 | bin/6: bin/lanterna bin/files |
49 | @cp -r src/* bin/ | |
dc2075d6 | 50 | @echo Compiling in Java 1.6 mode "('make bin/6')"... |
50f45fac | 51 | javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 6 -target 6 @bin/files -d bin/ |
dc2075d6 NR |
52 | @rm -f bin/[0-9] |
53 | @touch bin/6 | |
152ba78f | 54 | |
203ace76 NR |
55 | bin/7: bin/lanterna bin/files |
56 | @cp -r src/* bin/ | |
dc2075d6 | 57 | @echo Compiling in Java 1.7 mode "('make bin/7')"... |
50f45fac | 58 | javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 7 -target 7 @bin/files -d bin/ |
dc2075d6 NR |
59 | @rm -f bin/[0-9] |
60 | @touch bin/7 | |
61 | ||
203ace76 NR |
62 | bin/8: bin/lanterna bin/files |
63 | @cp -r src/* bin/ | |
dc2075d6 | 64 | @echo Compiling in Java 1.8 mode "('make bin/8')"... |
50f45fac | 65 | javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 8 -target 8 @bin/files -d bin/ |
dc2075d6 NR |
66 | @rm -f bin/[0-9] |
67 | @touch bin/8 | |
152ba78f | 68 | |
51498432 NR |
69 | bin/files: src/be/nikiroo/jvcard/*/* src/be/nikiroo/jvcard/* |
70 | @mkdir -p bin/ | |
71 | @find src/be/ -name '*.java' > bin/files | |
152ba78f | 72 | |
ed91f27a | 73 | bin/lanterna: src/resources/* src/com/googlecode/lanterna/* src/com/googlecode/lanterna/*/* src/com/googlecode/lanterna/*/*/* |
51498432 | 74 | @mkdir -p bin/ |
dc2075d6 | 75 | @find src/com/ -name '*.java' > bin/lanterna |
ed91f27a | 76 | cp -r src/resources/* bin/ |
203ace76 | 77 | javac -encoding UTF-8 -source 5 @bin/lanterna -d bin/ || rm bin/lanterna |
dc2075d6 | 78 | @test -e bin/lanterna |
152ba78f | 79 |