summaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-06-12 00:32:52 +0200
committerandroid code review <noreply-gerritcodereview@google.com>2012-06-12 00:32:52 +0200
commit6d60667de6b8e6bd8a54fb4031901e2935743308 (patch)
tree8771f01bfa0e800809f7403515eabac52dc48832 /updater
parentMerge "Change the format command to always take the mount point as an argument." (diff)
parentUse a dependency file to replace the list file. (diff)
downloadandroid_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar.gz
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar.bz2
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar.lz
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar.xz
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.tar.zst
android_bootable_recovery-6d60667de6b8e6bd8a54fb4031901e2935743308.zip
Diffstat (limited to 'updater')
-rw-r--r--updater/Android.mk24
1 files changed, 14 insertions, 10 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index f8ccb76b5..2211113dd 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -50,18 +50,19 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
inc := $(call intermediates-dir-for,PACKAGING,updater_extensions)/register.inc
-# During the first pass of reading the makefiles, we dump the list of
-# extension libs to a temp file, then copy that to the ".list" file if
-# it is different than the existing .list (if any). The register.inc
-# file then uses the .list as a prerequisite, so it is only rebuilt
-# (and updater.o recompiled) when the list of extension libs changes.
-
-junk := $(shell mkdir -p $(dir $(inc));\
- echo $(TARGET_RECOVERY_UPDATER_LIBS) > $(inc).temp;\
- diff -q $(inc).temp $(inc).list 2>/dev/null || cp -f $(inc).temp $(inc).list)
+# Encode the value of TARGET_RECOVERY_UPDATER_LIBS into the filename of the dependency.
+# So if TARGET_RECOVERY_UPDATER_LIBS is changed, a new dependency file will be generated.
+# Note that we have to remove any existing depency files before creating new one,
+# so no obsolete dependecy file gets used if you switch back to an old value.
+inc_dep_file := $(inc).dep.$(subst $(space),-,$(sort $(TARGET_RECOVERY_UPDATER_LIBS)))
+$(inc_dep_file): stem := $(inc).dep
+$(inc_dep_file) :
+ $(hide) mkdir -p $(dir $@)
+ $(hide) rm -f $(stem).*
+ $(hide) touch $@
$(inc) : libs := $(TARGET_RECOVERY_UPDATER_LIBS)
-$(inc) : $(inc).list
+$(inc) : $(inc_dep_file)
$(hide) mkdir -p $(dir $@)
$(hide) echo "" > $@
$(hide) $(foreach lib,$(libs),echo "extern void Register_$(lib)(void);" >> $@;)
@@ -72,6 +73,9 @@ $(inc) : $(inc).list
$(call intermediates-dir-for,EXECUTABLES,updater)/updater.o : $(inc)
LOCAL_C_INCLUDES += $(dir $(inc))
+inc :=
+inc_dep_file :=
+
LOCAL_MODULE := updater
LOCAL_FORCE_STATIC_EXECUTABLE := true