forked from quickfixgo/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (60 loc) · 2.16 KB
/
Makefile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
GOBIN = $(shell go env GOBIN)
ifeq ($(GOBIN),)
GOBIN = $(shell go env GOPATH)/bin
endif
GOX = $(GOBIN)/gox
GOIMPORTS = $(GOBIN)/goimports
ARCH = $(shell uname -p)
# ------------------------------------------------------------------------------
# dependencies
# If go install is run from inside the project directory it will add the
# dependencies to the go.mod file. To avoid that we change to a directory
# without a go.mod file when downloading the following dependencies
$(GOX):
(cd /; GO111MODULE=on go install github.com/mitchellh/gox@latest)
$(GOIMPORTS):
(cd /; GO111MODULE=on go install golang.org/x/tools/cmd/goimports@latest)
# ------------------------------------------------------------------------------
all: vet test
clean:
rm -rf gen
generate: clean
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml
go get -u all
generate-dist:
cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml
test-style:
GO111MODULE=on golangci-lint run
.PHONY: format
format: $(GOIMPORTS)
GO111MODULE=on go list -f '{{.Dir}}' ./... | xargs $(GOIMPORTS) -w -local github.com/quickfixgo/quickfix
fmt:
go fmt `go list ./... | grep -v quickfix/gen`
vet:
go vet `go list ./... | grep -v quickfix/gen`
test:
MONGODB_TEST_CXN=localhost go test -v -cover . ./datadictionary ./internal
_build_all:
go build -v `go list ./...`
build_accept:
cd _test; go build -o echo_server
build: _build_all build_accept
fix40:
cd _test; ./runat.sh $@.cfg 5001 "definitions/server/$@/*.def"
fix41:
cd _test; ./runat.sh $@.cfg 5002 "definitions/server/$@/*.def"
fix42:
cd _test; ./runat.sh $@.cfg 5003 "definitions/server/$@/*.def"
fix43:
cd _test; ./runat.sh $@.cfg 5004 "definitions/server/$@/*.def"
fix44:
cd _test; ./runat.sh $@.cfg 5005 "definitions/server/$@/*.def"
fix50:
cd _test; ./runat.sh $@.cfg 5006 "definitions/server/$@/*.def"
fix50sp1:
cd _test; ./runat.sh $@.cfg 5007 "definitions/server/$@/*.def"
fix50sp2:
cd _test; ./runat.sh $@.cfg 5008 "definitions/server/$@/*.def"
ACCEPT_SUITE=fix40 fix41 fix42 fix43 fix44 fix50 fix50sp1 fix50sp2
accept: $(ACCEPT_SUITE)
.PHONY: test $(ACCEPT_SUITE)