1 include ../local.properties
4 OCSOCK_DIR = $(ROOT_DIR)/ocsocket
5 LOGGER_DIR = $(ROOT_DIR)/logger
6 BIN_DIR = $(OCSOCK_DIR)/bin/android/
7 OBJ_DIR = $(OCSOCK_DIR)/obj/android/
8 INC_DIRS = -I$(OCSOCK_DIR)/include/ -I$(LOGGER_DIR)/include
10 CCPLUS=arm-linux-androideabi-g++
11 CC=arm-linux-androideabi-gcc
12 CFLAGS_ANDROID = -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DGTEST_HAS_PTHREAD=0
13 LDFLAGS_ANDROID = -march=armv7-a -Wl,--fix-cortex-a8 -llog
15 DEP_LIBS = $(GTEST_ANDROID_DIR)/lib/.libs/libgtest_main.a $(GTEST_ANDROID_DIR)/lib/.libs/libgtest.a
17 CFLAGS += -Os -Wall -Wno-write-strings -ffunction-sections -fdata-sections -fno-exceptions -DTB_LOG
19 TEST_APP = ocsocket_gtest
21 COBJ = ocsocket.o logger.o
23 VPATH = $(OCSOCK_DIR)/src:$(LOGGER_DIR)/src
27 cp $(TEST_APP) $(BIN_DIR)
32 $(CCPLUS) -c $(CFLAGS) $(CFLAGS_ANDROID) $(INC_DIRS) $< -o $@
34 $(TEST_APP).o: $(TEST_APP).cpp
35 $(CCPLUS) -c $(CFLAGS) $(CFLAGS_ANDROID) $(INC_DIRS) -I$(GTEST_ANDROID_DIR)/include -o $@ $<
37 $(TEST_APP): $(TEST_APP).o $(DEP_LIBS) $(COBJ)
38 $(CCPLUS) -Os -Wl,--gc-sections $(LDFLAGS_ANDROID) $^ -o $@
42 adb push $(BIN_DIR)$(TEST_APP) /data/local/tmp/
47 rm -f *.o $(TEST_APP) recv