Add android makefiles.

This commit is contained in:
bossiel 2010-02-01 02:01:14 +00:00
parent e07290457b
commit f9b9725b94
6 changed files with 97 additions and 7 deletions

View File

@ -0,0 +1,59 @@
APP := libtinySAK.so
INSTALL_DIR = /system/lib
CFLAGS := $(CFLAGS)
LDFLAGS := $(LDFLAGS) -Wl,-soname,libtinySAK.so,-Bsymbolic,-shared,--whole-archive -Wl,-Map=$(OUTPUT_DIR)/libtinySAK.map
all: $(APP)
OBJS = tsk.o\
tsk_base64.o\
tsk_binaryutils.o\
tsk_buffer.o\
tsk_condwait.o\
tsk_debug.o\
tsk_heap.o\
tsk_hmac.o\
tsk_list.o\
tsk_md5.o\
tsk_memory.o\
tsk_mutex.o\
tsk_object.o\
tsk_params.o\
tsk_ppfcs16.o\
tsk_ppfcs32.o\
tsk_runnable.o\
tsk_safeobj.o\
tsk_semaphore.o\
tsk_sha1.o\
tsk_string.o\
tsk_thread.o\
tsk_time.o\
tsk_timer.o\
tsk_url.o\
tsk_xml.o
$(APP): $(OBJS)
$(CPP) $(LDFLAGS) -o $@ $^
%.o: %.c
$(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
install: $(APP)
$(ANDROID_SDK_ROOT)/tools/adb remount
$(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(INSTALL_DIR)/$(APP)
$(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(INSTALL_DIR)/$(APP)
shell:
$(ANDROID_SDK_ROOT)/tools/adb shell
run:
$(ANDROID_SDK_ROOT)/tools/adb shell $(INSTALL_DIR)/$(APP)
#dbg:
# $(MAKE) $(MAKEFILE) DEBUG="-g -DDEBUG"
# $(MAKE) $(MAKEFILE) install
clean:
@rm -f $(OBJS) $(APP)

View File

@ -177,7 +177,7 @@ void* tsk_calloc(size_t num, size_t size)
void* ret = calloc(num, size);
if(!ret)
{
TSK_DEBUG_ERROR("Memory allocation failed");
TSK_DEBUG_ERROR("Memory allocation failed. num=%u and size=%u", num, size);
}
return ret;

View File

@ -0,0 +1,31 @@
APP := test
#TINYSAK_INCLUDE := -I../src
#TINYSAK_LIB := -L../ -ltinySAK
CFLAGS := $(CFLAGS) -I../src -static
LDFLAGS := $(LDFLAGS) -Bsymbolic -L$(OUTPUT_DIR) -ltinySAK
all: $(APP)
OBJS += $(APP).o
$(APP): $(OBJS)
$(CPP) $(LDFLAGS) -o $@ $^
%.o: %.c
$(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
install: $(APP)
$(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(INSTALL_DIR)/$(APP)
$(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(INSTALL_DIR)/$(APP)
run:
$(ANDROID_SDK_ROOT)/tools/adb shell $(INSTALL_DIR)/$(APP)
#dbg:
# $(MAKE) $(MAKEFILE) DEBUG="-g -DDEBUG"
# $(MAKE) $(MAKEFILE) install
clean:
@rm -f $(OBJS) $(APP)

View File

@ -34,7 +34,7 @@
#define LOOP 1
#define RUN_TEST_ALL 0
#define RUN_TEST_LISTS 0
#define RUN_TEST_LISTS 1
#define RUN_TEST_HEAP 0
#define RUN_TEST_STRINGS 0
#define RUN_TEST_URL 0
@ -45,7 +45,7 @@
#define RUN_TEST_OBJECT 0
#define RUN_TEST_PARAMS 0
#define RUN_TEST_TIMER 0
#define RUN_TEST_RUNNABLE 1
#define RUN_TEST_RUNNABLE 0
#define RUN_TEST_BUFFER 0
#define RUN_TEST_MD5 0
#define RUN_TEST_SHA1 0

View File

@ -119,7 +119,7 @@ void test_basic_list()
tsk_list_remove_item(list, list->tail);
/* delete all items in the list */
TSK_LIST_SAFE_FREE(list);
TSK_OBJECT_SAFE_FREE(list);
}
void test_filtered_list()
@ -203,7 +203,7 @@ void test_filtered_list()
}
/* delete all items in the list */
TSK_LIST_SAFE_FREE(list);
TSK_OBJECT_SAFE_FREE(list);
#undef PUSH_FILTERED
}
@ -255,7 +255,7 @@ void test_complex_list()
}
/* delete all items in the list */
TSK_LIST_SAFE_FREE(list);
TSK_OBJECT_SAFE_FREE(list);
}
#endif /* _TEST_LISTS_H_ */

View File

@ -117,7 +117,7 @@ void test_runnable()
tsk_thread_sleep(3000);
TSK_TIMER_MANAGER_SAFE_FREE(timer_mgr);
TSK_OBJECT_SAFE_FREE(timer_mgr);
tsk_runnable_stop(runnable);
tsk_free((void**)&runnable);
}