aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 3329ead..db4d874 100644
--- a/Makefile
+++ b/Makefile
@@ -81,7 +81,7 @@ build: vendor xds webapp
xds: scripts tools/syncthing/copytobin
@echo "### Build XDS agent (version $(VERSION), subversion $(SUB_VERSION)) - $(BUILD_MODE)";
- @cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/xds-agent$(EXT) -ldflags "$(GORELEASE) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" -gcflags "$(GO_GCFLAGS)" .
+ @cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/xds-agent$(EXT) -ldflags "$(GO_LDFLAGS) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" -gcflags "$(GO_GCFLAGS)" .
test: tools/glide
go test --race $(shell $(LOCAL_TOOLSDIR)/glide novendor)
@@ -117,14 +117,19 @@ webapp/install:
@if [ -d ${DESTDIR}/usr/local/etc ]; then rm -rf ${DESTDIR}/usr; fi
.PHONY: install
-install: all
- mkdir -p $(DESTDIR) && cp $(LOCAL_BINDIR)/* $(DESTDIR)
- mkdir -p $(DESTDIR_WWW) && cp -a webapp/dist/* $(DESTDIR_WWW)
+install:
+ @test -e $(LOCAL_BINDIR)/xds-agent$(EXT) || { 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; }
+ export DESTDIR=$(DESTDIR) && export DESTDIR_WWW=$(DESTDIR_WWW) && $(ROOT_SRCDIR)/scripts/install.sh
+
+.PHONY: uninstall
+uninstall:
+ export DESTDIR=$(DESTDIR) && export DESTDIR_WWW=$(DESTDIR_WWW) && $(ROOT_SRCDIR)/scripts/install.sh uninstall
package: clean tools/syncthing vendor build
- @mkdir -p $(PACKAGE_DIR)/xds-agent
- @cp agent-config.json.in $(PACKAGE_DIR)/xds-agent/agent-config.json
+ @mkdir -p $(PACKAGE_DIR)/xds-agent $(PACKAGE_DIR)/scripts
@cp -a $(LOCAL_BINDIR)/* $(PACKAGE_DIR)/xds-agent
+ @cp -r $(ROOT_SRCDIR)/conf.d $(ROOT_SRCDIR)/scripts $(PACKAGE_DIR)/xds-agent
cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-agent
.PHONY: package-all
@@ -174,6 +179,7 @@ help:
@echo " build"
@echo " package"
@echo " install"
+ @echo " uninstall"
@echo " clean"
@echo " distclean"
@echo ""