OSDN Git Service

Fix /system/app/$app.odex not updated issue
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 15 Apr 2013 09:12:19 +0000 (17:12 +0800)
committerChih-Wei Huang <cwhuang@android-x86.org>
Wed, 17 Apr 2013 08:00:40 +0000 (16:00 +0800)
$(built_odex) depends on $(LOCAL_BUILT_MODULE) but doesn't have any build
recipe. It is built by the rules of $(LOCAL_BUILT_MODULE) that results in
a subtle bug: $(built_odex) is always newer than $(LOCAL_BUILT_MODULE)
if $(LOCAL_BUILT_MODULE) rebuilt. Therefore 'make' thinks the targets
(/system/app/$app.odex) depending on $(built_odex) don't need to be updated.
It seems an allegedly optimization bug of 'make'.

The simple fix is to explicitly add $(LOCAL_BUILT_MODULE) as a dependency
of $(installed_odex).

core/base_rules.mk

index ed125fe..b4791da 100644 (file)
@@ -513,7 +513,7 @@ endif
 ifdef LOCAL_DEX_PREOPT
 installed_odex := $(basename $(LOCAL_INSTALLED_MODULE)).odex
 built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex
-$(installed_odex) : $(built_odex) | $(ACP)
+$(installed_odex) : $(built_odex) $(LOCAL_BUILT_MODULE) | $(ACP)
        @echo "Install: $@"
        $(copy-file-to-target)