958b8bd77dc7ace5b89d9e3f154db3403498eeb0
[platform/upstream/btrfs-progs.git] / Android.mk
1 LOCAL_PATH:= $(call my-dir)
2
3 #include $(call all-subdir-makefiles)
4
5 CFLAGS := -g -O1 -Wall -D_FORTIFY_SOURCE=2 -include config.h \
6         -DBTRFS_FLAT_INCLUDES -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC
7
8 LDFLAGS := -static -rdynamic
9
10 LIBS := -luuid   -lblkid   -lz   -llzo2 -L. -lpthread
11 LIBBTRFS_LIBS := $(LIBS)
12
13 STATIC_CFLAGS := $(CFLAGS) -ffunction-sections -fdata-sections
14 STATIC_LDFLAGS := -static -Wl,--gc-sections
15 STATIC_LIBS := -luuid   -lblkid -luuid -lz   -llzo2 -L. -pthread
16
17 btrfs_shared_libraries := libext2_uuid \
18                         libext2_blkid
19
20 objects := ctree.c disk-io.c kernel-lib/radix-tree.c extent-tree.c print-tree.c \
21           root-tree.c dir-item.c file-item.c inode-item.c inode-map.c \
22           extent-cache.c extent_io.c volumes.c utils.c repair.c \
23           qgroup.c free-space-cache.c kernel-lib/list_sort.c props.c \
24           kernel-shared/ulist.c qgroup-verify.c backref.c string-table.c task-utils.c \
25           inode.c file.c find-root.c free-space-tree.c help.c send-dump.c \
26           fsfeatures.c kernel-lib/tables.c kernel-lib/raid56.c transaction.c
27 cmds_objects := cmds-subvolume.c cmds-filesystem.c cmds-device.c cmds-scrub.c \
28                cmds-inspect.c cmds-balance.c cmds-send.c cmds-receive.c \
29                cmds-quota.c cmds-qgroup.c cmds-replace.c cmds-check.c \
30                cmds-restore.c cmds-rescue.c chunk-recover.c super-recover.c \
31                cmds-property.c cmds-fi-usage.c cmds-inspect-dump-tree.c \
32                cmds-inspect-dump-super.c cmds-inspect-tree-stats.c cmds-fi-du.c \
33                mkfs/common.c
34 libbtrfs_objects := send-stream.c send-utils.c kernel-lib/rbtree.c btrfs-list.c \
35                    kernel-lib/crc32c.c messages.c \
36                    uuid-tree.c utils-lib.c rbtree-utils.c
37 libbtrfs_headers := send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
38                    kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
39                    kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
40                    extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
41 TESTS := fsck-tests.sh convert-tests.sh
42 blkid_objects := partition/ superblocks/ topology/
43
44
45 # external/e2fsprogs/lib is needed for uuid/uuid.h
46 common_C_INCLUDES := $(LOCAL_PATH) external/e2fsprogs/lib/ external/lzo/include/ external/zlib/
47
48 #----------------------------------------------------------
49 include $(CLEAR_VARS)
50 LOCAL_SRC_FILES := $(libbtrfs_objects)
51 LOCAL_CFLAGS := $(STATIC_CFLAGS)
52 LOCAL_MODULE := libbtrfs
53 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
54 include $(BUILD_STATIC_LIBRARY)
55
56 #----------------------------------------------------------
57 include $(CLEAR_VARS)
58 LOCAL_MODULE := btrfs
59 #LOCAL_FORCE_STATIC_EXECUTABLE := true
60 LOCAL_SRC_FILES := \
61                 $(objects) \
62                 $(cmds_objects) \
63                 btrfs.c \
64                 help.c \
65
66 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
67 LOCAL_CFLAGS := $(STATIC_CFLAGS)
68 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
69 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
70 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
71 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static libz
72 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
73
74 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
75 #LOCAL_MODULE_TAGS := optional
76 include $(BUILD_EXECUTABLE)
77
78 #----------------------------------------------------------
79 include $(CLEAR_VARS)
80 LOCAL_MODULE := mkfs.btrfs
81 LOCAL_SRC_FILES := \
82                 $(objects) \
83                 mkfs/common.c \
84                 mkfs/main.c
85
86 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
87 LOCAL_CFLAGS := $(STATIC_CFLAGS)
88 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
89 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
90 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
91 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
92 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
93
94 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
95 #LOCAL_MODULE_TAGS := optional
96 include $(BUILD_EXECUTABLE)
97
98 #---------------------------------------------------------------
99 include $(CLEAR_VARS)
100 LOCAL_MODULE := btrfstune
101 LOCAL_SRC_FILES := \
102                 $(objects) \
103                 btrfstune.c
104
105 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
106 LOCAL_CFLAGS := $(STATIC_CFLAGS)
107 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
108 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
109 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
110 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
111 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
112 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
113
114 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
115 LOCAL_MODULE_TAGS := optional
116 include $(BUILD_EXECUTABLE)
117 #--------------------------------------------------------------