X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=Makefile.base;h=a88eb4a2df0d9c09378831aeda1945beccbc4d2e;hp=86050e6d3e9e7db7da1bcc2015895c0da8364a75;hb=614574c4a697c12338766b1d7914733ddf63a7ab;hpb=d3c15421430e85e3afeefef211b4f791753e17ba diff --git a/Makefile.base b/Makefile.base index 86050e6..a88eb4a 100644 --- a/Makefile.base +++ b/Makefile.base @@ -6,9 +6,10 @@ #PREFIX = usually /usr/local (where to install the program) #TEST = path to main test source to compile #JAR_FLAGS += a list of things to pack, each usually prefixed with "-C bin/" +#SJAR_FLAGS += a list of things to pack, each usually prefixed with "-C src/", for *-sources.jar files JAVAC = javac -JAVAC_FLAGS += -encoding UTF-8 -d ./bin/ -cp ./src/ -Xdiags:verbose +JAVAC_FLAGS += -encoding UTF-8 -d ./bin/ -cp ./src/ JAVA = java JAVA_FLAGS += -cp ./bin/ JAR = jar @@ -76,6 +77,9 @@ mrproper: mrpropre mrpropre: clean rm -f $(NAME).jar + rm -f $(NAME)-sources.jar + [ ! -e VERSION ] || rm -f "$(NAME)-`cat VERSION`.jar" + [ ! -e VERSION ] || rm -f "$(NAME)-`cat VERSION`-sources.jar" love: @echo " ...not war." @@ -102,10 +106,15 @@ $(NAME).jar: resources @[ -e bin/$(MAIN).class ] || echo You need to build the sources @[ -e bin/$(MAIN).class ] @echo Making JAR file... + @echo > bin/manifest + @[ "$(SJAR_FLAGS)" = "" ] || echo Creating $(NAME)-sources.jar... + @[ "$(SJAR_FLAGS)" = "" ] || $(JAR) cfm $(NAME)-sources.jar bin/manifest $(SJAR_FLAGS) + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`-sources.jar"... + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || cp $(NAME)-sources.jar "$(NAME)-`cat VERSION`-sources.jar" @echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest @echo >> bin/manifest $(JAR) cfm $(NAME).jar bin/manifest $(JAR_FLAGS) - @[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar" + @[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar"... @[ ! -e VERSION ] || cp $(NAME).jar "$(NAME)-`cat VERSION`.jar" run: