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.

84 lines
1.6 KiB

  1. VERSION = "2.9.7-mergerfs_2.28.0"
  2. OPTS = -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. OBJS = $(SRC:lib/%.c=build/%.o)
  26. DEPS = $(SRC:lib/%.c=build/%.d)
  27. CFLAGS += \
  28. $(OPTS) \
  29. $(DEBUG_FLAGS) \
  30. -Wall \
  31. -pipe \
  32. '-D_FILE_OFFSET_BITS=64' \
  33. '-D_REENTRANT' \
  34. '-DFUSE_USE_VERSION=29' \
  35. '-DFUSERMOUNT_DIR="/usr/local/bin"' \
  36. '-DPACKAGE_VERSION=$(VERSION)' \
  37. -Iinclude \
  38. -Ibuild \
  39. -MMD
  40. LDFLAGS += \
  41. -lrt \
  42. -pthread
  43. all: build/libfuse.a
  44. build/config.h: build/stamp
  45. ecfd/build | tee build/config.h
  46. build/stamp:
  47. mkdir -p build
  48. touch $@
  49. objects: build/config.h
  50. $(MAKE) $(OBJS)
  51. build/libfuse.a: objects
  52. ar rcs build/libfuse.a $(OBJS)
  53. build/mergerfs-mount: build/config.h util/fusermount.c lib/mount_util.c
  54. $(CC) $(CFLAGS) -Ilib -o mergerfs-mount util/fusermount.c lib/mount_util.c
  55. build/mount.mergerfs: build/libfuse.a util/mount.fuse.c
  56. $(CC) $(CFLAGS) -o mount.mergerfs util/mount.fuse.c build/libfuse.a $(LDFLAGS)
  57. build/%.o: lib/%.c
  58. $(CC) $(CFLAGS) -c $< -o $@
  59. clean:
  60. rm -rf build
  61. distclean: clean
  62. install: build/mergerfs-mount build/mount.mergerfs
  63. install -D build/mergerfs-mount "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  64. chown root:root "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  65. chmod u+s "$(DESTDIR)$(BINDIR)/mergerfs-mount"
  66. install -D build/mount.mergerfs "$(DESTDIR)$(SBINDIR)/mount.mergerfs"
  67. .PHONY: objects
  68. -include $(DEPS)