X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=Makefile;h=cc5c222cbb7dd1d4613e4431f18ede9fe7d2644d;hb=71ac69a01a1051b24386ac67124c0aee657f3225;hp=68b1b0d4ed9937f28be08e154eeb76c45246946b;hpb=152ba78ff3c9d94d91b1e367b9cce94779655f40;p=jvcard.git diff --git a/Makefile b/Makefile index 68b1b0d..cc5c222 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,88 @@ -# default target: create the jar file -ALL: jar +### +### You can use this Makefile to generate an executable JAR file +### The available options are: +### - make: will create the JAR file (must be compiled before) +### - make bin/5 && make: will create a Java 1.5 JAR +### - make bin/6 && make: will create a Java 1.6 JAR +### - make bin/7 && make: will create a Java 1.7 JAR +### - make bin/8 && make: will create a Java 1.8 JAR +### - make clean: will clean temporary files +### - make mrpropre: will clean temporary files and remove the JAR file -# always re-generate the files list -.PHONY: classes files 5 6 7 jar +ALL: jvcard.jar -jar: classes - echo TODO: jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar - cp jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | cut -d'"' -f2`.jar jvcard.jar +bin/bin: bin/be/nikiroo/jvcard/launcher/Main.class src/be/nikiroo/jvcard/*/* src/be/nikiroo/jvcard/* + @echo You need to compile the code first: + @echo " make bin/5: will compile in Java 1.5 target mode" + @echo " make bin/6: will compile in Java 1.6 target mode" + @echo " make bin/7: will compile in Java 1.7 target mode" + @echo " make bin/8: will compile in Java 1.8 target mode" + @false -# Default java version: 1.5 -classes: 5 +.PHONY: ALL clean mrproper mrpropre love -5: lanterna files - javac -cp bin/ -encoding UTF-8 -Xlint -source 5 @files -d bin/ +love: + @echo ...not war? -6: lanterna files - javac -cp bin/ -encoding UTF-8 -Xlint -source 6 @files -d bin/ +clean: + @echo Cleaning files... + @rm -f bin/[0-9] bin/bin bin/files bin/lanterna -7: lanterna files - javac -cp bin/ -encoding UTF-8 -Xlint -source 7 @files -d bin/ +mrproper: mrpropre -files: - find src/be/ -name '*.java' > files +mrpropre: clean + @echo Removing jar files... + @rm -f jvcard.jar jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar -lanterna: - find src/com/ -name '*.java' > lanterna - javac -encoding UTF-8 -source 5 @lanterna -d bin/ || rm lanterna - test -e lanterna +jvcard.jar: bin/bin + @echo 'Main-Class: be.nikiroo.jvcard.launcher.Main' > bin/manifest + @echo >> bin/manifest + @echo Creating jar file jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar... + 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 -C bin/ default-theme.properties -C bin/ multilang + @rm bin/manifest + @echo Copying to jvcard.jar... + @cp jvcard-`grep "APPLICATION_VERSION" src/be/nikiroo/jvcard/launcher/Main.java | head -n1 | cut -d'"' -f2`.jar jvcard.jar + +bin/5: bin/lanterna bin/files + @cp -r src/* bin/ + @echo Compiling in Java 1.5 mode "('make bin/5')"... + javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 5 -target 5 @bin/files -d bin/ + @rm -f bin/[0-9] + @touch bin/5 + @touch bin/bin + +bin/6: bin/lanterna bin/files + @cp -r src/* bin/ + @echo Compiling in Java 1.6 mode "('make bin/6')"... + javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 6 -target 6 @bin/files -d bin/ + @rm -f bin/[0-9] + @touch bin/6 + @touch bin/bin + +bin/7: bin/lanterna bin/files + @cp -r src/* bin/ + @echo Compiling in Java 1.7 mode "('make bin/7')"... + javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 7 -target 7 @bin/files -d bin/ + @rm -f bin/[0-9] + @touch bin/7 + @touch bin/bin + +bin/8: bin/lanterna bin/files + @cp -r src/* bin/ + @echo Compiling in Java 1.8 mode "('make bin/8')"... + javac -cp bin/ -encoding UTF-8 -Xlint -Xlint:-options -source 8 -target 8 @bin/files -d bin/ + @rm -f bin/[0-9] + @touch bin/8 + @touch bin/bin + +bin/files: src/be/nikiroo/jvcard/*/* src/be/nikiroo/jvcard/* + @mkdir -p bin/ + @find src/be/ -name '*.java' > bin/files + +bin/lanterna: src/resources/* src/com/googlecode/lanterna/* src/com/googlecode/lanterna/*/* src/com/googlecode/lanterna/*/*/* + @mkdir -p bin/ + @find src/com/ -name '*.java' > bin/lanterna + cp -r src/resources/* bin/ + javac -encoding UTF-8 -source 5 @bin/lanterna -d bin/ || rm bin/lanterna + @test -e bin/lanterna