blob: 6ff8fc92e978271b3ef4b88d174b80a83ae3f51a [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)
bigbiffa957f072021-03-07 18:20:29 -050017 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt
18 LOCAL_CFLAGS += -DUSE_FSCRYPT
bigbiff2e344ab2021-05-07 10:41:55 -040019 ifeq ($(TW_USE_FSCRYPT_POLICY), 1)
20 LOCAL_CFLAGS += -DUSE_FSCRYPT_POLICY_V1
21 else
22 LOCAL_CFLAGS += -DUSE_FSCRYPT_POLICY_V2
23 endif
bigbiffa957f072021-03-07 18:20:29 -050024 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/fscrypt
Vojtech Bocek25fd68d2013-08-27 03:10:10 +020025endif
26
DarthJabba9247c68b2020-10-11 16:47:56 +010027ifeq ($(TW_LIBTAR_DEBUG),true)
28 LOCAL_CFLAGS += -DTW_LIBTAR_DEBUG
29endif
30
bigbiff bigbiff9c754052013-01-09 09:09:08 -050031include $(BUILD_SHARED_LIBRARY)
32
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060033# Build static library
34include $(CLEAR_VARS)
35
36LOCAL_MODULE := libtar_static
bigbiffd58ba182020-03-23 10:02:29 -040037LOCAL_MODULE_TAGS := optional
Ethan Yonker8d039f72017-02-03 14:26:15 -060038LOCAL_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 -060039LOCAL_C_INCLUDES += $(LOCAL_PATH) \
Ethan Yonker79f88bd2016-12-09 14:52:12 -060040 external/zlib
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060041LOCAL_STATIC_LIBRARIES += libz libc
42
Matt Mower87413642017-01-17 21:14:46 -060043LOCAL_C_INCLUDES += external/libselinux/include
44LOCAL_STATIC_LIBRARIES += libselinux
Ethan Yonker79f88bd2016-12-09 14:52:12 -060045
46ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiffa957f072021-03-07 18:20:29 -050047 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt
48 LOCAL_CFLAGS += -DUSE_FSCRYPT
49 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../crypto/fscrypt
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060050endif
51
DarthJabba9247c68b2020-10-11 16:47:56 +010052ifeq ($(TW_LIBTAR_DEBUG),true)
53 LOCAL_CFLAGS += -DTW_LIBTAR_DEBUG
54endif
55
Ethan Yonkerccb0cf72014-02-11 11:42:45 -060056include $(BUILD_STATIC_LIBRARY)