view Makefile @ 4017:639bdb17c3f2

Fixed offset for fairway box This was broken by changeset: 4080:bf86f9a08733 user: Thomas Junk <thomas.junk@intevation.de> Date: Thu Jul 18 15:04:30 2019 +0200 summary: improve fairwaydiagram printing positioning For the record: I think the current implementation exceptionally flawed. Instead of adding extra offset parameters to the diagram elements the whole building block with all contained elements should be translated in one step, that would be less cluttered and less error prone...
author Sascha Wilde <wilde@intevation.de>
date Fri, 19 Jul 2019 16:59:25 +0200
parents 77202406b1a7
children f7a32b0b9235
line wrap: on
line source

# 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
BINDIR := /usr/local/bin

export BUILDBASE

3rdpartylibs-stamp := $(BUILDBASE)/3rdpartylibs-build

.PHONY: all 3rdpartylibs gemma client clean

all: gemma 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) 3rdpartylibs.sh
	"$(ENVWARPPER)" bash ./3rdpartylibs.sh && \
	touch $@

3rdpartylibs: $(3rdpartylibs-stamp)

gemma: $(3rdpartylibs-stamp) $(ENVWARPPER)
	cd cmd/gemma && "$(ENVWARPPER)" go build

client:
	$(MAKE) -f Makefile.build -C client

install: gemma
	cp cmd/gemma/gemma $(BINDIR)

tar: all
	v="gemma-$$(hg id -i)" ;\
        tar --transform "s@^@$${v}/@" \
	    -cJf "../$${v}.tar.xz" \
	    cmd/gemma/gemma schema web example_conf.toml

clean:
	$(MAKE) -f Makefile.build -C client $@
	rm -f "$(gemma-bin)"
	rm -rf "$(BUILDBASE)"