--- /dev/null
+#/******************************************************************************\r
+#*\r
+#* Copyright (c) 2019 Intel.\r
+#*\r
+#* Licensed under the Apache License, Version 2.0 (the "License");\r
+#* you may not use this file except in compliance with the License.\r
+#* You may obtain a copy of the License at\r
+#*\r
+#* http://www.apache.org/licenses/LICENSE-2.0\r
+#*\r
+#* Unless required by applicable law or agreed to in writing, software\r
+#* distributed under the License is distributed on an "AS IS" BASIS,\r
+#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+#* See the License for the specific language governing permissions and\r
+#* limitations under the License.\r
+#*\r
+#*******************************************************************************/\r
+\r
+\r
+.SUFFIXES: .o .c .s .i .cpp\r
+\r
+##############################################################\r
+# Tools configuration\r
+##############################################################\r
+CC := icc\r
+CXX := icpc\r
+CPP := icpc\r
+AS := as\r
+AR := ar\r
+LD := icc\r
+OBJDUMP := objdump\r
+\r
+ifeq ($(SHELL),cmd.exe)\r
+MD := mkdir.exe -p\r
+CP := cp.exe -f\r
+RM := rm.exe -rf\r
+else\r
+MD := mkdir -p\r
+CP := cp -f\r
+RM := rm -rf\r
+endif\r
+\r
+ifeq ($(RTE_SDK),)\r
+ $(error "Please define RTE_SDK environment variable")\r
+endif\r
+\r
+ifeq ($(MLOG_DIR),)\r
+ MLOG_DIR=$(XRAN_DIR)/../mlog\r
+endif\r
+\r
+RTE_TARGET ?= x86_64-native-linuxapp-icc\r
+\r
+RTE_INC := $(RTE_SDK)/$(RTE_TARGET)/include\r
+\r
+# Where to find user code.\r
+COMMON_TEST_DIR = $(XRAN_DIR)/test/common\r
+USER_DIR = $(XRAN_DIR)/lib/src\r
+USER_ETH = $(XRAN_DIR)/lib/ethernet\r
+USER_API = $(XRAN_DIR)/lib/api\r
+\r
+# Flags passed to the preprocessor.\r
+# Set Google Test's header directory as a system directory, such that\r
+# the compiler doesn't generate warnings in Google Test headers.\r
+CPPFLAGS += -isystem $(GTEST_ROOT)/include\r
+\r
+# Flags passed to the C++ compiler.\r
+CXXFLAGS += -g -std=gnu++11 -Wall -Wextra -pthread -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I $(COMMON_TEST_DIR) -I$(RTE_INC)\r
+\r
+# All tests produced by this Makefile. Remember to add new tests you\r
+# created to the list.\r
+TESTS = unittests\r
+\r
+# All Google Test headers. Usually you shouldn't change this\r
+# definition.\r
+GTEST_HEADERS = $(GTEST_ROOT)/include/gtest/*.h \\r
+ $(GTEST_ROOT)/include/gtest/internal/*.h\r
+\r
+RTE_LIBS = -L$(RTE_SDK)/$(RTE_TARGET)/lib -Wl,--whole-archive -Wl,-lrte_mempool_ring -Wl,-lrte_pci -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_net -Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_jobstats -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,-lrte_vhost -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lrte_ethdev -Wl,-lrte_cryptodev -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_null -Wl,-lrte_pdump -Wl,-lrt -Wl,-lm -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive\r
+\r
+CFLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \\r
+ -fdata-sections \\r
+ -ffunction-sections \\r
+ -g \\r
+ -Wall \\r
+ -Wimplicit-function-declaration \\r
+ -wd1786 \\r
+ -I$(USER_DIR) -I$(USER_API) -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I$(RTE_INC)\r
+\r
+C_SRC = \\r
+ $(USER_ETH)/ethdi.c \\r
+ $(USER_ETH)/ethernet.c \\r
+ $(USER_DIR)/xran_up_api.c \\r
+ $(USER_DIR)/xran_sync_api.c \\r
+ $(USER_DIR)/xran_timer.c \\r
+ $(USER_DIR)/xran_cp_api.c \\r
+ $(USER_DIR)/xran_transport.c \\r
+ $(USER_DIR)/xran_common.c \\r
+ $(USER_DIR)/xran_ul_tables.c \\r
+ $(USER_DIR)/xran_frame_struct.c \\r
+ $(USER_DIR)/xran_app_frag.c \\r
+ $(USER_DIR)/xran_main.c\r
+\r
+# $(USER_DIR)/xran_compression.c\r
+\r
+CC_SRC = \\r
+ $(COMMON_TEST_DIR)/xranlib_unit_test_main.cc \\r
+ c_plane_tests.cc \\r
+ chain_tests.cc \\r
+ prach_functional.cc \\r
+ prach_performance.cc \\r
+ u_plane_functional.cc \\r
+ init_sys_functional.cc \\r
+ compander_functional.cc \\r
+ unittests.cc\r
+\r
+# u_plane_performance.cc \\r
+\r
+CPP_SRC = $(COMMON_TEST_DIR)/common.cpp \\r
+ $(USER_DIR)/xran_compression.cpp\r
+\r
+C_OBJS := $(patsubst %.c,%.o,$(C_SRC))\r
+CC_OBJS := $(patsubst %.cc,%.o,$(CC_SRC))\r
+CPP_OBJS := $(patsubst %.cpp,%.o,$(CPP_SRC))\r
+\r
+CPPFLAGS += -I$(USER_DIR) -I$(USER_API) \r
+\r
+CPP_COMP = -O3 -xcore-avx512 -restrict -g -fasm-blocks\r
+\r
+# House-keeping build targets.\r
+all : echo_start_build $(TESTS)\r
+\r
+clean :\r
+ @echo [CLEAN]\r
+ rm -f $(TESTS) *.o $(COMMON_TEST_DIR)/*.o $(USER_DIR)/*.o $(USER_ETH)/*.o\r
+\r
+.PHONY : echo_start_build\r
+echo_start_build :\r
+ @echo Build Tests with\r
+ @echo $(USER_DIR)\r
+ @echo $(USER_API)\r
+\r
+$(CC_OBJS) :\r
+ @echo "[CC] $@"\r
+ @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o"$@" $(patsubst %.o,%.cc,$@)\r
+\r
+$(CPP_OBJS) :\r
+ @echo "[CPP] $@"\r
+ @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP) -o"$@" $(patsubst %.o,%.cpp,$@)\r
+\r
+$(C_OBJS) :\r
+ @echo "[C] $@"\r
+ @$(CC) -c $(CFLAGS) -o"$@" $(patsubst %.o,%.c,$@)\r
+\r
+unittests : $(CC_OBJS) $(CPP_OBJS) $(C_OBJS) $(GTEST_ROOT)/libgtest.a\r
+ @echo "[LD] $@"\r
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -L$(MLOG_DIR)/bin -Wl, $(RTE_LIBS) -lpthread -lnuma $^ -o $@\r