-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 702 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 702 Bytes
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
NAME := xdp-etherip
#brunch name version
VERSION := $(shell git rev-parse --abbrev-ref HEAD)
PKG_NAME=$(shell basename `pwd`)
LDFLAGS := -ldflags="-s -w -X \"github.com/x86taka/xdp-etherip/pkg/version.Version=$(VERSION)\" -extldflags \"-static\""
SRCS := $(shell find . -type f -name '*.go')
.DEFAULT_GOAL := build
build: $(SRCS) gen
go build $(LDFLAGS) -o ./bin/$(NAME) ./cmd/$(NAME)
.PHONY: run
run:
go run $(LDFLAGS) ./cmd/$(NAME)
.PHONY: gen
gen:
go generate pkg/coreelf/elf.go
.PHONY: clean
clean:
rm -rf ./bin/$(NAME)
.PHONY: test
test:
go test -v -exec sudo -race ./pkg/...
.PHONY: fmt
fmt:
go fmt ./...
find . -iname *.h -o -iname *.c | xargs clang-format -i -style=Google