blob: 71b9bcd00231d4a6fbca77a52b983e9b9a7ff54a [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
Xing0af1ac12015-11-27 11:19:37 -080017
Ethan Yonker472f5062016-02-25 13:47:30 -060018LOCAL_STATIC_LIBRARIES := libc libtar_static
Xing0af1ac12015-11-27 11:19:37 -080019ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
Ethan Yonker534d4e02016-08-26 10:05:03 -050020 LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
Xing0af1ac12015-11-27 11:19:37 -080021 LOCAL_STATIC_LIBRARIES += libstlport_static
22endif
Ethan Yonker472f5062016-02-25 13:47:30 -060023LOCAL_STATIC_LIBRARIES += libstdc++
Ethan Yonker50381972014-02-11 11:44:06 -060024
25ifeq ($(TWHAVE_SELINUX), true)
26 LOCAL_C_INCLUDES += external/libselinux/include
27 LOCAL_STATIC_LIBRARIES += libselinux
Matt Mower666d1512015-11-11 23:10:50 -060028 LOCAL_CFLAGS += -DHAVE_SELINUX
Ethan Yonker50381972014-02-11 11:44:06 -060029endif
30ifneq ($(RECOVERY_SDCARD_ON_DATA),)
31 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
32endif
33ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
34 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
35else
36 LOCAL_STATIC_LIBRARIES += libopenaes_static
37endif
38
39LOCAL_MODULE:= twrpTar_static
40LOCAL_FORCE_STATIC_EXECUTABLE := true
Ethan Yonker960f0302014-12-21 21:54:00 -060041LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060042LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
43LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
44include $(BUILD_EXECUTABLE)
45
46
47# Build shared binary
48include $(CLEAR_VARS)
49
50LOCAL_SRC_FILES:= \
51 twrpTarMain.cpp \
52 ../twrp-functions.cpp \
53 ../twrpTar.cpp \
54 ../tarWrite.c \
Ethan Yonker472f5062016-02-25 13:47:30 -060055 ../twrpDU.cpp \
56 ../progresstracking.cpp \
57 ../gui/twmsg.cpp
Ethan Yonker50381972014-02-11 11:44:06 -060058LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
59
Ethan Yonker534d4e02016-08-26 10:05:03 -050060LOCAL_C_INCLUDES += bionic
61LOCAL_SHARED_LIBRARIES := libc libtar
62ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
63 LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
64 LOCAL_SHARED_LIBRARIES += libstlport_static
65endif
66LOCAL_SHARED_LIBRARIES += libstdc++
Ethan Yonker50381972014-02-11 11:44:06 -060067
68ifeq ($(TWHAVE_SELINUX), true)
69 LOCAL_C_INCLUDES += external/libselinux/include
70 LOCAL_SHARED_LIBRARIES += libselinux
Matt Mower666d1512015-11-11 23:10:50 -060071 LOCAL_CFLAGS += -DHAVE_SELINUX
Ethan Yonker50381972014-02-11 11:44:06 -060072endif
73ifneq ($(RECOVERY_SDCARD_ON_DATA),)
74 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
75endif
76ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
77 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
78else
79 LOCAL_SHARED_LIBRARIES += libopenaes
80endif
81
82LOCAL_MODULE:= twrpTar
Ethan Yonker960f0302014-12-21 21:54:00 -060083LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060084LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
85LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
86include $(BUILD_EXECUTABLE)