forked from CloudNativeDataPlane/cndp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
154 lines (127 loc) · 3.81 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2019-2023 Intel Corporation
#
# Head Makefile for compiling CNDP, but just a wrapper around
# meson and ninja using the tools/cnd-build.sh script.
#
# Use 'make' or 'make build' to build CNDP. If the build directory does
# not exist it will be created with these two build types.
#
mkfile_path=$(abspath $(lastword $(MAKEFILE_LIST)))
source_dir=$(shell dirname "$(mkfile_path)")
Build="${source_dir}/tools/cne-build.sh"
Builder?=docker #OCI Image Builder
CE?=docker #Container Engine
OCI-Builder=$(shell echo $(Builder) | tr A-Z a-z)
ContainerEngine=$(shell echo $(CE) | tr A-Z a-z)
# Use V=1 on the make line to enable verbose output
ifeq ($V,1)
verbose=-v
else
verbose=
endif
ifeq (${tcp},1)
tcp_build=tcp
else
tcp_build=
endif
ifeq (${ipv6},1)
ipv6_build=ipv6
else
ipv6_build=
endif
ifeq (${static_build},1)
build_static=static
else
build_static=
endif
all: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} ${build_static} build
help: FORCE
${Build} help
@echo ""
@echo "Makefile options:"
@echo " Adding 'static_build=1' to the make line enables building static files"
@echo " eg: 'make static_build=1 rebuild install' for static executables"
@echo " Adding 'tcp=1' to enable TCP building"
@echo " eg: 'make tcp=1 rebuild-install' to enable TCP support"
@echo " Adding 'ipv6=1' to enable IPv6 building"
@echo " eg: 'make ipv6=1 rebuild-install' to enable IPv6 support"
@echo " Adding 'V=1' to enable verbose build messages"
build: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} ${build_static} build
rebuild: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} clean ${build_static} build
rebuild-install: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} clean ${build_static} build install
coverity: FORCE
${Build} ${verbose} clean coverity
debug: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} ${build_static} debug
debugopt: FORCE
${Build} ${verbose} ${tcp_build} ${ipv6_build} ${build_static} debugopt
clean: FORCE
${Build} ${verbose} clean
install: FORCE
${Build} ${verbose} install
uninstall: FORCE
${Build} ${verbose} uninstall
docs: FORCE
${Build} ${verbose} docs
py-reqs: FORCE
# regenerate requirements.txt for all Python files
tools/gen_requirements.sh
snyk: FORCE
# scan python code
snyk monitor --command=python3 --file=tools/requirements.txt
# scan go code
@for d in $(shell find -name "go.mod") ; do \
snyk monitor --file=$${d} ; \
done
oci-image: FORCE
ifeq ($(OCI-Builder), docker)
@echo "docker selected"
else ifeq ($(OCI-Builder), buildah)
@echo "buildah selected"
else
@echo "UNKOWN OCI IMAGE builder $(OCI-Builder)"
exit 1
endif
${OCI-Builder} build -t cndp --build-arg http_proxy=${http_proxy} \
--build-arg https_proxy=${http_proxy} -f containerization/docker/ubuntu/Dockerfile .
oci-fed-image: FORCE
ifeq ($(OCI-Builder), docker)
@echo "docker selected"
else ifeq ($(OCI-Builder), buildah)
@echo "buildah selected"
else
@echo "UNKOWN OCI IMAGE builder $(OCI-Builder)"
exit 1
endif
$(OCI-Builder) build -t cndp-fedora --build-arg http_proxy=${http_proxy} \
--build-arg https_proxy=${http_proxy} -f containerization/docker/fedora/Dockerfile .
rust-app: FORCE
${Build} rust-app
rust-app-clean: FORCE
${Build} rust-app-clean
ce-run: FORCE
ifeq ($(ContainerEngine), docker)
@echo "docker selected"
else ifeq ($(ContainerEngine), podman)
@echo "podman selected"
else
@echo "UNKOWN Container Engine $(ContainerEngine)"
exit 1
endif
$(ContainerEngine) run --privileged --network=host -it cndp bash
ce-fed-run: FORCE
ifeq ($(ContainerEngine), docker)
@echo "docker selected"
else ifeq ($(ContainerEngine), podman)
@echo "podman selected"
else
@echo "UNKOWN Container Engine $(ContainerEngine)"
exit 1
endif
$(ContainerEngine) run --privileged --network=host -it cndp-fedora bash
FORCE: