-love:
- @echo " ...not war."
-
-resources: libs
- @echo Copying resources and documentation into bin/...
- @if ! cp *.md bin/ 2>/dev/null; then \
- if [ -e VERSION ]; then \
- cp VERSION bin/no-documentation.md; \
- else \
- echo > bin/no-documentation.md; \
+# Main buildables
+jar: libs resources $(NAME).jar
+$(NAME).jar: latest_bin
+ @echo
+ @echo ">>>>>>>>>> Generating $@..."
+ @if [ -d libs/bin/ ]; then \
+ echo cp -r libs/bin/* bin/; \
+ cp -r libs/bin/* bin/; \
+ fi;
+ cp -r src/* bin/
+ @echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest
+ @echo >> bin/manifest
+ $(JAR) cfm $(NAME).jar bin/manifest -C ./ *.md $(JAR_FLAGS)
+ @if [ -e VERSION ]; then \
+ echo cp $(NAME).jar "$(NAME)-`cat VERSION`.jar"; \
+ cp $(NAME).jar "$(NAME)-`cat VERSION`.jar"; \
+ fi;
+
+sjar: libs $(NAME)-sources.jar
+$(NAME)-sources.jar: latest_src
+ @echo
+ @echo ">>>>>>>>>> Generating $@..."
+ @echo > bin/manifest
+ $(JAR) cfm $(NAME)-sources.jar \
+ bin/manifest -C ./ *.md $(SJAR_FLAGS);
+ @if [ -e VERSION ]; then \
+ echo cp $(NAME)-sources.jar \
+ "$(NAME)-`cat VERSION`-sources.jar"; \
+ cp $(NAME)-sources.jar \
+ "$(NAME)-`cat VERSION`-sources.jar"; \
+ fi;
+
+# Requisites
+libs: check_time latest_lib
+latest_lib: bin/libs
+bin/libs:
+ @echo
+ @echo ">>>>>>>>>> Extracting sources from libs..."
+ @cd src && \
+ for lib in ../libs/*-sources.jar \
+ ../libs/*-sources.patch.jar; do \
+ if [ "$$lib" != '../libs/*-sources.jar' \
+ -a "$$lib" != '../libs/*-sources.patch.jar' ]; \
+ then \
+ echo cd src \&\& jar xf "$$lib"; \
+ jar xf "$$lib"; \