Mercurial > gemma
annotate Makefile @ 4545:e7970d84cb4f iso-areas
Stitch together arcs on cuts.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 27 Sep 2019 17:13:29 +0200 |
parents | 707450608829 |
children | a82d75a1b497 |
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 |
4464
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
15 .PHONY: all gemma client clean |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 |
206
cd6ad5eaef8d
Renamed cmd/tokenserver to cmd/gemma.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
191
diff
changeset
|
17 all: gemma client |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
18 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
19 $(ENVWARPPER): |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
20 @echo "Preparing go build environment:" |
4464
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
21 mkdir -p "$(GOPATH)" |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
22 mkdir -p "$(GOCACHE)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
23 @echo "Creating wrapper script:" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
24 echo '#!/bin/sh' >"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
25 echo 'export GOPATH=$(GOPATH)' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
26 echo 'export GOCACHE=$(GOCACHE)' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
27 echo 'exec "$$@"' >>"$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
28 chmod +x "$(ENVWARPPER)" |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
29 |
4464
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
30 gemma: $(ENVWARPPER) |
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
31 "$(ENVWARPPER)" go build -o ./cmd/gemma/gemma ./cmd/gemma |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
32 |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
33 client: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
34 $(MAKE) -f Makefile.build -C client |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
35 |
402
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
36 install: gemma |
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
37 cp cmd/gemma/gemma $(BINDIR) |
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
38 |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
39 tar: all |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
40 v="gemma-$$(hg id -i)" ;\ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
41 tar --transform "s@^@$${v}/@" \ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
42 -cJf "../$${v}.tar.xz" \ |
4397
f7a32b0b9235
Added example systemd service file.
Sascha Wilde <wilde@intevation.de>
parents:
1014
diff
changeset
|
43 cmd/gemma/gemma schema web misc example_conf.toml |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
44 |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
45 clean: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
46 $(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
|
47 rm -f "$(gemma-bin)" |
4464
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
48 chmod -R u+w "$(BUILDBASE)" # This is neccessary for deletion to work... |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
49 rm -rf "$(BUILDBASE)" |