-install: all scripts tools/syncthing
- mkdir -p $(INSTALL_DIR) && cp $(LOCAL_BINDIR)/* $(INSTALL_DIR)
- mkdir -p $(INSTALL_WEBAPP_DIR) && cp -a webapp/dist/* $(INSTALL_WEBAPP_DIR)
+install:
+ @test -e $(LOCAL_BINDIR)/xds-server$(EXT) -a -d webapp/dist || { echo "Please execute first: make all\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/xds-server-start.sh -a -d $(LOCAL_BINDIR)/xds-utils || { echo "Please execute first: make all\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/syncthing$(EXT) -a -e $(LOCAL_BINDIR)/syncthing-inotify$(EXT) || { echo "Please execute first: make all\n"; exit 1; }
+ mkdir -p $(DESTDIR) \
+ && cp -a $(LOCAL_BINDIR)/* $(DESTDIR)
+ mkdir -p $(DESTDIR_WWW) \
+ && cp -a webapp/dist/* $(DESTDIR_WWW)
+
+.PHONY: _package
+_package: clean
+ make -f $(ROOT_SRCDIR)/Makefile all install DESTDIR=$(PACKAGE_DIR)/xds-server
+ make -f $(ROOT_SRCDIR)/Makefile conffile DESTDIR=$(PACKAGE_DIR)/xds-server DESTDIR_WWW=www
+ cp -r $(ROOT_SRCDIR)/conf.d $(PACKAGE_DIR)/xds-server
+ rm -f $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE)
+ (cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-server)
+
+# On support Linux for now
+.PHONY: package
+package:
+ @echo "# Build linux amd64..."
+ GOOS=linux GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile _package
+ make -f $(ROOT_SRCDIR)/Makefile clean
+
+.PHONY: package-all
+package-all: package