add feature to strip "# comment" lines from prebuilt files
Change things so that when $(LOCAL_PREBUILT_STRIP_COMMENTS) is
nonempty, we copy the source file using sed to strip out all the "#
line"-style comments and blank lines, saving considerable system image
space in the case of some wifi configurations.
Bug: 2036961
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index 2d93162..8eaa922 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -3,7 +3,7 @@
##
## Additional inputs from base_rules.make:
## None.
-##
+##
###########################################################
ifneq ($(LOCAL_PREBUILT_LIBS),)
@@ -26,8 +26,14 @@
prebuilt_module_is_a_library :=
endif
+ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
+$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
+ $(transform-prebuilt-to-target-strip-comments)
+else
$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
$(transform-prebuilt-to-target)
+endif
+
ifneq ($(prebuilt_module_is_a_library),)
ifneq ($(LOCAL_IS_HOST_MODULE),)
$(transform-host-ranlib-copy-hack)