OSDN Git Service

Fix incorrect prerequisites
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 15 Aug 2013 10:49:06 +0000 (18:49 +0800)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Wed, 2 Oct 2013 01:27:32 +0000 (01:27 +0000)
'Nothing to be done' build failed because

* $(LOCAL_MODULE) should not be a prerequisite
* The created symlink doesn't exist in the host out tree

Besides, all prerequisites of $(SYMLINKS) are removed. This is because
'make' checks the timestamp of the file the link references rather than
the link itself. Therefore $(LOCAL_INSTALLED_MODULE) is a useless
prerequisite. On the other hand, $(LOCAL_PATH)/Android.mk should not
be a prerequisite of $(SYMLINKS) unless it is also a prerequisite of
$(LOCAL_INSTALLED_MODULE). Otherwise, if $(LOCAL_PATH)/Android.mk is
newer than $(LOCAL_INSTALLED_MODULE), $(SYMLINKS) will always be
re-made.

Correct the prerequisites of $(SUPERUSER_RC) as well.

Change-Id: I5746e983046a9cdc3ee2b8ecd3827f1f7e6b596e

Android.mk

index 1301049..8030a7b 100644 (file)
@@ -33,12 +33,11 @@ include $(BUILD_EXECUTABLE)
 
 
 SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,su)
-$(SYMLINKS): $(LOCAL_MODULE)
-$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
+$(SYMLINKS):
        @echo "Symlink: $@ -> /system/xbin/su"
        @mkdir -p $(dir $@)
        @rm -rf $@
-       $(hide) ln -sf /system/xbin/su $@
+       $(hide) ln -sf ../xbin/su $@
 
 ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
 
@@ -53,21 +52,16 @@ ifdef SUPERUSER_EMBEDDED
 # init.rc or similar
 
 SUPERUSER_RC := $(TARGET_ROOT_OUT)/init.superuser.rc
-$(SUPERUSER_RC): $(LOCAL_MODULE)
-$(SUPERUSER_RC): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
-       @mkdir -p $(dir $@)
-       @rm -rf $@
-       $(hide) cp external/koush/Superuser/init.superuser.rc $@
-
+$(SUPERUSER_RC): $(LOCAL_PATH)/init.superuser.rc | $(ACP)
+       $(copy-file-to-new-target)
 
 SUPERUSER_MARKER := $(TARGET_OUT_ETC)/.has_su_daemon
-$(SUPERUSER_MARKER): $(LOCAL_MODULE)
-$(SUPERUSER_MARKER): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
+$(SUPERUSER_MARKER): $(LOCAL_INSTALLED_MODULE)
        @mkdir -p $(dir $@)
        @rm -rf $@
        $(hide) touch $@
 
 ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
-    $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(TARGET_ROOT_OUT)/init.superuser.rc $(TARGET_OUT_ETC)/.has_su_daemon
+    $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SUPERUSER_RC) $(SUPERUSER_MARKER)
 
 endif