forked from Xilinx-CNS/tcpdirect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (83 loc) · 2.65 KB
/
Makefile
File metadata and controls
106 lines (83 loc) · 2.65 KB
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
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: (c) 2015-2024 Advanced Micro Devices, Inc.
.SUFFIXES:
.PHONY: all clean
.DEFAULT_GOAL := all
TOP := $(patsubst %/,%,$(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
ifdef ONLOAD_TREE
include Makefile.onload
else
ifeq ($(ZF_DEVEL),1)
$(error ZF_DEVEL unsupported when building from installed onload)
endif
$(info Using installed onload libraries and headers)
ifneq ("$(wildcard /usr/lib64/libcitools1.a)","")
CITOOLS_LIB := /usr/lib64/libcitools1.a
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libcitools1.a)","")
CITOOLS_LIB := /usr/lib/x86_64-linux-gnu/libcitools1.a
else
$(warning Could not find libcitools1.a. Have you installed onload development headers?)
endif
$(info libcitools1.a found at $(CITOOLS_LIB))
ifneq ("$(wildcard /usr/lib64/libciul1.a)","")
CIUL_LIB := /usr/lib64/libciul1.a
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libciul1.a)","")
CIUL_LIB := /usr/lib/x86_64-linux-gnu/libciul1.a
else
$(warning Could not find libciul1.a. Have you installed onload development headers?)
endif
$(info libciul1.a found at $(CIUL_LIB))
endif
include Makefile-top.inc
# Use Onload's build-tree structure, unless overridden.
ZF_BUILD_ROOT ?= build/$(ONLOAD_UL_BUILD_NAME)
SRC_ROOT := src
LIB_ROOT = $(ZF_BUILD_ROOT)/lib
BIN_ROOT = $(ZF_BUILD_ROOT)/bin
OBJ_ROOT = $(ZF_BUILD_ROOT)/obj
# These paths are evaulated each time they are referenced so are always
# relative to the current makefile
SRC_CURRENT = $(dir $(lastword $(MAKEFILE_LIST)))
OBJ_CURRENT = $(SRC_CURRENT:$(SRC_ROOT)/%=$(OBJ_ROOT)/%)
ifndef CC
CC := gcc
endif
ifndef CLINK
CLINK := $(CC)
endif
ifndef OBJCOPY
export OBJCOPY := $(shell $(CC) -print-prog-name=objcopy)
endif
ZF_CFLAGS_TOP = \
-Isrc/include \
-MD
ifeq ($(NDEBUG),1)
ZF_CFLAGS_TOP += -DNDEBUG=1
else
ZF_CFLAGS_TOP += -g
endif
# Generic rule to build most object files
$(OBJ_ROOT)/%.o: $(SRC_ROOT)/%.c
@mkdir -p $(dir $@)
$(CC) $(ZF_CFLAGS_COMPONENT) $(CFLAGS) $(ZF_CFLAGS_TOP) -c $< -o $@
ifeq ($(ZF_DEVEL),1)
ZF_CFLAGS_TOP += -DZF_DEVEL
endif
include src/lib/zf/Makefile.inc
ifeq ($(ZF_DEVEL),1)
include src/lib/zf/shim/Makefile.inc
include src/tests/zf_unit/Makefile.inc
endif
include src/tests/trade_sim/Makefile.inc
include src/tools/zf/Makefile.inc
include src/tests/zf_apps/Makefile.inc
include src/tests/zf_internal/Makefile.inc
# We use packetdrill for some tests, but can cope without it if not present
ifneq ("$(wildcard ../packetdrill-tcpdirect/Makefile.inc)", "")
include ../packetdrill-tcpdirect/Makefile.inc
endif
include $(shell find $(OBJ_ROOT) -name *.d 2>/dev/null)
tarball:
scripts/zf_make_tarball
clean:
rm -rf $(ZF_BUILD_ROOT)