Replace $(shell find | sort) with $(sort $(shell find))
Kati's find emulator doesn't understand "| sort", so use use the make
function instead so that we can emulate the find commands.
before: *kati*: shell time (regen): 1.316989 / 187
after: *kati*: shell time (regen): 1.249748 / 184
The time has a lot of variance, the important change is the reduction in
number of shell commands. Kati has other issues with some of these (it
doesn't support find's implicit -a), which is why it only goes down by
3. I'll be fixing Kati separately to handle those cases.
Test: diff out/build-aosp_taimen.ninja before&after
Change-Id: I5c8c2993f01a8a6af84963e903a8a0c186a61e82
diff --git a/core/Makefile b/core/Makefile
index c9e64f8..3820faa 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2374,18 +2374,18 @@
system/extras/verity/build_verity_metadata.py \
system/extras/ext4_utils/mke2fs.conf \
external/avb/test/data/testkey_rsa4096.pem \
- $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print | sort) \
- $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \
- -name verity_key | sort) \
- $(shell find device $(wildcard vendor) -type f -name \*.pk8 -o -name verifiedboot\* -o \
- -name \*.x509.pem -o -name oem\*.prop | sort)
+ $(sort $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print)) \
+ $(sort $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \
+ -name verity_key)) \
+ $(sort $(shell find device $(wildcard vendor) -type f -name \*.pk8 -o -name verifiedboot\* -o \
+ -name \*.x509.pem -o -name oem\*.prop))
OTATOOLS_RELEASETOOLS := \
- $(shell find build/make/tools/releasetools -name \*.pyc -prune -o -type f | sort)
+ $(sort $(shell find build/make/tools/releasetools -name \*.pyc -prune -o -type f))
ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT))
OTATOOLS_DEPS += \
- $(shell find external/vboot_reference/tests/devkeys -type f | sort)
+ $(sort $(shell find external/vboot_reference/tests/devkeys -type f))
endif
$(BUILT_OTATOOLS_PACKAGE): $(OTATOOLS) $(OTATOOLS_DEPS) $(OTATOOLS_RELEASETOOLS) | $(ACP)