aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 16:47:22 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 23:19:43 +0200
commit4f8e078afa1e8152789bf8009bcf6f794bda18cc (patch)
tree55ad6e453ead37c33643d2eadba5eacf21b1755f /Makefile
parent1db7b797aef7501d9f7d52d1f9d7d90d80f9f886 (diff)
Update Makefile to be smarter with syncthing compilation.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 12 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 19fe4a4..3bcf34e 100644
--- a/Makefile
+++ b/Makefile
@@ -44,12 +44,12 @@ VERBOSE_1 := -v
VERBOSE_2 := -v -x
-all: build tools/syncthing
+all: tools/syncthing build
.PHONY: build
build: xds webapp
-xds:vendor scripts
+xds:vendor scripts tools/syncthing/copytobin
@echo "### Build XDS server (version $(VERSION), subversion $(SUB_VERSION))";
@cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/xds-server -ldflags "-X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" .
@@ -62,10 +62,10 @@ vet: tools/glide
fmt: tools/glide
go fmt $(shell $(LOCAL_TOOLSDIR)/glide novendor)
-run: build/xds tools/syncthing
+run: build/xds tools/syncthing/copytobin
$(LOCAL_BINDIR)/xds-server --log info -c config.json.in
-debug: build/xds webapp/debug tools/syncthing
+debug: build/xds webapp/debug tools/syncthing/copytobin
$(LOCAL_BINDIR)/xds-server --log debug -c config.json.in
.PHONY: clean
@@ -91,12 +91,11 @@ scripts:
.PHONY: install
install:
- @test -e $(LOCAL_BINDIR)/xds-server -a -d webapp/dist || { echo "Please execute first: make build\n"; exit 1; }
- @test -e $(LOCAL_BINDIR)/xds-start-server.sh -a -d $(LOCAL_BINDIR)/agl || { echo "Please execute first: scripts\n"; exit 1; }
- @test -e $(LOCAL_TOOLSDIR)/syncthing -a -e $(LOCAL_TOOLSDIR)/syncthing-inotify || { echo "Please execute first: make tools/syncthing\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/xds-server -a -d webapp/dist || { echo "Please execute first: make all\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/xds-start-server.sh -a -d $(LOCAL_BINDIR)/agl || { echo "Please execute first: make all\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/syncthing -a -e $(LOCAL_BINDIR)/syncthing-inotify || { echo "Please execute first: make all\n"; exit 1; }
mkdir -p $(INSTALL_DIR) \
&& cp -a $(LOCAL_BINDIR)/* $(INSTALL_DIR) \
- && cp $(LOCAL_TOOLSDIR)/syncthing* $(INSTALL_DIR)
mkdir -p $(INSTALL_WEBAPP_DIR) \
&& cp -a webapp/dist/* $(INSTALL_WEBAPP_DIR)
@@ -116,6 +115,11 @@ tools/syncthing:
SYNCTHING_INOTIFY_VERSION=$(SYNCTHING_INOTIFY_VERSION) \
./scripts/get-syncthing.sh; }
+.PHONY:
+tools/syncthing/copytobin:
+ @test -e $(LOCAL_TOOLSDIR)/syncthing -a -e $(LOCAL_TOOLSDIR)/syncthing-inotify || { echo "Please execute first: make tools/syncthing\n"; exit 1; }
+ @cp -f $(LOCAL_TOOLSDIR)/syncthing* $(LOCAL_BINDIR)
+
.PHONY: help
help:
@echo "Main supported rules:"