blob: 6436302f731a973ca5be5f224f99def00b68f713 [file] [log] [blame]
Klement Sekera8f2a4ea2017-05-04 06:15:18 +02001BINDIR = $(BR)/vapi_test/
Klement Sekeradc15be22017-06-12 06:49:33 +02002CBIN = $(addprefix $(BINDIR), vapi_c_test)
3CPPBIN = $(addprefix $(BINDIR), vapi_cpp_test)
Klement Sekera8f2a4ea2017-05-04 06:15:18 +02004
Klement Sekerad3e671e2017-09-29 12:36:37 +02005ifeq ($(filter centos,$(OS_ID)),$(OS_ID))
6CPPBIN=
7endif
8
Klement Sekeradc15be22017-06-12 06:49:33 +02009LIBS = -L$(VPP_TEST_BUILD_DIR)/vpp/.libs/ -L$(VPP_TEST_BUILD_DIR)/vpp/vpp-api/vapi/.libs/ -lvppinfra -lvlibmemoryclient -lsvm -lpthread -lcheck -lsubunit -lrt -lm -lvapiclient
10CFLAGS = -std=gnu99 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
11CPPFLAGS = -std=c++11 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
12
13all: $(CBIN) $(CPPBIN)
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020014
15$(BINDIR):
16 mkdir -p $(BINDIR)
17
Klement Sekeradc15be22017-06-12 06:49:33 +020018CSRC = vapi_c_test.c
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020019
Klement Sekerad94c3e52017-09-26 09:21:24 +020020$(BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py | $(BINDIR)
Klement Sekeradc15be22017-06-12 06:49:33 +020021 $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(BINDIR) $<
22
Klement Sekerad94c3e52017-09-26 09:21:24 +020023$(BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py | $(BINDIR)
Klement Sekeradc15be22017-06-12 06:49:33 +020024 $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(BINDIR) $<
25
Klement Sekerad94c3e52017-09-26 09:21:24 +020026$(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
Klement Sekeradc15be22017-06-12 06:49:33 +020027 $(CC) -o $@ $(CFLAGS) $(CSRC) $(LIBS)
28
29CPPSRC = vapi_cpp_test.cpp
30
Klement Sekerad94c3e52017-09-26 09:21:24 +020031$(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
Klement Sekeradc15be22017-06-12 06:49:33 +020032 $(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(LIBS)
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020033
34clean:
35 rm -rf $(BINDIR)