1 LOCAL_PATH:= $(call my-dir)
3 #include $(call all-subdir-makefiles)
5 CFLAGS := -g -O1 -Wall -D_FORTIFY_SOURCE=2 -include config.h \
6 -DBTRFS_FLAT_INCLUDES -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC
8 LDFLAGS := -static -rdynamic
10 LIBS := -luuid -lblkid -lz -llzo2 -L. -lpthread
11 LIBBTRFS_LIBS := $(LIBS)
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
17 btrfs_shared_libraries := libext2_uuid \
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
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 \
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/
45 # external/e2fsprogs/lib is needed for uuid/uuid.h
46 common_C_INCLUDES := $(LOCAL_PATH) external/e2fsprogs/lib/ external/lzo/include/ external/zlib/
48 #----------------------------------------------------------
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)
56 #----------------------------------------------------------
59 #LOCAL_FORCE_STATIC_EXECUTABLE := true
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
74 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
75 #LOCAL_MODULE_TAGS := optional
76 include $(BUILD_EXECUTABLE)
78 #----------------------------------------------------------
80 LOCAL_MODULE := mkfs.btrfs
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
94 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
95 #LOCAL_MODULE_TAGS := optional
96 include $(BUILD_EXECUTABLE)
98 #---------------------------------------------------------------
100 LOCAL_MODULE := btrfstune
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
114 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
115 LOCAL_MODULE_TAGS := optional
116 include $(BUILD_EXECUTABLE)
117 #--------------------------------------------------------------