+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"; \
+ fi; \
+ done;
+ mkdir -p bin
+ touch bin/libs
+
+resources: check_time libs latest_rsc
+latest_rsc: bin/VERSION
+bin/VERSION:
+ @echo
+ @echo ">>>>>>>>>> Copying resources and documentation into bin/..."
+ mkdir -p bin
+ @if ! ls *.md 2>/dev/null 2>&1; then \
+ echo touch bin/no-documentation.md; \
+ touch bin/no-documentation.md; \
+ else \
+ echo cp *.md bin/; \
+ cp *.md bin/; \
+ fi;
+ @cd src && find . | grep -v '\.java$$' \
+ | grep -v '/test/' | while read -r ln; do \
+ if [ -f "$$ln" ]; then \
+ dir="`dirname "$$ln"`"; \
+ mkdir -p "../bin/$$dir" ; \
+ echo cp "$$ln" "../bin/$$ln" ; \
+ cp "$$ln" "../bin/$$ln" ; \
+ fi ; \
+ done;
+ cp VERSION bin/
+
+test-resources: check_time resources latest_tsc
+latest_tsc: latest_ttt
+latest_ttt:
+ @echo
+ @echo ">>>>>>>>>> Copying test resources into bin/..."
+ @cd src && find . | grep -v '\.java$$' \
+ | grep '/test/' | while read -r ln; do \
+ if [ -f "$$ln" ]; then \
+ dir="`dirname "$$ln"`"; \
+ mkdir -p "../bin/$$dir" ; \
+ echo cp "$$ln" "../bin/$$ln" ; \
+ cp "$$ln" "../bin/$$ln" ; \
+ fi ; \
+ done;
+ touch latest_ttt