Fixed webapp build and error message.
[src/xds/xds-agent.git] / Makefile
index db4d874..3f4457c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,19 @@
-# Makefile used to build XDS daemon Web Server
-
-# Application Version
-VERSION := 0.2.0
+# Makefile used to build XDS Agent
 
 # Syncthing version to install
 SYNCTHING_VERSION = 0.14.38
 SYNCTHING_INOTIFY_VERSION = 0.8.7
 
 
-# Retrieve git tag/commit to set sub-version string
-ifeq ($(origin SUB_VERSION), undefined)
-       SUB_VERSION := $(shell git describe --exact-match --tags 2>/dev/null | sed 's/^v//')
-       ifneq ($(SUB_VERSION), )
-               VERSION := $(firstword $(subst -, ,$(SUB_VERSION)))
-               SUB_VERSION := $(word 2,$(subst -, ,$(SUB_VERSION)))
-       endif
-       ifeq ($(SUB_VERSION), )
-               SUB_VERSION := $(shell git rev-parse --short HEAD)
-               ifeq ($(SUB_VERSION), )
-                       SUB_VERSION := unknown-dev
-               endif
-       endif
+# Retrieve git tag/commit to set version & sub-version strings
+GIT_DESC := $(shell git describe --always --tags)
+VERSION := $(firstword $(subst -, ,$(GIT_DESC)))
+SUB_VERSION := $(subst $(VERSION)-,,$(GIT_DESC))
+ifeq ($(VERSION), )
+       VERSION := unknown-dev
+endif
+ifeq ($(SUB_VERSION), )
+       SUB_VERSION := $(shell date +'%Y-%m-%d_%H%M%S')
 endif
 
 # Configurable variables for installation (default /opt/AGL/...)
@@ -107,10 +100,10 @@ distclean: clean
        cd $(ROOT_SRCDIR) && rm -rf $(LOCAL_BINDIR) ./tools ./glide.lock ./vendor ./*.zip ./webapp/node_modules ./webapp/dist
 
 webapp: webapp/install
-       (cd webapp && gulp build)
+       (cd webapp && npm run build)
 
 webapp/debug:
-       (cd webapp && gulp watch &)
+       (cd webapp && npm run watch)
 
 webapp/install:
        (cd webapp && npm install)