blob: c88351bd8617f32951092b9d821d4a285395e272 [file] [log] [blame]
Ethan Yonker50381972014-02-11 11:44:06 -06001LOCAL_PATH:= $(call my-dir)
2
3# Build static binary
4include $(CLEAR_VARS)
5
6LOCAL_SRC_FILES:= \
7 twrpTarMain.cpp \
8 ../twrp-functions.cpp \
9 ../twrpTar.cpp \
10 ../tarWrite.c \
Ethan Yonker472f5062016-02-25 13:47:30 -060011 ../twrpDU.cpp \
12 ../progresstracking.cpp \
13 ../gui/twmsg.cpp
Ethan Yonker50381972014-02-11 11:44:06 -060014LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
15
Xing0af1ac12015-11-27 11:19:37 -080016LOCAL_C_INCLUDES += bionic
17ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
Ethan Yonker472f5062016-02-25 13:47:30 -060018 LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
Xing0af1ac12015-11-27 11:19:37 -080019endif
20
Ethan Yonker472f5062016-02-25 13:47:30 -060021LOCAL_STATIC_LIBRARIES := libc libtar_static
Xing0af1ac12015-11-27 11:19:37 -080022ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
23 LOCAL_STATIC_LIBRARIES += libstlport_static
24endif
Ethan Yonker472f5062016-02-25 13:47:30 -060025LOCAL_STATIC_LIBRARIES += libstdc++
Ethan Yonker50381972014-02-11 11:44:06 -060026
27ifeq ($(TWHAVE_SELINUX), true)
28 LOCAL_C_INCLUDES += external/libselinux/include
29 LOCAL_STATIC_LIBRARIES += libselinux
Matt Mower666d1512015-11-11 23:10:50 -060030 LOCAL_CFLAGS += -DHAVE_SELINUX
Ethan Yonker50381972014-02-11 11:44:06 -060031endif
32ifneq ($(RECOVERY_SDCARD_ON_DATA),)
33 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
34endif
35ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
36 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
37else
38 LOCAL_STATIC_LIBRARIES += libopenaes_static
39endif
40
41LOCAL_MODULE:= twrpTar_static
42LOCAL_FORCE_STATIC_EXECUTABLE := true
Ethan Yonker960f0302014-12-21 21:54:00 -060043LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060044LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
45LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
46include $(BUILD_EXECUTABLE)
47
48
49# Build shared binary
50include $(CLEAR_VARS)
51
52LOCAL_SRC_FILES:= \
53 twrpTarMain.cpp \
54 ../twrp-functions.cpp \
55 ../twrpTar.cpp \
56 ../tarWrite.c \
Ethan Yonker472f5062016-02-25 13:47:30 -060057 ../twrpDU.cpp \
58 ../progresstracking.cpp \
59 ../gui/twmsg.cpp
Ethan Yonker50381972014-02-11 11:44:06 -060060LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
61
62LOCAL_C_INCLUDES += bionic external/stlport/stlport
63LOCAL_SHARED_LIBRARIES := libc libtar libstlport libstdc++
64
65ifeq ($(TWHAVE_SELINUX), true)
66 LOCAL_C_INCLUDES += external/libselinux/include
67 LOCAL_SHARED_LIBRARIES += libselinux
Matt Mower666d1512015-11-11 23:10:50 -060068 LOCAL_CFLAGS += -DHAVE_SELINUX
Ethan Yonker50381972014-02-11 11:44:06 -060069endif
70ifneq ($(RECOVERY_SDCARD_ON_DATA),)
71 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
72endif
73ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
74 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
75else
76 LOCAL_SHARED_LIBRARIES += libopenaes
77endif
78
79LOCAL_MODULE:= twrpTar
Ethan Yonker960f0302014-12-21 21:54:00 -060080LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060081LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
82LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
83include $(BUILD_EXECUTABLE)