Mercurial > gemma
annotate Makefile @ 5560:f2204f91d286
Join the log lines of imports to the log exports to recover data from them.
Used in SR export to extract information that where in the meta json
but now are only found in the log.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 09 Feb 2022 18:34:40 +0100 |
parents | 02c2d0edeb2a |
children | 5049f7ad9faa |
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 |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
15 .PHONY: all gemma gmaggregate client clean |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
17 all: gemma gmaggregate 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 |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
33 gmaggregate: $(ENVWARPPER) |
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
34 cd ./contrib/gmaggregate; "$(ENVWARPPER)" go build |
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
35 |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
36 client: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
37 $(MAKE) -f Makefile.build -C client |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
38 |
402
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
39 install: gemma |
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
40 cp cmd/gemma/gemma $(BINDIR) |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
41 cp contrib/gmaggregate/gmaggregate $(BINDIR) |
402
20d2edbc863d
Add install target for backend and use in Dockerfile
Tom Gottfried <tom@intevation.de>
parents:
303
diff
changeset
|
42 |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
43 tar: all |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
44 v="gemma-$$(hg id -i)" ;\ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
45 tar --transform "s@^@$${v}/@" \ |
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
46 -cJf "../$${v}.tar.xz" \ |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
47 cmd/gemma/gemma \ |
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
48 contrib/gmaggregate/gmaggregate \ |
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
49 schema style-templates report-templates \ |
4664
7d2463c7b4ad
Added cmd/oct2str/oct2str to Makefile.
Sascha Wilde <wilde@intevation.de>
parents:
4494
diff
changeset
|
50 web misc example_conf.toml |
537
942a865986f6
Added simple build target for deployment tar.
Sascha Wilde <wilde@intevation.de>
parents:
402
diff
changeset
|
51 |
191
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
52 clean: |
01c5794608e0
Added simple makefiles to build back end and client.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
53 $(MAKE) -f Makefile.build -C client $@ |
5548
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
54 rm -f contrib/gmaggregate/gmaggregate |
02c2d0edeb2a
Added gmaggregate tool as contrib.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5400
diff
changeset
|
55 rm -f cmd/gemma/gemma |
4464
707450608829
Get rid of (ugly) 3rdpartylibs.sh script. Use go modules.
Sascha Wilde <wilde@intevation.de>
parents:
4397
diff
changeset
|
56 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
|
57 rm -rf "$(BUILDBASE)" |