OSDN Git Service

Automatic translation import
[android-x86/external-koush-Superuser.git] / Android.mk
index 2b4db49..f4fad43 100644 (file)
@@ -17,30 +17,31 @@ LOCAL_PATH := $(my_path)
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := su
-LOCAL_MODULE_TAGS := eng debug
+LOCAL_MODULE_TAGS := optional
 LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_STATIC_LIBRARIES := libc
+LOCAL_STATIC_LIBRARIES := libc libcutils
 LOCAL_C_INCLUDES := external/sqlite/dist
-LOCAL_SRC_FILES := Superuser/jni/su/su.c Superuser/jni/su/daemon.c Superuser/jni/su/activity.c Superuser/jni/su/db.c Superuser/jni/su/utils.c ../../sqlite/dist/sqlite3.c
+LOCAL_SRC_FILES := Superuser/jni/su/su.c Superuser/jni/su/daemon.c Superuser/jni/su/activity.c Superuser/jni/su/db.c Superuser/jni/su/utils.c Superuser/jni/su/pts.c ../../sqlite/dist/sqlite3.c
 LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -DREQUESTOR=\"$(SUPERUSER_PACKAGE)\"
 
 ifdef SUPERUSER_PACKAGE_PREFIX
   LOCAL_CFLAGS += -DREQUESTOR_PREFIX=\"$(SUPERUSER_PACKAGE_PREFIX)\"
 endif
 
+ifdef SUPERUSER_EMBEDDED
+  LOCAL_CFLAGS += -DSUPERUSER_EMBEDDED
+endif
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 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 $@
-
-ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
+       $(hide) ln -sf ../xbin/su $@
 
 # We need this so that the installed files could be picked up based on the
 # local module name
@@ -53,21 +54,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