Only call vendor when building all.
[src/xds/xds-server.git] / Makefile
index c13e1e5..916b133 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -82,9 +82,9 @@ endif
 all: tools/syncthing build
 
 .PHONY: build
-build: xds webapp
+build: vendor xds webapp
 
-xds:vendor scripts tools/syncthing/copytobin
+xds: 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$(EXT) -ldflags "$(GORELEASE) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" .
 
@@ -119,7 +119,7 @@ webapp/debug:
 
 webapp/install:
        (cd webapp && npm install)
-       @test -d ${DESTDIR}/usr/local/etc && rm -rf ${DESTDIR}/usr
+       @if [ -d ${DESTDIR}/usr/local/etc ]; then rm -rf ${DESTDIR}/usr; fi
 
 .PHONY: scripts
 scripts: