changeset 192:77d23b5039bb

Merged
author Sascha Wilde <wilde@intevation.de>
date Fri, 20 Jul 2018 17:43:08 +0200
parents 3457a60fb12d (current diff) 01c5794608e0 (diff)
children cf5dcc1761df
files
diffstat 2 files changed, 67 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Fri Jul 20 17:43:08 2018 +0200
@@ -0,0 +1,51 @@
+# Simple Makefile to build all of Gemma
+#
+# Authors: Sascha Wilde <wilde@intevation.de>
+
+basedir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+BUILDBASE := $(basedir).buildbase
+GOPATH := $(BUILDBASE)/go
+GOCACHE := $(BUILDBASE)/gocache
+ENVWARPPER := $(BUILDBASE)/run-with-env.sh
+
+export BUILDBASE
+
+tokenserver-bin := cmd/tokenserver/tokenserver
+3rdpartylibs-stamp := $(BUILDBASE)/3rdpartylibs-build
+
+.PHONY: all 3rdpartylibs tokenserver client clean
+
+all: tokenserver client
+
+$(ENVWARPPER):
+	@echo "Preparing go build environment:"
+	mkdir -p "$(GOCACHE)"
+	mkdir -p "$(GOPATH)/src/gemma.intevation.de"
+	[ -e "$(GOPATH)/src/gemma.intevation.de/gemma" ] || \
+	  ln -s "$(basedir)" "$(GOPATH)/src/gemma.intevation.de/gemma"
+	@echo "Creating wrapper script:"
+	echo '#!/bin/sh' >"$(ENVWARPPER)"
+	echo 'export GOPATH=$(GOPATH)' >>"$(ENVWARPPER)"
+	echo 'export GOCACHE=$(GOCACHE)' >>"$(ENVWARPPER)"
+	echo 'exec "$$@"' >>"$(ENVWARPPER)"
+	chmod +x "$(ENVWARPPER)"
+
+$(3rdpartylibs-stamp): $(ENVWARPPER)
+	"$(ENVWARPPER)" bash ./3rdpartylibs.sh && \
+	touch $@
+
+3rdpartylibs: $(3rdpartylibs-stamp)
+
+$(tokenserver-bin): $(3rdpartylibs-stamp) $(ENVWARPPER)
+	cd cmd/tokenserver && "$(ENVWARPPER)" go build
+
+tokenserver: $(tokenserver-bin)
+
+client:
+	$(MAKE) -f Makefile.build -C client
+
+clean:
+	$(MAKE) -f Makefile.build -C client $@
+	rm "$(tokenserver-bin)"
+	rm -rf "$(BUILDBASE)"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/Makefile.build	Fri Jul 20 17:43:08 2018 +0200
@@ -0,0 +1,16 @@
+#-*-makefile-*-
+# Authors: Sascha Wilde <wilde@intevation.de>
+
+.PHONY: all dependencies clean
+
+all:	dependencies .env
+	yarn build
+
+dependencies:
+	yarn install
+
+.env:
+	cp .env.sample $@
+
+clean:
+	rm -rf ../web