aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamad Ayyash <mkayyash@google.com>2015-02-23 15:27:46 -0800
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 16:43:48 -0800
commit72508e4b4e7e6170c859f52c3c4c4323007ff5af (patch)
tree769fd2fc9e091d1fb4af5f3a1119982c8d899d23
parent1eda7b88329333e6c3eccce26982dc7058bc9392 (diff)
downloadsquashfs-tools-72508e4b4e7e6170c859f52c3c4c4323007ff5af.tar.gz
squashfs-tools: Introduce Android.mk.
squashfs-tools now builds and runs on linux with gzip compression. Change-Id: I1188cb4045f035227023a29c1c7672b356e53aea Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
-rw-r--r--Android.mk5
-rw-r--r--squashfs-tools/Android.mk70
2 files changed, 75 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..d81662e
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,5 @@
+# Copyright (C) 2015 The Android Open Source Project
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/squashfs-tools/Android.mk b/squashfs-tools/Android.mk
new file mode 100644
index 0000000..5c5348e
--- /dev/null
+++ b/squashfs-tools/Android.mk
@@ -0,0 +1,70 @@
+# Copyright (C) 2015 The Android Open Source Project
+
+LOCAL_PATH:= $(call my-dir)
+
+# squashfs-tools depends on Linux Kernel specific headers (e.g. sysinfo.h).
+ifeq ($(HOST_OS),linux)
+
+include $(CLEAR_VARS)
+
+# The LOCAL_MODULE name is referenced by the code. Don't change it.
+LOCAL_MODULE := mksquashfs
+
+mksquashfs_files := mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \
+ sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \
+ info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h
+
+read_fs_files := read_fs.c squashfs_fs.h squashfs_swap.h compressor.h xattr.h \
+ error.h mksquashfs.h
+
+sort_files := sort.c squashfs_fs.h mksquashfs.h sort.h error.h progressbar.h
+
+swap_files := swap.c
+
+pseudo_files := pseudo.c pseudo.h error.h progressbar.h
+
+compressor_files := compressor.c compressor.h squashfs_fs.h
+
+xattr_files := xattr.c squashfs_fs.h squashfs_swap.h mksquashfs.h xattr.h error.h \
+ progressbar.h
+
+read_xattrs_files := read_xattrs.c squashfs_fs.h squashfs_swap.h xattr.h error.h
+
+action_files := action.c squashfs_fs.h mksquashfs.h action.h error.h
+
+progressbar_files := progressbar.c error.h
+
+read_file_files := read_file.c error.h
+
+info_files := info.c squashfs_fs.h mksquashfs.h error.h progressbar.h \
+ caches-queues-lists.h
+
+restore_files := restore.c caches-queues-lists.h squashfs_fs.h mksquashfs.h error.h \
+ progressbar.h info.h
+
+process_fragments_files := process_fragments.c process_fragments.h
+
+caches_queues_lists_files := caches-queues-lists.c error.h caches-queues-lists.h
+
+gzip_wrapper_files := gzip_wrapper.c squashfs_fs.h gzip_wrapper.h compressor.h
+
+# TODO: Uncomment and include when lz4 source is running.
+# lz4_wrapper_files := lz4_wrapper.c squashfs_fs.h lz4_wrapper.h compressor.h
+
+LOCAL_SRC_FILES := $(mksquashfs_files) $(read_fs_files) $(action_files) $(swap_files) \
+ $(pseudo_files) $(compressor_files) $(sort_files) $(progressbar_files) \
+ $(read_file_files) $(info_files) $(restore_files) \
+ $(process_fragments_files) $(caches_queues_lists_files) $(xattr_files) \
+ $(read_xattrs_files) $(gzip_wrapper_files)
+
+# TODO: Replace gzip with lz4 support once lz4 lib is running.
+LOCAL_CFLAGS := -I -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -Wall \
+ -DCOMP_DEFAULT="\"gzip\"" -DGZIP_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT
+
+LOCAL_LDLIBS := -lpthread -lm -lz
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_EXECUTABLE)
+
+endif