mk: configurable android test directory

This commit is contained in:
Young-il Choi 2013-05-03 11:14:01 +09:00
parent 6f6dd86248
commit 17b368fd22
2 changed files with 12 additions and 10 deletions

View File

@ -164,7 +164,7 @@ endef
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(if $(findstring $(target),"arm-linux-androideabi"), \
$(if $(findstring adb,$(shell which adb)), \
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9-]+[[:blank:]]+device')), \
$(info install: install-runtime-target for arm-linux-androideabi enabled \
$(info install: android device attached) \
$(eval $(call DEF_ADB_STATUS, true))), \
@ -181,6 +181,8 @@ $(foreach target,$(CFG_TARGET_TRIPLES), \
ifeq ($(CFG_ADB_DEVICE),true)
CFG_RUNTIME_PUSH_DIR=/system/lib
ifdef VERBOSE
ADB = adb $(1)
ADB_PUSH = adb push $(1) $(2)
@ -193,17 +195,18 @@ endif
define INSTALL_RUNTIME_TARGET_N
install-runtime-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CFG_RUNTIME_$(1)),/system/lib)
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CORELIB_GLOB_$(1)),/system/lib)
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(STDLIB_GLOB_$(1)),/system/lib)
$(Q)$(call ADB_SHELL,mkdir,$(CFG_RUNTIME_PUSH_DIR))
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CFG_RUNTIME_$(1)),$(CFG_RUNTIME_PUSH_DIR))
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CORELIB_GLOB_$(1)),$(CFG_RUNTIME_PUSH_DIR))
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(STDLIB_GLOB_$(1)),$(CFG_RUNTIME_PUSH_DIR))
endef
define INSTALL_RUNTIME_TARGET_CLEANUP_N
install-runtime-target-$(1)-cleanup:
$(Q)$(call ADB,remount)
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CFG_RUNTIME_$(1)))
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CORELIB_GLOB_$(1)))
$(Q)$(call ADB_SHELL,rm,/system/lib/$(STDLIB_GLOB_$(1)))
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(CFG_RUNTIME_$(1)))
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(CORELIB_GLOB_$(1)))
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(STDLIB_GLOB_$(1)))
endef
$(eval $(call INSTALL_RUNTIME_TARGET_N,arm-linux-androideabi,$(CFG_BUILD_TRIPLE)))

View File

@ -104,7 +104,7 @@ $(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
$(if $(findstring $(target),"arm-linux-androideabi"), \
$(if $(findstring adb,$(shell which adb)), \
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9-]+[[:blank:]]+device')), \
$(info check: $(target) test set is runnable \
$(info check: adb device attached) \
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
@ -129,9 +129,8 @@ CFG_ADB_PATH := $(shell which adb)
CFG_ADB_TEST_DIR=/system/tmp
$(info check: device $(CFG_ADB_TEST_DIR) \
$(shell $(CFG_ADB_PATH) remount 1>/dev/null) \
$(shell $(CFG_ADB_PATH) shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi 1>/dev/null) \
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*.so 1>/dev/null) \
)
endif