Remove empty rules for check_elf_files.timestamp
If we don't have any new dependencies, or we never set up the
check_elf_files.timestamp rule, don't create an empty one now.
There were >7000 of these unused and empty rules in my AOSP
aosp_cf_x86_phone build.
This was initially brought to my attention by the new checks in
https://github.com/google/kati/pull/189
Test: diff out/build-aosp_cf_x86_phone.ninja, only removed phony rules
Change-Id: Ia43cbbd04df4a01d2182b14e3ccbe5d5ecbcabad
diff --git a/core/main.mk b/core/main.mk
index 465a396..68303cf 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -795,9 +795,10 @@
$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))TARGET_OUT_INTERMEDIATES)/SHARED_LIBRARIES/%,\
$(call module-built-files,$(mod)))))\
\
- $(if $(r),\
+ $(if $(and $(r),$(deps)),\
$(eval stamp := $(dir $(r))check_elf_files.timestamp)\
- $(eval $(call add-elf-file-check-shared-lib,$(stamp),$(deps)))\
+ $(if $(CHECK_ELF_FILES.$(stamp)),\
+ $(eval $(call add-elf-file-check-shared-lib,$(stamp),$(deps))))\
))
endef