blob: 9b051e68f1e624c125639e3390b016e1255d0baa [file] [log] [blame]
bigbiff bigbiff9c754052013-01-09 09:09:08 -05001LOCAL_PATH := $(call my-dir)
2
Ethan Yonkerccb0cf72014-02-11 11:42:45 -06003# Build shared library
bigbiff bigbiff9c754052013-01-09 09:09:08 -05004include $(CLEAR_VARS)
5
6LOCAL_MODULE := libtar
bigbiffd58ba182020-03-23 10:02:29 -04007LOCAL_MODULE_TAGS := optional
Ethan Yonker8d039f72017-02-03 14:26:15 -06008LOCAL_SRC_FILES := append.c block.c decode.c encode.c extract.c handle.c output.c util.c wrapper.c basename.c strmode.c libtar_hash.c libtar_list.c dirname.c android_utils.c
bigbiff bigbiff9c754052013-01-09 09:09:08 -05009LOCAL_C_INCLUDES += $(LOCAL_PATH) \
Ethan Yonker79f88bd2016-12-09 14:52:12 -060010 external/zlib
bigbiff bigbiff9c754052013-01-09 09:09:08 -050011LOCAL_SHARED_LIBRARIES += libz libc
12
Matt Mower87413642017-01-17 21:14:46 -060013LOCAL_C_INCLUDES += external/libselinux/include
14LOCAL_SHARED_LIBRARIES += libselinux
Ethan Yonker79f88bd2016-12-09 14:52:12 -060015
16ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiff7ba75002020-04-11 20:47:09 -040017 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 29; echo $$?),0)
18 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt
19 LOCAL_CFLAGS += -DUSE_FSCRYPT
20 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/fscrypt
21 else
22 LOCAL_SHARED_LIBRARIES += libe4crypt
23 LOCAL_CFLAGS += -DHAVE_EXT4_CRYPT
24 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/ext4crypt
25 endif
Vojtech Bocek25fd68d2013-08-27 03:10:10 +020026endif
27
DarthJabba9247c68b2020-10-11 16:47:56 +010028ifeq ($(TW_LIBTAR_DEBUG),true)
29 LOCAL_CFLAGS += -DTW_LIBTAR_DEBUG
30endif
31
bigbiff bigbiff9c754052013-01-09 09:09:08 -050032include $(BUILD_SHARED_LIBRARY)
33
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060034# Build static library
35include $(CLEAR_VARS)
36
37LOCAL_MODULE := libtar_static
bigbiffd58ba182020-03-23 10:02:29 -040038LOCAL_MODULE_TAGS := optional
Ethan Yonker8d039f72017-02-03 14:26:15 -060039LOCAL_SRC_FILES := append.c block.c decode.c encode.c extract.c handle.c output.c util.c wrapper.c basename.c strmode.c libtar_hash.c libtar_list.c dirname.c android_utils.c
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060040LOCAL_C_INCLUDES += $(LOCAL_PATH) \
Ethan Yonker79f88bd2016-12-09 14:52:12 -060041 external/zlib
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060042LOCAL_STATIC_LIBRARIES += libz libc
43
Matt Mower87413642017-01-17 21:14:46 -060044LOCAL_C_INCLUDES += external/libselinux/include
45LOCAL_STATIC_LIBRARIES += libselinux
Ethan Yonker79f88bd2016-12-09 14:52:12 -060046
47ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiff7ba75002020-04-11 20:47:09 -040048 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 29; echo $$?),0)
49 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt
50 LOCAL_CFLAGS += -DUSE_FSCRYPT
51 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/fscrypt
52 else
53 LOCAL_SHARED_LIBRARIES += libe4crypt
54 LOCAL_CFLAGS += -DHAVE_EXT4_CRYPT
55 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/ext4crypt
56 endif
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060057endif
58
DarthJabba9247c68b2020-10-11 16:47:56 +010059ifeq ($(TW_LIBTAR_DEBUG),true)
60 LOCAL_CFLAGS += -DTW_LIBTAR_DEBUG
61endif
62
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060063include $(BUILD_STATIC_LIBRARY)