Mercurial > gemma
annotate Makefile @ 4087:1562a5fb36dc
Handle Nash-Sutcliff more tolerant for NaN/Inf values.
Due to limitation of JSON we encode these values as 0 and +/- MaxFloat64.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 25 Jul 2019 17:15:00 +0200 |
parents | 77202406b1a7 |
children | f7a32b0b9235 |
rev | line source |
---|---|
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 # Simple Makefile to build all of Gemma |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 # |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
3 # Authors: Sascha Wilde <wilde@intevation.de> |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
4 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
5 basedir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
6 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
7 BUILDBASE := $(basedir).buildbase |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
8 GOPATH := $(BUILDBASE)/go |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
9 GOCACHE := $(BUILDBASE)/gocache |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 ENVWARPPER := $(BUILDBASE)/run-with-env.sh |
402
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
11 BINDIR := /usr/local/bin |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
13 export BUILDBASE |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
14 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
15 3rdpartylibs-stamp := $(BUILDBASE)/3rdpartylibs-build |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 |
1014
77202406b1a7
reverted demo build target, include revision number based on version tag
Markus Kottlaender <markus@intevation.de>
parents:
1008
diff
changeset
|
17 .PHONY: all 3rdpartylibs gemma client clean |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
18 |
206
cd6ad5eaef8d
Renamed cmd/tokenserver to cmd/gemma.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
191
diff
changeset
|
19 all: gemma client |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
20 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
21 $(ENVWARPPER): |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
22 @echo "Preparing go build environment:" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
23 mkdir -p "$(GOCACHE)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
24 mkdir -p "$(GOPATH)/src/gemma.intevation.de" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
25 [ -e "$(GOPATH)/src/gemma.intevation.de/gemma" ] || \ |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
26 ln -s "$(basedir)" "$(GOPATH)/src/gemma.intevation.de/gemma" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
27 @echo "Creating wrapper script:" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
28 echo '#!/bin/sh' >"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
29 echo 'export GOPATH=$(GOPATH)' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
30 echo 'export GOCACHE=$(GOCACHE)' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
31 echo 'exec "$$@"' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
32 chmod +x "$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
33 |
303
75e32633fb96
Makefile: Force rebuild of dependencies when 3rdpartylibs.sh changes.
Sascha Wilde <wilde@intevation.de>
parents:
217
diff
changeset
|
34 $(3rdpartylibs-stamp): $(ENVWARPPER) 3rdpartylibs.sh |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
35 "$(ENVWARPPER)" bash ./3rdpartylibs.sh && \ |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
36 touch $@ |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
37 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
38 3rdpartylibs: $(3rdpartylibs-stamp) |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
39 |
217
3fdbdd59ef80
Makefile: Make rebuild of gemma work
Sascha Wilde <wilde@intevation.de>
parents:
214
diff
changeset
|
40 gemma: $(3rdpartylibs-stamp) $(ENVWARPPER) |
206
cd6ad5eaef8d
Renamed cmd/tokenserver to cmd/gemma.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
191
diff
changeset
|
41 cd cmd/gemma && "$(ENVWARPPER)" go build |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
42 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
43 client: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
44 $(MAKE) -f Makefile.build -C client |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
45 |
402
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
46 install: gemma |
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
47 cp cmd/gemma/gemma $(BINDIR) |
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
48 |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
49 tar: all |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
50 v="gemma-$$(hg id -i)" ;\ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
51 tar --transform "s@^@$${v}/@" \ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
52 -cJf "../$${v}.tar.xz" \ |
547
9b67c4f5a7b2
Added example_conf.toml to packaging.
Sascha Wilde <wilde@intevation.de>
parents:
537
diff
changeset
|
53 cmd/gemma/gemma schema web example_conf.toml |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
54 |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
55 clean: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
56 $(MAKE) -f Makefile.build -C client $@ |
214
da24df80c25d
Fix Makefile clean target: don't fail if no back end bin to delete.
Sascha Wilde <wilde@intevation.de>
parents:
206
diff
changeset
|
57 rm -f "$(gemma-bin)" |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
58 rm -rf "$(BUILDBASE)" |