You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.6 KiB

  1. VERSION = "2.9.7-mergerfs_2.26.0"
  2. OPT = -O2
  3. ifeq ($(DEBUG),1)
  4. DEBUG_FLAGS := -g
  5. else
  6. DEBUG_FLAGS :=
  7. endif
  8. DESTDIR = "/"
  9. BINDIR = "/bin"
  10. SBINDIR = "/sbin"
  11. SRC = \
  12. lib/buffer.c \
  13. lib/cuse_lowlevel.c \
  14. lib/fuse.c \
  15. lib/fuse_kern_chan.c \
  16. lib/fuse_loop.c \
  17. lib/fuse_loop_mt.c \
  18. lib/fuse_lowlevel.c \
  19. lib/fuse_mt.c \
  20. lib/fuse_opt.c \
  21. lib/fuse_session.c \
  22. lib/fuse_signals.c \
  23. lib/helper.c \
  24. lib/mount.c
  25. OBJ = $(SRC:lib/%.c=obj/%.o)
  26. DEPS = $(OBJ:obj/%.o=obj/%.d)
  27. CFLAGS = $(OPT) \
  28. $(DEBUG_FLAGS) \
  29. -Wall \
  30. -pipe \
  31. '-D_FILE_OFFSET_BITS=64' \
  32. '-D_REENTRANT' \
  33. '-DFUSE_USE_VERSION=29' \
  34. '-DFUSERMOUNT_DIR="/usr/local/bin"' \
  35. '-DPACKAGE_VERSION=$(VERSION)' \
  36. -Iinclude \
  37. -MMD
  38. LDFLAGS = \
  39. -lrt \
  40. -pthread
  41. all: obj/libfuse.a
  42. libfuse.a: obj/libfuse.a
  43. include/config.h:
  44. ecfd/build | tee include/config.h
  45. obj/obj-stamp:
  46. mkdir -p obj
  47. touch $@
  48. obj/libfuse.a:
  49. $(MAKE) obj/obj-stamp
  50. $(MAKE) include/config.h
  51. $(MAKE) $(OBJ)
  52. ar rcs obj/libfuse.a $(OBJ)
  53. mergerfs-mount: include/config.h util/fusermount.c lib/mount_util.c
  54. $(CC) $(CFLAGS) -Ilib -o mergerfs-mount util/fusermount.c lib/mount_util.c
  55. mount.mergerfs: obj/libfuse.a util/mount.fuse.c
  56. $(CC) $(CFLAGS) -o mount.mergerfs util/mount.fuse.c obj/libfuse.a $(LDFLAGS)
  57. obj/%.o: lib/%.c
  58. $(CC) $(CFLAGS) -c $< -o $@
  59. clean:
  60. rm -rf obj include/config.h mergerfs-mount mount.mergerfs
  61. distclean: clean
  62. git clean -fdx
  63. install:
  64. install -D mergerfs-mount "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  65. chown root:root "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  66. chmod u+s "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  67. install -D mount.mergerfs "$(DESTDIR)$(SBINDIR)/mount.mergerfs"
  68. -include $(DEPS)