forked from EpiSci/oai-lte-5g-multi-ue-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (59 loc) · 1.68 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
CC = gcc
CFLAGS = -g -O2 -Wall -Werror
CXX = g++ -std=c++11
CXXFLAGS = -g -O3 -Wall -Wextra -Werror
BUILD_DIR = ./build
TARGET_EXEC = $(BUILD_DIR)/proxy
top_srcdir = .
LIB_DIR = .
SRC_DIR = ./src
INC_DIRS = \
$(SRC_DIR) \
$(LIB_DIR)/open-nFAPI/nfapi/public_inc \
$(LIB_DIR)/open-nFAPI/pnf_sim/inc \
$(LIB_DIR)/open-nFAPI/nfapi/inc \
$(LIB_DIR)/open-nFAPI/pnf/public_inc \
$(LIB_DIR)/open-nFAPI/pnf/inc \
$(LIB_DIR)/open-nFAPI/common/public_inc \
$(LIB_DIR)/open-nFAPI/common/inc \
LIB_SOURCES = \
$(LIB_DIR)/open-nFAPI/nfapi/src/nfapi.c \
$(LIB_DIR)/open-nFAPI/nfapi/src/nfapi_p4.c \
$(LIB_DIR)/open-nFAPI/nfapi/src/nfapi_p5.c \
$(LIB_DIR)/open-nFAPI/nfapi/src/nfapi_p7.c \
$(LIB_DIR)/open-nFAPI/pnf/src/pnf_interface.c \
$(LIB_DIR)/open-nFAPI/pnf/src/pnf_p7_interface.c \
$(LIB_DIR)/open-nFAPI/pnf/src/pnf.c \
$(LIB_DIR)/open-nFAPI/pnf/src/pnf_p7.c \
$(LIB_DIR)/open-nFAPI/common/src/debug.c \
SRCS = \
$(SRC_DIR)/proxy.cc \
$(SRC_DIR)/lte_proxy.cc \
$(SRC_DIR)/nr_proxy.cc \
$(SRC_DIR)/nfapiutils.c \
$(SRC_DIR)/nfapi_pnf.c \
$(SRC_DIR)/queue.c \
$(LIB_SOURCES)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS = $(OBJS:.o=.d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
LDFLAGS = -lasan -pthread -lpthread -lz -lsctp -rdynamic
MKDIR_P ?= mkdir -p
$(TARGET_EXEC): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
# c source
$(BUILD_DIR)/%.c.o: %.c
$(MKDIR_P) $(dir $@)
$(CC) $(INC_FLAGS) $(CFLAGS) -c $< -o $@
# c++ source
$(BUILD_DIR)/%.cc.o: %.cc
$(MKDIR_P) $(dir $@)
$(CXX) $(INC_FLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY: clean
clean:
$(RM) -r $(BUILD_DIR)
-include $(DEPS)
# Run static analysis checks on Python scripts
.PHONY: mypy
mypy:
python3 -m mypy proxy_testscript.py