Skip to content

Commit 9ecb97a

Browse files
committed
mk: install.mk directory argument pass for install-runtime-target
1 parent 35214d3 commit 9ecb97a

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

mk/install.mk

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,40 +157,46 @@ uninstall:
157157

158158
# target platform specific variables
159159
# for arm-linux-androidabi
160-
define DEF_ADB_STATUS
161-
CFG_ADB_DEVICE=$(1)
160+
define DEF_ADB_DEVICE_STATUS
161+
CFG_ADB_DEVICE_STATUS=$(1)
162162
endef
163163

164164
$(foreach target,$(CFG_TARGET_TRIPLES), \
165165
$(if $(findstring $(target),"arm-linux-androideabi"), \
166-
$(if $(findstring adb,$(shell which adb)), \
167-
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9-]+[[:blank:]]+device')), \
168-
$(info install: install-runtime-target for arm-linux-androideabi enabled \
166+
$(if $(findstring adb,$(CFG_ADB)), \
167+
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
168+
$(info install: install-runtime-target for $(target) enabled \
169169
$(info install: android device attached) \
170-
$(eval $(call DEF_ADB_STATUS, true))), \
171-
$(info install: install-runtime-target for arm-linux-androideabi disabled \
170+
$(eval $(call DEF_ADB_DEVICE_STATUS, true))), \
171+
$(info install: install-runtime-target for $(target) disabled \
172172
$(info install: android device not attached) \
173-
$(eval $(call DEF_ADB_STATUS, false))) \
173+
$(eval $(call DEF_ADB_DEVICE_STATUS, false))) \
174174
), \
175-
$(info install: install-runtime-target for arm-linux-androideabi disabled \
175+
$(info install: install-runtime-target for $(target) disabled \
176176
$(info install: adb not found) \
177-
$(eval $(call DEF_ADB_STATUS, false))) \
177+
$(eval $(call DEF_ADB_DEVICE_STATUS, false))) \
178178
), \
179179
) \
180180
)
181181

182-
ifeq ($(CFG_ADB_DEVICE),true)
183-
182+
ifeq (install-runtime-target,$(firstword $(MAKECMDGOALS)))
183+
$(eval $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)):;@:)
184+
L_TOKEN := $(word 2,$(MAKECMDGOALS))
185+
ifeq ($(L_TOKEN),)
184186
CFG_RUNTIME_PUSH_DIR=/system/lib
187+
else
188+
CFG_RUNTIME_PUSH_DIR=$(L_TOKEN)
189+
endif
185190

191+
ifeq ($(CFG_ADB_DEVICE_STATUS),true)
186192
ifdef VERBOSE
187193
ADB = adb $(1)
188194
ADB_PUSH = adb push $(1) $(2)
189195
ADB_SHELL = adb shell $(1) $(2)
190196
else
191-
ADB = $(Q)$(call E, adb $(1)) && adb $(1) 1>/dev/null 2>/dev/null
192-
ADB_PUSH = $(Q)$(call E, adb push $(1)) && adb push $(1) $(2) 1>/dev/null 2>/dev/null
193-
ADB_SHELL = $(Q)$(call E, adb shell $(1) $(2)) && adb shell $(1) $(2) 1>/dev/null 2>/dev/null
197+
ADB = $(Q)$(call E, adb $(1)) && adb $(1) 1>/dev/null
198+
ADB_PUSH = $(Q)$(call E, adb push $(1)) && adb push $(1) $(2) 1>/dev/null
199+
ADB_SHELL = $(Q)$(call E, adb shell $(1) $(2)) && adb shell $(1) $(2) 1>/dev/null
194200
endif
195201

196202
define INSTALL_RUNTIME_TARGET_N
@@ -215,8 +221,9 @@ $(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-androideabi))
215221
install-runtime-target: \
216222
install-runtime-target-arm-linux-androideabi-cleanup \
217223
install-runtime-target-arm-linux-androideabi-host-$(CFG_BUILD_TRIPLE)
218-
219224
else
220225
install-runtime-target:
221-
@echo
226+
@echo "No device to install runtime library"
227+
@echo
228+
endif
222229
endif

0 commit comments

Comments
 (0)