# - 1.2.1: improve 'apk' and add 'android'
# - 1.3.0: add 'man' for man(ual) pages
# - 1.4.0: remove android stuff (not working anyway)
+# - 1.5.0: include sources and readme/changelog in jar
# Required parameters (the commented out ones are supposed to be per project):
@[ ! -d libs ] || touch bin/libs
$(NAME)-sources.jar: libs
+ @ls *.md >/dev/null || cp VERSION README.md
@echo Making sources 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"
+ @[ "$(SJAR_FLAGS)" != "" ] || echo No sources JAR file defined, skipping
+ @[ "$(SJAR_FLAGS)" = "" ] || echo Creating $(NAME)-sources.jar...
+ @[ "$(SJAR_FLAGS)" = "" ] || $(JAR) cfm $(NAME)-sources.jar bin/manifest -C ./ *.md $(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"
$(NAME).jar: resources
@[ -e bin/$(MAIN).class ] || echo You need to build the sources
@[ -e bin/$(MAIN).class ]
+ @ls *.md >/dev/null || cp VERSION README.md
+ @echo "Copying documentation into bin/..."
+ @cp -r *.md bin/ || cp VERSION bin/no-documentation.md
+ @echo "Copying sources into bin/..."
+ @cp -r src/* bin/
+ @echo "Making jar..."
@echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest
@echo >> bin/manifest
- $(JAR) cfm $(NAME).jar bin/manifest $(JAR_FLAGS)
+ $(JAR) cfm $(NAME).jar bin/manifest -C ./ *.md $(JAR_FLAGS)
@[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar"...
@[ ! -e VERSION ] || cp $(NAME).jar "$(NAME)-`cat VERSION`.jar"