link
authorNot Zed <notzed@gmail.com>
Tue, 28 Feb 2023 02:33:06 +0000 (13:03 +1030)
committerNot Zed <notzed@gmail.com>
Tue, 28 Feb 2023 02:33:06 +0000 (13:03 +1030)
Makefile

index 73bd8d8..da8e461 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,3 +65,20 @@ run-editor: duskz.tools
        $(JAVA) \
                $(if $(JAVAMODPATH),--module-path $(subst $(S),:,$(JAVAMODPATH))) \
                -m duskz.tools/duskz.viewer.MapViewer
+
+ifeq ($(TARGET),linux-amd64)
+jlink_MODPATH = $(JAVA_HOME)/jmods:/usr/local/javafx-jmods
+else
+jlink_MODPATH = /usr/local/$(TARGET)/jdk/jmods:/usr/local/$(TARGET)/javafx-jmods
+endif
+
+link: duskz.client duskz.server duskz.common
+       rm -rf bin/$(TARGET)/image
+       $(JAVA_HOME)/bin/jlink \
+               --module-path .lib:bin/$(TARGET)/jmods:$(jlink_MODPATH) \
+               --add-modules duskz.client,duskz.server \
+               --no-man-pages \
+               --compress 2 \
+               --output bin/$(TARGET)/image
+       cd bin/$(TARGET)/image && \
+       7za a ../../$(dist_NAME)-$(dist_VERSION)-$(TARGET).zip .