aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest/Makefile
blob: 0d6372efb9f3b2b62b53a2720cb5393d6f2b6704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright (c) 2016 Intel Corporation.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ifeq ($(GTEST_DIR),)
all:
	@echo "GTEST_DIR is not setup properly. Skipping gtest"

%::
	@echo "GTEST_DIR is not setup properly. Skipping gtest"

else

# binary name
APP_NAME = gtest-rfc

include $(TLDK_ROOT)/mk/tle.var.mk

# all source are stored in SRCS-y
SRCCPP-y += main.cpp
SRCCPP-y += test_common.cpp
SRCCPP-y += test_tle_dring.cpp
SRCCPP-y += test_tle_ctx.cpp
SRCCPP-y += test_tle_udp_destroy.cpp
SRCCPP-y += test_tle_udp_event.cpp
SRCCPP-y += test_tle_udp_stream_gen.cpp
SRCCPP-y += test_tle_tcp_stream.cpp

SYMLINK-y-app += test_scapy_gen.py

CXXFLAGS += -std=c++11

CXXFLAGS += -I$(GTEST_DIR)/include
CXXFLAGS += -I$(GMOCK_DIR)/include

CXXFLAGS += $(CFLAGS) -Wno-error

LDFLAGS += -lstdc++ -lpthread
LDFLAGS += -L$(GMOCK_DIR) -L$(GMOCK_DIR)/../lib -lgmock
LDFLAGS += -L$(GMOCK_DIR)/gtest -L$(GMOCK_DIR)/../lib -lgtest

LIB_DEPS += tle_l4p
LIB_DEPS += tle_memtank
LIB_DEPS += tle_timer
LIB_DEPS += tle_dring

CPP_OBJS := $(patsubst %.cpp,$(BDIR)/%.o,$(SRCCPP-y))
OBJS += $(CPP_OBJS)

$(BDIR)/%.o: %.cpp Makefile
	@mkdir -p $(BDIR)
	$(Q)$(CXX) $(CXXFLAGS) $(CXXFLAGS_$(<)) -c $< -o $@

include $(TLDK_ROOT)/mk/tle.app.mk

endif