forked from shisa-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (41 loc) · 1.46 KB
/
Makefile
File metadata and controls
60 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- mode: Makefile-gmake -*-
SHELL := bash
TOP_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
DIAGRAM_DIR := doc/diagram
DIAGRAMS := $(DIAGRAM_DIR)/architecture.png
BUILD_DIR := build
COVERAGE_DIR := $(BUILD_DIR)/coverage
SHISA_PKGS := $(shell go list ./... | grep -Ev 'examples|test')
SHISA_TEST_PKGS := $(addprefix coverage/,$(SHISA_PKGS))
all: test
doc/diagram/%.png: doc/%.dot
@mkdir -p $(DIAGRAM_DIR)
dot -Tpng $< > $@
doc: $(DIAGRAMS)
$(BUILD_DIR):
@mkdir -p $@
$(COVERAGE_DIR):
@mkdir -p $@
clean:
rm -rf $(BUILD_DIR)
fmt:
go fmt ./...
vet:
go vet ./...
gen:
find . -name '*_charlatan.go' | xargs rm
go generate ./...
test: ${COVERAGE_DIR} ${SHISA_TEST_PKGS}
examples:
go build -o $(TOP_DIR)/$(BUILD_DIR)/rest github.com/percolate/shisa/examples/rest
go build -o $(TOP_DIR)/$(BUILD_DIR)/rpc github.com/percolate/shisa/examples/rpc
go build -o $(TOP_DIR)/$(BUILD_DIR)/idp github.com/percolate/shisa/examples/idp
go build -o $(TOP_DIR)/$(BUILD_DIR)/gw github.com/percolate/shisa/examples/gw
docker:
docker build --tag shisa/examples/gw -f examples/gw/Dockerfile .
docker build --tag shisa/examples/idp -f examples/idp/Dockerfile .
docker build --tag shisa/examples/rest -f examples/rest/Dockerfile .
docker build --tag shisa/examples/rpc -f examples/rpc/Dockerfile .
coverage/%:
go test -v -coverprofile=$(TOP_DIR)/$(COVERAGE_DIR)/$(@F)_coverage.out -covermode=atomic github.com/percolate/shisa/$(@F)
.PHONY: clean doc vet fmt test examples docker