Klement Sekera | 8f2a4ea | 2017-05-04 06:15:18 +0200 | [diff] [blame] | 1 | BINDIR = $(BR)/vapi_test/ |
Klement Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 2 | CBIN = $(addprefix $(BINDIR), vapi_c_test) |
| 3 | CPPBIN = $(addprefix $(BINDIR), vapi_cpp_test) |
Klement Sekera | 8f2a4ea | 2017-05-04 06:15:18 +0200 | [diff] [blame] | 4 | |
Klement Sekera | d3e671e | 2017-09-29 12:36:37 +0200 | [diff] [blame] | 5 | ifeq ($(filter centos,$(OS_ID)),$(OS_ID)) |
| 6 | CPPBIN= |
| 7 | endif |
| 8 | |
Marco Varlese | 5f1231c | 2017-10-10 16:43:14 +0200 | [diff] [blame] | 9 | 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 |
| 10 | ifneq ($(filter opensuse,$(OS_ID)),$(OS_ID)) |
| 11 | LIBS += -lsubunit |
| 12 | endif |
Klement Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 13 | CFLAGS = -std=gnu99 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR) |
| 14 | CPPFLAGS = -std=c++11 -g -Wall -pthread -I$(WS_ROOT)/src -I$(VPP_TEST_INSTALL_PATH)/vpp/include -I$(BINDIR) |
| 15 | |
| 16 | all: $(CBIN) $(CPPBIN) |
Klement Sekera | 8f2a4ea | 2017-05-04 06:15:18 +0200 | [diff] [blame] | 17 | |
| 18 | $(BINDIR): |
| 19 | mkdir -p $(BINDIR) |
| 20 | |
Klement Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 21 | CSRC = vapi_c_test.c |
Klement Sekera | 8f2a4ea | 2017-05-04 06:15:18 +0200 | [diff] [blame] | 22 | |
Klement Sekera | d94c3e5 | 2017-09-26 09:21:24 +0200 | [diff] [blame] | 23 | $(BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py | $(BINDIR) |
Klement Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 24 | $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(BINDIR) $< |
| 25 | |
Klement Sekera | d94c3e5 | 2017-09-26 09:21:24 +0200 | [diff] [blame] | 26 | $(BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py | $(BINDIR) |
Klement Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 27 | $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(BINDIR) $< |
| 28 | |
Klement Sekera | d94c3e5 | 2017-09-26 09:21:24 +0200 | [diff] [blame] | 29 | $(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 Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 30 | $(CC) -o $@ $(CFLAGS) $(CSRC) $(LIBS) |
| 31 | |
| 32 | CPPSRC = vapi_cpp_test.cpp |
| 33 | |
Klement Sekera | d94c3e5 | 2017-09-26 09:21:24 +0200 | [diff] [blame] | 34 | $(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 Sekera | dc15be2 | 2017-06-12 06:49:33 +0200 | [diff] [blame] | 35 | $(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(LIBS) |
Klement Sekera | 8f2a4ea | 2017-05-04 06:15:18 +0200 | [diff] [blame] | 36 | |
| 37 | clean: |
| 38 | rm -rf $(BINDIR) |