forked from loxilb-io/loxilb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (42 loc) · 1.45 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
.DEFAULT_GOAL := build
bin=loxilb
dock?=loxilb
loxilbid=$(shell docker ps -f name=$(dock) | grep -w $(dock) | cut -d " " -f 1 | grep -iv "CONTAINER")
subsys:
cd loxilb-ebpf && $(MAKE)
subsys-clean:
cd loxilb-ebpf && $(MAKE) clean
build: subsys
@go build -o ${bin} -ldflags="-X 'main.buildInfo=${shell date '+%Y_%m_%d'}-${shell git branch --show-current}'"
clean: subsys-clean
go clean
test:
go test .
check:
go test .
run:
./$(bin)
docker-cp: build
docker cp loxilb $(loxilbid):/root/loxilb-io/loxilb/loxilb
docker cp /opt/loxilb/llb_ebpf_main.o $(loxilbid):/opt/loxilb/llb_ebpf_main.o
docker cp /opt/loxilb/llb_xdp_main.o $(loxilbid):/opt/loxilb/llb_xdp_main.o
docker-cp-ebpf: build
docker cp /opt/loxilb/llb_ebpf_main.o $(loxilbid):/opt/loxilb/llb_ebpf_main.o
docker cp /opt/loxilb/llb_xdp_main.o $(loxilbid):/opt/loxilb/llb_xdp_main.o
docker-rp: build
cp loxilb ./loxilb.rep
cp /opt/loxilb/llb_ebpf_main.o ./llb_ebpf_main.o.rep
cp /opt/loxilb/llb_xdp_main.o ./llb_xdp_main.o.rep
$(MAKE) docker
rm ./llb_ebpf_main.o.rep ./llb_xdp_main.o.rep ./loxilb.rep
docker-rp-ebpf: build
cp /opt/loxilb/llb_ebpf_main.o ./llb_ebpf_main.o.rep
cp /opt/loxilb/llb_xdp_main.o ./llb_xdp_main.o.rep
$(MAKE) docker
rm ./llb_ebpf_main.o.rep ./llb_xdp_main.o.rep
docker:
docker build -t ghcr.io/loxilb-io/loxilb:latest .
docker-arm64:
docker buildx build --platform linux/arm64 -t ghcr.io/loxilb-io/loxilb:latest-arm64 .
lint:
golangci-lint run --enable-all