-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (40 loc) · 966 Bytes
/
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
PHONY: all build_only gen precommit
ifndef MAGMA_ROOT
MAGMA_ROOT = /home/$USER/magma
endif
export MAGMA_ROOT
ifndef BUILD_OUT
BUILD_OUT := $(shell go env GOBIN)
ifdef GOOS
BUILD_OUT := $(BUILD_OUT)/$(GOOS)
endif
ifdef GOARCH
BUILD_OUT := $(BUILD_OUT)/$(GOARCH)
endif
endif
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
all: test install
build: install
download:
go mod download
install:
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -o $(MAGMA_ROOT)/libn4_pfcp.so -buildmode=c-shared client/client.go
sudo mv $(MAGMA_ROOT)/libn4_pfcp.so /usr/local/lib/
sudo mv $(MAGMA_ROOT)/libn4_pfcp.h /usr/local/include/
test:
go test ./...
clean:
go clean ./...
gen:
go generate ./...
lint:
golint -min_confidence 1. ./...
build_only:
go build ./...
precommit: build_only test
cover:
go test ./... -coverprofile ./cover.tmp >/dev/null
go tool cover -func=./cover.tmp | tail -n 1
find . -name '*.go' | xargs wc -l | tail -n 1
rm ./cover.tmp