1 VAPI_BINDIR = $(BR)/vapi_test/
2 VAPI_CBIN = $(addprefix $(VAPI_BINDIR), vapi_c_test)
3 VAPI_CPPBIN = $(addprefix $(VAPI_BINDIR), vapi_cpp_test)
4 VOM_BINDIR = $(BR)/vom_test/
5 VOM_BIN = $(addprefix $(VOM_BINDIR), vom_test)
7 ifeq ($(filter rhel centos,$(OS_ID)),$(OS_ID))
11 VAPI_LIBS = -L$(VPP_TEST_BUILD_DIR)/vpp/.libs/ -L$(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vapi/.libs/ -lvppinfra -lvlibmemoryclient -lsvm -lpthread -lcheck -lrt -lm -lvapiclient
12 ifneq ($(filter opensuse,$(OS_ID)),$(OS_ID))
13 VAPI_LIBS += -lsubunit
15 CFLAGS = -std=gnu99 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(VAPI_BINDIR)
16 CPPFLAGS = -std=c++11 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(VAPI_BINDIR)
18 all: $(VAPI_CBIN) $(VAPI_CPPBIN) $(VOM_BINDIR) $(VOM_BIN)
21 mkdir -p $(VAPI_BINDIR)
25 $(VAPI_BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py | $(VAPI_BINDIR)
26 $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(VAPI_BINDIR) $<
28 $(VAPI_BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py | $(VAPI_BINDIR)
29 $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(VAPI_BINDIR) $<
31 $(VAPI_CBIN): $(CSRC) $(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vapi/.libs/libvapiclient.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libvppinfra.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libvlibmemoryclient.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libsvm.so $(VAPI_BINDIR)/fake.api.vapi.h
32 $(CC) -o $@ $(CFLAGS) $(CSRC) $(VAPI_LIBS)
34 CPPSRC = vapi_cpp_test.cpp
36 $(VAPI_CPPBIN): $(CPPSRC) $(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vapi/.libs/libvapiclient.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libvppinfra.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libvlibmemoryclient.so $(VPP_TEST_BUILD_DIR)/vpp/.libs/libsvm.so $(VAPI_BINDIR)/fake.api.vapi.hpp
37 $(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(VAPI_LIBS)
39 VOM_CPPSRC = vom_test.cpp
42 mkdir -p $(VOM_BINDIR)
44 LIB_VOM = $(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vom/.libs/libvom.so
45 VOM_LIBS = $(LIB_VOM) \
49 -lboost_unit_test_framework \
53 -I $(WS_ROOT)/src/vpp-api/ \
56 $(VOM_BIN): $(VOM_CPPSRC) $(VOM_BINDIR) $(LIB_VOM) $(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vapi/.libs/libvapiclient.so
57 $(CXX) -o $@ $(VOM_CPPFLAGS) -DBOOST_LOG_DYN_LINK -O0 -g $(VOM_CPPSRC) $(VOM_LIBS)
60 rm -rf $(VAPI_BINDIR) $(VOM_BINDIR)