X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=Makefile;h=916b13365224e8fcb19e01cf8f03d6b369016af2;hb=6aa0d4b8cdda11c7ee218f0f3cc1013dd18ab056;hp=948bad2ddb39d39dd0ba8d96b0fcbd92817caab9;hpb=06adae2e6dbded3c94651a8f4e2d1a949a9c6766;p=src%2Fxds%2Fxds-server.git diff --git a/Makefile b/Makefile index 948bad2..916b133 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,7 @@ VERSION := 0.1.0 # Syncthing version to install SYNCTHING_VERSION = 0.14.28 -# FIXME: use master while waiting a release that include #164 -#SYNCTHING_INOTIFY_VERSION = 0.8.5 -SYNCTHING_INOTIFY_VERSION=master +SYNCTHING_INOTIFY_VERSION = 0.8.6 # Retrieve git tag/commit to set sub-version string @@ -54,7 +52,7 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) ROOT_SRCDIR := $(patsubst %/,%,$(dir $(mkfile_path))) ROOT_GOPRJ := $(abspath $(ROOT_SRCDIR)/../../../..) LOCAL_BINDIR := $(ROOT_SRCDIR)/bin -LOCAL_TOOLSDIR := $(ROOT_SRCDIR)/tools +LOCAL_TOOLSDIR := $(ROOT_SRCDIR)/tools/${HOST_GOOS} PACKAGE_DIR := $(ROOT_SRCDIR)/package @@ -84,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)" . @@ -111,7 +109,7 @@ clean: .PHONY: distclean distclean: clean - rm -rf $(LOCAL_BINDIR) $(LOCAL_TOOLSDIR) glide.lock vendor webapp/node_modules webapp/dist + rm -rf $(LOCAL_BINDIR) $(ROOT_SRCDIR)/tools glide.lock vendor webapp/node_modules webapp/dist webapp: webapp/install (cd webapp && gulp build) @@ -121,6 +119,7 @@ webapp/debug: webapp/install: (cd webapp && npm install) + @if [ -d ${DESTDIR}/usr/local/etc ]; then rm -rf ${DESTDIR}/usr; fi .PHONY: scripts scripts: @@ -131,7 +130,7 @@ conffile: cat config.json.in \ | sed -e s,"webapp/dist","$(DESTDIR_WWW)",g \ | sed -e s,"\./bin","",g \ - > $(PACKAGE_DIR)/xds-server/config.json + > $(DESTDIR)/config.json .PHONY: install install: @@ -145,8 +144,8 @@ install: .PHONY: package package: clean - DESTDIR=$(PACKAGE_DIR)/xds-server make -f $(ROOT_SRCDIR)/Makefile all install - DESTDIR=$(PACKAGE_DIR)/xds-server DESTDIR_WWW=www-xds-server make -f $(ROOT_SRCDIR)/Makefile conffile + 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-xds-server (cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-server) .PHONY: package-all @@ -159,10 +158,13 @@ package-all: vendor: tools/glide glide.yaml $(LOCAL_TOOLSDIR)/glide install --strip-vendor +.PHONY: tools/glide tools/glide: - @echo "Downloading glide" - mkdir -p $(LOCAL_TOOLSDIR) - curl --silent -L https://glide.sh/get | GOBIN=$(LOCAL_TOOLSDIR) sh + @test -f $(LOCAL_TOOLSDIR)/glide || { \ + echo "Downloading glide"; \ + mkdir -p $(LOCAL_TOOLSDIR); \ + curl --silent -L https://glide.sh/get | GOBIN=$(LOCAL_TOOLSDIR) sh; \ + } .PHONY: tools/syncthing tools/syncthing: