$(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 .