| 1 |
# cgocheck=0 is a workaround for lp:1555198 |
| 2 |
GOTEST := GODEBUG=cgocheck=0 ./scripts/goctest |
| 3 |
|
| 4 |
TOTEST = $(shell env GOPATH=$(GOPATH) go list ./...|grep -v acceptance ) |
| 5 |
|
| 6 |
all: build-client build-server |
| 7 |
|
| 8 |
check: |
| 9 |
$(GOTEST) $(TESTFLAGS) $(TOTEST) |
| 10 |
|
| 11 |
check-race: |
| 12 |
$(GOTEST) $(TESTFLAGS) -race $(TOTEST) |
| 13 |
|
| 14 |
acceptance: |
| 15 |
cd server/acceptance && ./acceptance.sh |
| 16 |
|
| 17 |
build-client: lomiri-push-service exec-tool |
| 18 |
|
| 19 |
exec-tool: |
| 20 |
$(MAKE) -C exec-tool exec-tool |
| 21 |
|
| 22 |
lomiri-push-service: |
| 23 |
go build ./cmd/$@ |
| 24 |
|
| 25 |
build-server: lomiri-push-server |
| 26 |
|
| 27 |
run-server-dev: lomiri-push-server |
| 28 |
./$< sampleconfigs/dev.json |
| 29 |
|
| 30 |
lomiri-push-server: |
| 31 |
go build ./cmd/$@ |
| 32 |
|
| 33 |
# very basic cleanup stuff; needs more work |
| 34 |
clean: |
| 35 |
$(RM) \ |
| 36 |
lomiri-push-service \ |
| 37 |
lomiri-push-server \ |
| 38 |
exec-tool |
| 39 |
|
| 40 |
distclean: |
| 41 |
git clean -f -x -d |
| 42 |
|
| 43 |
coverage-summary: |
| 44 |
$(GOTEST) $(TESTFLAGS) -a -cover $(TOTEST) |
| 45 |
|
| 46 |
coverage-html: |
| 47 |
mkdir -p coverhtml |
| 48 |
for pkg in $(TOTEST); do \ |
| 49 |
relname="$${pkg#$(PROJECT)/}" ; \ |
| 50 |
mkdir -p coverhtml/$$(dirname $${relname}) ; \ |
| 51 |
$(GOTEST) $(TESTFLAGS) -a -coverprofile=coverhtml/$${relname}.out $$pkg ; \ |
| 52 |
if [ -f coverhtml/$${relname}.out ] ; then \ |
| 53 |
go tool cover -html=coverhtml/$${relname}.out -o coverhtml/$${relname}.html ; \ |
| 54 |
go tool cover -func=coverhtml/$${relname}.out -o coverhtml/$${relname}.txt ; \ |
| 55 |
fi \ |
| 56 |
done |
| 57 |
|
| 58 |
format: |
| 59 |
go fmt ./... |
| 60 |
|
| 61 |
check-format: |
| 62 |
scripts/check_fmt ./... |
| 63 |
|
| 64 |
protocol-diagrams: protocol/state-diag-client.svg protocol/state-diag-session.svg |
| 65 |
%.svg: %.gv |
| 66 |
# requires graphviz installed |
| 67 |
dot -Tsvg $< > $@ |
| 68 |
|
| 69 |
.PHONY: acceptance all build-client build-server check check-format check-race clean coverage-html coverage-summary distclean exec-tool format lomiri-push-server lomiri-push-service protocol-diagrams run-server-dev |