-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
48 lines (42 loc) · 1.09 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
IBM_DB_HOME := ${GOPATH}/src/github.com/ibmdb/clidriver
ifdef DB2_HOME
IBM_DB_HOME=${DB2_HOME}
else
export LD_LIBRARY_PATH=${IBM_DB_HOME}/lib
endif
export GO15VENDOREXPERIMENT=1
export GO111MODULE=on
export CGO_CFLAGS=-I${IBM_DB_HOME}/include
export CGO_LDFLAGS=-L${IBM_DB_HOME}/lib
.PHONY: all
all: lint release test
.PHONY: dependencies
dependencies:
@echo "Installing db2 lib..."
git clone -b v0.4.5 --depth=1 https://github.com/ibmdb/go_ibm_db $(go env GOPATH)/src/github.com/ibmdb/go_ibm_db
cd $(go env GOPATH)/src/github.com/ibmdb/go_ibm_db/installer && go run setup.go
@echo "Installing test dependencies..."
go mod tidy
.PHONY: lint
lint:
@rm -rf lint.log
@echo "Checking format..."
@find . -name '*.go' | xargs gofmt -w -s
@echo "Checking vet..."
@go vet ./... 2>&1 | tee -a lint.log
@echo "Checking license..."
@go run tools/license/main.go -c
.PHONY: test
test:
@go test ./...
.PHONY: cover
cover:
@sh cover.sh
.PHONY: release
release:
@go generate ./...
@cd cmd/datax && go build -ldflags="-s -w" && cd ../..
@go run tools/datax/release/main.go
.PHONY: doc
doc:
@godoc -http=:6080