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 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 \
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 blkid_objects := partition/ superblocks/ topology/
44 # external/e2fsprogs/lib is needed for uuid/uuid.h
45 common_C_INCLUDES := $(LOCAL_PATH) external/e2fsprogs/lib/ external/lzo/include/ external/zlib/
47 #----------------------------------------------------------
49 LOCAL_SRC_FILES := $(libbtrfs_objects)
50 LOCAL_CFLAGS := $(STATIC_CFLAGS)
51 LOCAL_MODULE := libbtrfs
52 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
53 include $(BUILD_STATIC_LIBRARY)
55 #----------------------------------------------------------
58 #LOCAL_FORCE_STATIC_EXECUTABLE := true
65 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
66 LOCAL_CFLAGS := $(STATIC_CFLAGS)
67 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
68 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
69 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
70 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static libz
71 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
73 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
74 #LOCAL_MODULE_TAGS := optional
75 include $(BUILD_EXECUTABLE)
77 #----------------------------------------------------------
79 LOCAL_MODULE := mkfs.btrfs
85 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
86 LOCAL_CFLAGS := $(STATIC_CFLAGS)
87 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
88 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
89 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
90 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
91 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
93 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
94 #LOCAL_MODULE_TAGS := optional
95 include $(BUILD_EXECUTABLE)
97 #---------------------------------------------------------------
99 LOCAL_MODULE := btrfstune
104 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
105 LOCAL_CFLAGS := $(STATIC_CFLAGS)
106 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
107 #LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
108 #LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
109 LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
110 LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
111 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
113 LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
114 LOCAL_MODULE_TAGS := optional
115 include $(BUILD_EXECUTABLE)
116 #--------------------------------------------------------------