From b7f1078879a8040ce0c964eecaf4d92eb853dda0 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 25 May 2018 08:39:22 +0200 Subject: Allows for a standalone Jar. --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 703a421..2c8120f 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,10 @@ SRC_DIR ?= ${CURDIR}/src/ BIN_DIR ?= ${CURDIR}/bin/ LIB_DIR ?= ${CURDIR}/lib/ +TMP_DIR ?= /tmp/hastabel_standalone.jar.build/ TARGET ?= hastabel.jar +STANDALONE ?= hastabel_standalone.jar INSTALL_DIR ?= $(LIB_DIR) #### Where to get the missing Jar files. @@ -52,6 +54,11 @@ JAVA_SOURCES = \ CLASSES = $(patsubst $(SRC_DIR)/%,$(BIN_DIR)/%, $(JAVA_SOURCES:.java=.class)) ## Makefile Rules ############################################################## +$(STANDALONE): $(TMP_DIR) $(TARGET) $(ANTLR_JAR) + unzip -d $(TMP_DIR) -uo $(TARGET) + unzip -d $(TMP_DIR) -uo $(ANTLR_JAR) + jar -cvf $@ -C $(TMP_DIR) . + $(TARGET): $(ANTLR_JAR) $(JAVA_SOURCES) $(CLASSES) rm -f $(TARGET) $(INSTALL_DIR)/$@ $(JAR) cf $@ -C $(BIN_DIR) . @@ -78,6 +85,9 @@ $(CLASSES): $(BIN_DIR)/%.class: $(SRC_DIR)/%.java $(BIN_DIR) echo "Attempting to download missing jar '$@'..." cd $(LIB_DIR); $(DOWNLOADER) "$(JAR_SOURCE)/$(notdir $@)" +$(TMP_DIR): + mkdir -p $@ + $(LIB_DIR): mkdir -p $@ @@ -85,5 +95,5 @@ $(BIN_DIR): mkdir -p $@ ##### For my private use... -publish: $(TARGET) - scp $< dreamhost:~/noot-noot/tabellion/jar/ +publish: $(TARGET) $(STANDALONE) + scp $^ dreamhost:~/noot-noot/tabellion/jar/ -- cgit v1.2.3-70-g09d2