2017-05-04 06:15:18 +02:00
|
|
|
BINDIR = $(BR)/vapi_test/
|
2017-06-12 06:49:33 +02:00
|
|
|
CBIN = $(addprefix $(BINDIR), vapi_c_test)
|
|
|
|
CPPBIN = $(addprefix $(BINDIR), vapi_cpp_test)
|
|
|
|
|
2017-09-29 12:36:37 +02:00
|
|
|
ifeq ($(filter centos,$(OS_ID)),$(OS_ID))
|
|
|
|
CPPBIN=
|
|
|
|
endif
|
|
|
|
|
2017-10-10 16:43:14 +02:00
|
|
|
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
|
|
|
|
ifneq ($(filter opensuse,$(OS_ID)),$(OS_ID))
|
|
|
|
LIBS += -lsubunit
|
|
|
|
endif
|
2017-06-12 06:49:33 +02:00
|
|
|
CFLAGS = -std=gnu99 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
|
|
|
|
CPPFLAGS = -std=c++11 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
|
2017-05-04 06:15:18 +02:00
|
|
|
|
2017-06-12 06:49:33 +02:00
|
|
|
all: $(CBIN) $(CPPBIN)
|
2017-05-04 06:15:18 +02:00
|
|
|
|
|
|
|
$(BINDIR):
|
|
|
|
mkdir -p $(BINDIR)
|
|
|
|
|
2017-06-12 06:49:33 +02:00
|
|
|
CSRC = vapi_c_test.c
|
|
|
|
|
2017-09-26 09:21:24 +02:00
|
|
|
$(BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py | $(BINDIR)
|
2017-06-12 06:49:33 +02:00
|
|
|
$(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(BINDIR) $<
|
|
|
|
|
2017-09-26 09:21:24 +02:00
|
|
|
$(BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py | $(BINDIR)
|
2017-06-12 06:49:33 +02:00
|
|
|
$(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(BINDIR) $<
|
|
|
|
|
2017-09-26 09:21:24 +02:00
|
|
|
$(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 $(BINDIR)/fake.api.vapi.h
|
2017-06-12 06:49:33 +02:00
|
|
|
$(CC) -o $@ $(CFLAGS) $(CSRC) $(LIBS)
|
|
|
|
|
|
|
|
CPPSRC = vapi_cpp_test.cpp
|
2017-05-04 06:15:18 +02:00
|
|
|
|
2017-09-26 09:21:24 +02:00
|
|
|
$(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 $(BINDIR)/fake.api.vapi.hpp
|
2017-06-12 06:49:33 +02:00
|
|
|
$(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(LIBS)
|
2017-05-04 06:15:18 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BINDIR)
|