Mercurial > gemma
comparison Makefile @ 191:01c5794608e0
Added simple makefiles to build back end and client.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 20 Jul 2018 17:41:44 +0200 |
parents | |
children | cd6ad5eaef8d |
comparison
equal
deleted
inserted
replaced
189:96bb671cdd98 | 191:01c5794608e0 |
---|---|
1 # Simple Makefile to build all of Gemma | |
2 # | |
3 # Authors: Sascha Wilde <wilde@intevation.de> | |
4 | |
5 basedir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) | |
6 | |
7 BUILDBASE := $(basedir).buildbase | |
8 GOPATH := $(BUILDBASE)/go | |
9 GOCACHE := $(BUILDBASE)/gocache | |
10 ENVWARPPER := $(BUILDBASE)/run-with-env.sh | |
11 | |
12 export BUILDBASE | |
13 | |
14 tokenserver-bin := cmd/tokenserver/tokenserver | |
15 3rdpartylibs-stamp := $(BUILDBASE)/3rdpartylibs-build | |
16 | |
17 .PHONY: all 3rdpartylibs tokenserver client clean | |
18 | |
19 all: tokenserver client | |
20 | |
21 $(ENVWARPPER): | |
22 @echo "Preparing go build environment:" | |
23 mkdir -p "$(GOCACHE)" | |
24 mkdir -p "$(GOPATH)/src/gemma.intevation.de" | |
25 [ -e "$(GOPATH)/src/gemma.intevation.de/gemma" ] || \ | |
26 ln -s "$(basedir)" "$(GOPATH)/src/gemma.intevation.de/gemma" | |
27 @echo "Creating wrapper script:" | |
28 echo '#!/bin/sh' >"$(ENVWARPPER)" | |
29 echo 'export GOPATH=$(GOPATH)' >>"$(ENVWARPPER)" | |
30 echo 'export GOCACHE=$(GOCACHE)' >>"$(ENVWARPPER)" | |
31 echo 'exec "$$@"' >>"$(ENVWARPPER)" | |
32 chmod +x "$(ENVWARPPER)" | |
33 | |
34 $(3rdpartylibs-stamp): $(ENVWARPPER) | |
35 "$(ENVWARPPER)" bash ./3rdpartylibs.sh && \ | |
36 touch $@ | |
37 | |
38 3rdpartylibs: $(3rdpartylibs-stamp) | |
39 | |
40 $(tokenserver-bin): $(3rdpartylibs-stamp) $(ENVWARPPER) | |
41 cd cmd/tokenserver && "$(ENVWARPPER)" go build | |
42 | |
43 tokenserver: $(tokenserver-bin) | |
44 | |
45 client: | |
46 $(MAKE) -f Makefile.build -C client | |
47 | |
48 clean: | |
49 $(MAKE) -f Makefile.build -C client $@ | |
50 rm "$(tokenserver-bin)" | |
51 rm -rf "$(BUILDBASE)" |