1 # //******************************************************************
3 # // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 # // Licensed under the Apache License, Version 2.0 (the "License");
8 # // you may not use this file except in compliance with the License.
9 # // You may obtain a copy of the License at
11 # // http://www.apache.org/licenses/LICENSE-2.0
13 # // Unless required by applicable law or agreed to in writing, software
14 # // distributed under the License is distributed on an "AS IS" BASIS,
15 # // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # // See the License for the specific language governing permissions and
17 # // limitations under the License.
19 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 include ../local.properties
24 OCSOCK_DIR = $(ROOT_DIR)/ocsocket
25 LOGGER_DIR = $(ROOT_DIR)/logger
26 BIN_DIR = $(OCSOCK_DIR)/bin/android/
27 OBJ_DIR = $(OCSOCK_DIR)/obj/android/
28 INC_DIRS = -I$(OCSOCK_DIR)/include/ -I$(LOGGER_DIR)/include
30 CXX=arm-linux-androideabi-g++
31 CC=arm-linux-androideabi-gcc
32 CFLAGS_ANDROID = -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DGTEST_HAS_PTHREAD=0
33 LDFLAGS_ANDROID = -march=armv7-a -Wl,--fix-cortex-a8 -llog
35 DEP_LIBS = $(GTEST_ANDROID_DIR)/lib/.libs/libgtest_main.a $(GTEST_ANDROID_DIR)/lib/.libs/libgtest.a
37 CFLAGS += -Os -Wall -Wno-write-strings -ffunction-sections -fdata-sections -fno-exceptions -DTB_LOG
39 TEST_APP = ocsocket_gtest
41 COBJ = ocsocket.o logger.o
43 VPATH = $(OCSOCK_DIR)/src:$(LOGGER_DIR)/src
47 cp $(TEST_APP) $(BIN_DIR)
52 $(CXX) -c $(CFLAGS) $(CFLAGS_ANDROID) $(INC_DIRS) $< -o $@
54 $(TEST_APP).o: $(TEST_APP).cpp
55 $(CXX) -c $(CFLAGS) $(CFLAGS_ANDROID) $(INC_DIRS) -I$(GTEST_ANDROID_DIR)/include -o $@ $<
57 $(TEST_APP): $(TEST_APP).o $(DEP_LIBS) $(COBJ)
58 $(CXX) -Os -Wl,--gc-sections $(LDFLAGS_ANDROID) $^ -o $@
62 adb push $(BIN_DIR)$(TEST_APP) /data/local/tmp/
67 rm -f *.o $(TEST_APP) recv