aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-20 14:30:33 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-20 14:36:43 +0200
commit2d90eac319979dba64371258b30e61e77a15db7d (patch)
tree3b89b5efcf4b4476852a9944a12d5c9a6e3502fd /Makefile
parent77ab312b87324090ec6cb619d11f792b53fdddbd (diff)
parent7843cfd903cf7770df81c91193068900fb563e59 (diff)
Merge branch 'master' into wipv0.3.0-rc1
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
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 ""