forked from kmesh-net/kmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (51 loc) · 2.04 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
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
# MeshAccelerating is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Author: LemmyHuang
# Create: 2021-12-08
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include ./mk/bpf.vars.mk
include ./mk/bpf.print.mk
# compiler flags
GOFLAGS := $(EXTRA_GOFLAGS)
# target
APPS1 := kmesh-daemon
APPS2 := kmesh-cmd
.PHONY: all install clean
all:
$(QUIET) $(ROOT_DIR)/mk/pkg-config.sh set
$(QUIET) cp depends/include/5.10.0-60.18.0.50.oe2203/bpf_helper_defs_ext.h bpf/include/
$(QUIET) make -C api
$(QUIET) make -C api/v2-c
$(QUIET) make -C bpf/deserialization_to_bpf_map
$(QUIET) $(GO) generate bpf/kmesh/bpf2go/bpf2go.go
$(call printlog, BUILD, $(APPS1))
$(QUIET) $(GO) build -o $(APPS1) $(GOFLAGS) ./daemon/main.go
$(call printlog, BUILD, $(APPS2))
$(QUIET) $(GO) build -o $(APPS2) $(GOFLAGS) ./cmd/main.go
$(call printlog, BUILD, "kernel")
$(QUIET) make -C kernel/ko_src
$(QUIET) $(ROOT_DIR)/mk/pkg-config.sh unset
install:
$(QUIET) make install -C api/v2-c
$(QUIET) make install -C bpf/deserialization_to_bpf_map
$(call printlog, INSTALL, $(INSTALL_BIN)/$(APPS1))
#$(QUIET) install -dp -m 0750 $(INSTALL_BIN)
$(QUIET) install -Dp -m 0550 $(APPS1) $(INSTALL_BIN)
$(call printlog, INSTALL, $(INSTALL_BIN)/$(APPS2))
$(QUIET) install -Dp -m 0550 $(APPS2) $(INSTALL_BIN)
clean:
$(call printlog, CLEAN, $(APPS1))
$(QUIET) rm -rf $(APPS1) $(APPS1)
$(call printlog, CLEAN, $(APPS2))
$(QUIET) rm -rf $(APPS2) $(APPS2)
$(QUIET) make clean -C api/v2-c
$(QUIET) make clean -C bpf/deserialization_to_bpf_map
$(call printlog, CLEAN, "kernel")
$(QUIET) make clean -C kernel/ko_src