external/toybox
Revisión | 2f848f6b9b75dfd99133c7003f88e60dbee5de5b (tree) |
---|---|
Tiempo | 2017-04-14 13:10:26 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Fix phony dependency
It's wrong to let the toybox executable depend on a phony target
toybox_links. It makes "Nothing to be done" not work.
Rewrite the rules by LOCAL_POST_INSTALL_CMD like the toolbox does.
@@ -268,7 +268,7 @@ LOCAL_MODULE := toybox | ||
268 | 268 | |
269 | 269 | # for dumping the list of toys |
270 | 270 | TOYBOX_INSTLIST := $(HOST_OUT_EXECUTABLES)/toybox-instlist |
271 | -LOCAL_ADDITIONAL_DEPENDENCIES := toybox_links | |
271 | +LOCAL_ADDITIONAL_DEPENDENCIES := $(TOYBOX_INSTLIST) | |
272 | 272 | |
273 | 273 | # we still want a link for ls/ps, but the toolbox version needs to |
274 | 274 | # stick around for compatibility reasons, for now. |
@@ -279,18 +279,11 @@ TOYS_FOR_XBIN := ls ps | ||
279 | 279 | # image though. |
280 | 280 | TOYS_WITHOUT_LINKS := blkid traceroute6 |
281 | 281 | |
282 | -include $(BUILD_EXECUTABLE) | |
283 | - | |
284 | -toybox_links: $(TOYBOX_INSTLIST) toybox | |
285 | -toybox_links: TOY_LIST=$(shell $(TOYBOX_INSTLIST)) | |
286 | -toybox_links: TOYBOX_BINARY := $(TARGET_OUT)/bin/toybox | |
287 | -toybox_links: | |
288 | - @echo -e ${CL_CYN}"Generate Toybox links:"${CL_RST} $(TOY_LIST) | |
289 | - @mkdir -p $(TARGET_OUT)/bin | |
290 | - @mkdir -p $(TARGET_OUT)/xbin | |
291 | - $(hide) $(foreach t,$(filter-out $(TOYS_FOR_XBIN) $(TOYS_WITHOUT_LINKS),$(TOY_LIST)),ln -sf toybox $(TARGET_OUT_EXECUTABLES)/$(t);) | |
292 | - $(hide) $(foreach t,$(TOYS_FOR_XBIN),ln -sf /system/bin/toybox $(TARGET_OUT_OPTIONAL_EXECUTABLES)/$(t);) | |
282 | +LOCAL_POST_INSTALL_CMD := $(hide) \ | |
283 | + echo "Generate Toybox links:" $$($(TOYBOX_INSTLIST)); \ | |
284 | + $(TOYBOX_INSTLIST) | grep -vFx -f <(tr ' ' '\n' <<< '$(TOYS_FOR_XBIN) $(TOYS_WITHOUT_LINKS)') | xargs -I'{}' ln -sf toybox '$(TARGET_OUT_EXECUTABLES)/{}' | |
293 | 285 | |
286 | +include $(BUILD_EXECUTABLE) | |
294 | 287 | |
295 | 288 | # This is used by the recovery system |
296 | 289 | include $(CLEAR_VARS) |