summaryrefslogtreecommitdiffstats
path: root/updater/Android.mk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--updater/Android.mk20
1 files changed, 16 insertions, 4 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index a113fe86c..3a47dacd5 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -110,11 +110,21 @@ LOCAL_STATIC_LIBRARIES := \
# any subsidiary static libraries required for your registered
# extension libs.
-LOCAL_MODULE_CLASS := EXECUTABLES
-inc := $(call local-generated-sources-dir)/register.inc
+inc := $(call intermediates-dir-for,PACKAGING,updater_extensions)/register.inc
+
+# 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) : $(inc_dep_file)
$(hide) mkdir -p $(dir $@)
$(hide) echo "" > $@
$(hide) $(foreach lib,$(libs),echo "extern void Register_$(lib)(void);" >> $@;)
@@ -122,9 +132,11 @@ $(inc) :
$(hide) $(foreach lib,$(libs),echo " Register_$(lib)();" >> $@;)
$(hide) echo "}" >> $@
-LOCAL_GENERATED_SOURCES := $(inc)
+$(call intermediates-dir-for,EXECUTABLES,updater,,,$(TARGET_PREFER_32_BIT))/updater.o : $(inc)
+LOCAL_C_INCLUDES += $(dir $(inc))
inc :=
+inc_dep_file :=
LOCAL_FORCE_STATIC_EXECUTABLE := true