view Makefile @ 196:b67208d82543

Make test output more comprehensive Running all tests in one transaction ensures the final output tells about any failing test, not just in the last transaction (i.e. test script). The price is that no traces of the tests are left in the database because we have to rollback in order to have no left-over test roles in the cluster.
author Tom Gottfried <tom@intevation.de>
date Fri, 20 Jul 2018 18:31:45 +0200
parents 01c5794608e0
children cd6ad5eaef8d
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

export BUILDBASE

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

.PHONY: all 3rdpartylibs tokenserver client clean

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

3rdpartylibs: $(3rdpartylibs-stamp)

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

tokenserver: $(tokenserver-bin)

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

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