| LOCAL_PATH:= $(call my-dir) |
| $(patsubst %,%.c,$(TOOLS)) |
| LOCAL_SHARED_LIBRARIES := libcutils libc |
| # Including this will define $(intermediates). |
| include $(BUILD_EXECUTABLE) |
| $(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h |
| TOOLS_H := $(intermediates)/tools.h |
| $(TOOLS_H): PRIVATE_TOOLS := $(TOOLS) |
| $(TOOLS_H): PRIVATE_CUSTOM_TOOL = echo "/* file generated automatically */" > $@ ; for t in $(PRIVATE_TOOLS) ; do echo "TOOL($$t)" >> $@ ; done |
| $(TOOLS_H): $(LOCAL_PATH)/Android.mk |
| $(transform-generated-source) |
| # Make #!/system/bin/toolbox launchers for each tool. |
| SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,$(TOOLS)) |
| $(SYMLINKS): TOOLBOX_BINARY := $(LOCAL_MODULE) |
| $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk |
| @echo "Symlink: $@ -> $(TOOLBOX_BINARY)" |
| $(hide) ln -sf $(TOOLBOX_BINARY) $@ |
| ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS) |
| # We need this so that the installed files could be picked up based on the |
| ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ |
| $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS) |