summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 21:43:37 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 22:38:14 +0100
commit0f2773364006751bb5a59cf53caea3b62146cc8d (patch)
treee7e0c1858ddbb861a6a82a9f3a996ab6af3cb5ef /Makefile
parentfce0932dba3ca1b2c436400774821ef14fe32fe5 (diff)
Fixed webapp build in production mode
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 99eee7c..e84775a 100644
--- a/Makefile
+++ b/Makefile
@@ -61,11 +61,13 @@ ifeq ($(filter 1,$(RELEASE) $(REL)),)
# disable compiler optimizations and inlining
GO_GCFLAGS=-N -l
BUILD_MODE="Debug mode"
+ WEBAPP_BUILD_RULE=build
else
# optimized code without debug info
GO_LDFLAGS=-s -w
GO_GCFLAGS=
BUILD_MODE="Release mode"
+ WEBAPP_BUILD_RULE=build:prod
endif
ifeq ($(SUB_VERSION), )
@@ -108,10 +110,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 && npm run build)
+ cd webapp && npm run $(WEBAPP_BUILD_RULE)
webapp/debug:
- (cd webapp && npm run watch)
+ cd webapp && npm run watch
webapp/install:
(cd webapp && npm install)
@@ -128,10 +130,12 @@ 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 $(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
+ @mkdir -p $(PACKAGE_DIR)/xds-agent/www $(PACKAGE_DIR)/scripts
+ @cp -a $(LOCAL_BINDIR)/* $(PACKAGE_DIR)/xds-agent/
+ @cp -a webapp/dist/* $(PACKAGE_DIR)/xds-agent/www/
+ @cp -r $(ROOT_SRCDIR)/conf.d $(ROOT_SRCDIR)/scripts $(PACKAGE_DIR)/xds-agent/
+ @cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-agent
+ @echo "### Package $(PACKAGE_ZIPFILE) has been successfuly built - $(BUILD_MODE)"
.PHONY: package-all
package-all: