blob: 8430904e1599260027db3a8e0e8d0812e40c65f5 [file] [log] [blame]
Koushik Dutta01d17e02013-02-26 22:45:57 -08001# Root AOSP source makefile
2# su is built here, and
Maarten Derks65287de2021-02-13 01:12:48 +05303ifeq ($(FP2_USE_APPOPS_SU), true)
4
Diogo Ferreira9c147742014-12-16 19:41:01 +00005LOCAL_PATH := $(call my-dir)
Steve Kondik810f96d2016-09-06 00:39:50 -07006
Koushik Duttadb0b3592013-02-28 18:08:51 -08007include $(CLEAR_VARS)
Koushik Duttafef458b2013-02-26 23:46:44 -08008
Koushik Dutta01d17e02013-02-26 22:45:57 -08009LOCAL_MODULE := su
Luca Stefani3d372ab2018-08-26 12:59:35 +020010LOCAL_SHARED_LIBRARIES := \
Christopher N. Hessecc520432018-01-07 20:01:14 +010011 libbinder \
12 libcutils \
13 liblog \
Christopher N. Hessecc520432018-01-07 20:01:14 +010014 libutils \
Luca Stefani3d372ab2018-08-26 12:59:35 +020015
Diogo Ferreira9c147742014-12-16 19:41:01 +000016LOCAL_SRC_FILES := su.c daemon.c utils.c pts.c
17LOCAL_SRC_FILES += binder/appops-wrapper.cpp binder/pm-wrapper.c
Luca Stefanibce29762017-01-22 23:09:15 +010018LOCAL_CFLAGS += -Werror -Wall
Koushik Duttabc01b942013-02-26 23:02:37 -080019LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
Steve Kondik810f96d2016-09-06 00:39:50 -070020
21LOCAL_INIT_RC := superuser.rc
22
Koushik Dutta01d17e02013-02-26 22:45:57 -080023include $(BUILD_EXECUTABLE)
24
Koushik Dutta2cd157d2013-03-06 12:10:03 -080025SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,su)
Chih-Wei Huangcd953bd2013-08-15 18:49:06 +080026$(SYMLINKS):
Koushik Dutta2cd157d2013-03-06 12:10:03 -080027 @echo "Symlink: $@ -> /system/xbin/su"
28 @mkdir -p $(dir $@)
29 @rm -rf $@
Chih-Wei Huangcd953bd2013-08-15 18:49:06 +080030 $(hide) ln -sf ../xbin/su $@
Koushik Dutta2cd157d2013-03-06 12:10:03 -080031
Diogo Ferreira9c147742014-12-16 19:41:01 +000032# We need this so that the installed files could be picked up based on the
33# local module name
Koushik Dutta8c918b22013-07-27 21:21:54 -070034ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
Steve Kondik810f96d2016-09-06 00:39:50 -070035 $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
Evan Anderson70d51692013-07-31 14:43:32 -050036
Maarten Derks65287de2021-02-13 01:12:48 +053037endif