blob: a80b4de57f9bd765c3f8adab28d1040599d37661 [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 Yonker3fdcda42016-11-30 12:29:37 -060011 ../exclude.cpp \
Ethan Yonker472f5062016-02-25 13:47:30 -060012 ../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 Yonker3fdcda42016-11-30 12:29:37 -060018LOCAL_STATIC_LIBRARIES := libc libtar_static libz
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
Matt Mower87413642017-01-17 21:14:46 -060025LOCAL_C_INCLUDES += external/libselinux/include
26LOCAL_STATIC_LIBRARIES += libselinux
27
Ethan Yonker50381972014-02-11 11:44:06 -060028ifneq ($(RECOVERY_SDCARD_ON_DATA),)
29 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
30endif
31ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
32 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
33else
34 LOCAL_STATIC_LIBRARIES += libopenaes_static
35endif
36
37LOCAL_MODULE:= twrpTar_static
38LOCAL_FORCE_STATIC_EXECUTABLE := true
Ethan Yonker960f0302014-12-21 21:54:00 -060039LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060040LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
41LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
42include $(BUILD_EXECUTABLE)
43
44
45# Build shared binary
46include $(CLEAR_VARS)
47
48LOCAL_SRC_FILES:= \
49 twrpTarMain.cpp \
50 ../twrp-functions.cpp \
51 ../twrpTar.cpp \
52 ../tarWrite.c \
Ethan Yonker3fdcda42016-11-30 12:29:37 -060053 ../exclude.cpp \
Ethan Yonker472f5062016-02-25 13:47:30 -060054 ../progresstracking.cpp \
55 ../gui/twmsg.cpp
Ethan Yonker50381972014-02-11 11:44:06 -060056LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
57
Ethan Yonker534d4e02016-08-26 10:05:03 -050058LOCAL_C_INCLUDES += bionic
Ethan Yonker3fdcda42016-11-30 12:29:37 -060059LOCAL_SHARED_LIBRARIES := libc libtar libz
Ethan Yonker534d4e02016-08-26 10:05:03 -050060ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
61 LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
62 LOCAL_SHARED_LIBRARIES += libstlport_static
63endif
64LOCAL_SHARED_LIBRARIES += libstdc++
Ethan Yonker50381972014-02-11 11:44:06 -060065
Matt Mower87413642017-01-17 21:14:46 -060066LOCAL_C_INCLUDES += external/libselinux/include
67LOCAL_SHARED_LIBRARIES += libselinux
68
Ethan Yonker50381972014-02-11 11:44:06 -060069ifneq ($(RECOVERY_SDCARD_ON_DATA),)
70 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
71endif
72ifeq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
73 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
74else
75 LOCAL_SHARED_LIBRARIES += libopenaes
76endif
77
78LOCAL_MODULE:= twrpTar
Ethan Yonker960f0302014-12-21 21:54:00 -060079LOCAL_MODULE_TAGS:= optional
Ethan Yonker50381972014-02-11 11:44:06 -060080LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
81LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
82include $(BUILD_EXECUTABLE)