blob: 6b3cb907f76bffe6c2cc474a348ba524e8a02c92 [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 Sekeradc15be22017-06-12 06:49:33 +02005LIBS = -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
6CFLAGS = -std=gnu99 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
7CPPFLAGS = -std=c++11 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR)
8
9all: $(CBIN) $(CPPBIN)
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020010
11$(BINDIR):
12 mkdir -p $(BINDIR)
13
Klement Sekeradc15be22017-06-12 06:49:33 +020014CSRC = vapi_c_test.c
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020015
Klement Sekerad94c3e52017-09-26 09:21:24 +020016$(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 +020017 $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(BINDIR) $<
18
Klement Sekerad94c3e52017-09-26 09:21:24 +020019$(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 +020020 $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(BINDIR) $<
21
Klement Sekerad94c3e52017-09-26 09:21:24 +020022$(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 +020023 $(CC) -o $@ $(CFLAGS) $(CSRC) $(LIBS)
24
25CPPSRC = vapi_cpp_test.cpp
26
Klement Sekerad94c3e52017-09-26 09:21:24 +020027$(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 +020028 $(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(LIBS)
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020029
30clean:
31 rm -rf $(BINDIR)