|
@ -1,5 +1,4 @@ |
|
|
VERSION = "2.9.7-mergerfs_2.29.0" |
|
|
|
|
|
OPTS = -O2 |
|
|
|
|
|
|
|
|
VERSION = 2.9.7-mergerfs_2.29.0 |
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1) |
|
|
ifeq ($(DEBUG),1) |
|
|
DEBUG_FLAGS := -g |
|
|
DEBUG_FLAGS := -g |
|
@ -7,9 +6,20 @@ else |
|
|
DEBUG_FLAGS := |
|
|
DEBUG_FLAGS := |
|
|
endif |
|
|
endif |
|
|
|
|
|
|
|
|
DESTDIR = "/" |
|
|
|
|
|
BINDIR = "/bin" |
|
|
|
|
|
SBINDIR = "/sbin" |
|
|
|
|
|
|
|
|
DESTDIR = |
|
|
|
|
|
PREFIX = /usr/local |
|
|
|
|
|
EXEC_PREFIX = $(PREFIX) |
|
|
|
|
|
DATAROOTDIR = $(PREFIX)/share |
|
|
|
|
|
DATADIR = $(DATAROOTDIR) |
|
|
|
|
|
BINDIR = $(EXEC_PREFIX)/bin |
|
|
|
|
|
SBINDIR = $(EXEC_PREFIX)/sbin |
|
|
|
|
|
MANDIR = $(DATAROOTDIR)/man |
|
|
|
|
|
MAN1DIR = $(MANDIR)/man1 |
|
|
|
|
|
|
|
|
|
|
|
INSTALLBINDIR = $(DESTDIR)$(BINDIR) |
|
|
|
|
|
INSTALLSBINDIR = $(DESTDIR)$(SBINDIR) |
|
|
|
|
|
INSTALLMAN1DIR = $(DESTDIR)$(MAN1DIR) |
|
|
|
|
|
|
|
|
SRC = \
|
|
|
SRC = \
|
|
|
lib/buffer.c \
|
|
|
lib/buffer.c \
|
|
|
lib/cuse_lowlevel.c \
|
|
|
lib/cuse_lowlevel.c \
|
|
@ -27,24 +37,26 @@ SRC = \ |
|
|
OBJS = $(SRC:lib/%.c=build/%.o) |
|
|
OBJS = $(SRC:lib/%.c=build/%.o) |
|
|
DEPS = $(SRC:lib/%.c=build/%.d) |
|
|
DEPS = $(SRC:lib/%.c=build/%.d) |
|
|
|
|
|
|
|
|
CFLAGS += \
|
|
|
|
|
|
$(OPTS) \
|
|
|
|
|
|
|
|
|
CFLAGS = \
|
|
|
|
|
|
-O2 \
|
|
|
$(DEBUG_FLAGS) \
|
|
|
$(DEBUG_FLAGS) \
|
|
|
-Wall \
|
|
|
-Wall \
|
|
|
-pipe \
|
|
|
-pipe \
|
|
|
'-D_FILE_OFFSET_BITS=64' \
|
|
|
|
|
|
'-D_REENTRANT' \
|
|
|
|
|
|
'-DFUSE_USE_VERSION=29' \
|
|
|
|
|
|
'-DFUSERMOUNT_DIR="/usr/local/bin"' \
|
|
|
|
|
|
'-DPACKAGE_VERSION=$(VERSION)' \
|
|
|
|
|
|
|
|
|
-MMD |
|
|
|
|
|
FUSERMOUNT_DIR = $(BINDIR) |
|
|
|
|
|
FUSE_FLAGS = \
|
|
|
-Iinclude \
|
|
|
-Iinclude \
|
|
|
-Ibuild \
|
|
|
-Ibuild \
|
|
|
-MMD |
|
|
|
|
|
LDFLAGS += \
|
|
|
|
|
|
|
|
|
-D_REENTRANT \
|
|
|
|
|
|
-D_FILE_OFFSET_BITS=64 \
|
|
|
|
|
|
-DFUSE_USE_VERSION=29 \
|
|
|
|
|
|
-DPACKAGE_VERSION=\"$(VERSION)\" \
|
|
|
|
|
|
-DFUSERMOUNT_DIR=\"$(FUSERMOUNT_DIR)\" |
|
|
|
|
|
LDFLAGS = \
|
|
|
-lrt \
|
|
|
-lrt \
|
|
|
-pthread |
|
|
-pthread |
|
|
|
|
|
|
|
|
all: build/libfuse.a |
|
|
|
|
|
|
|
|
all: build/libfuse.a mount.mergerfs mergerfs-fusermount |
|
|
|
|
|
|
|
|
build/config.h: build/stamp |
|
|
build/config.h: build/stamp |
|
|
ecfd/build | tee build/config.h |
|
|
ecfd/build | tee build/config.h |
|
@ -59,26 +71,34 @@ objects: build/config.h |
|
|
build/libfuse.a: objects |
|
|
build/libfuse.a: objects |
|
|
ar rcs build/libfuse.a $(OBJS) |
|
|
ar rcs build/libfuse.a $(OBJS) |
|
|
|
|
|
|
|
|
build/mergerfs-mount: build/config.h util/fusermount.c lib/mount_util.c |
|
|
|
|
|
$(CC) $(CFLAGS) -Ilib -o mergerfs-mount util/fusermount.c lib/mount_util.c |
|
|
|
|
|
|
|
|
build/mergerfs-fusermount: build/config.h util/fusermount.c lib/mount_util.c |
|
|
|
|
|
$(CC) $(CFLAGS) $(FUSE_FLAGS) -Ilib -o build/mergerfs-fusermount util/fusermount.c lib/mount_util.c |
|
|
|
|
|
|
|
|
build/mount.mergerfs: build/libfuse.a util/mount.fuse.c |
|
|
|
|
|
$(CC) $(CFLAGS) -o mount.mergerfs util/mount.fuse.c build/libfuse.a $(LDFLAGS) |
|
|
|
|
|
|
|
|
mergerfs-fusermount: build/mergerfs-fusermount |
|
|
|
|
|
|
|
|
|
|
|
build/mount.mergerfs: build/libfuse.a util/mount.mergerfs.c |
|
|
|
|
|
$(CC) $(CFLAGS) $(FUSE_FLAGS) -o build/mount.mergerfs util/mount.mergerfs.c build/libfuse.a $(LDFLAGS) |
|
|
|
|
|
|
|
|
|
|
|
mount.mergerfs: build/mount.mergerfs |
|
|
|
|
|
|
|
|
build/%.o: lib/%.c |
|
|
build/%.o: lib/%.c |
|
|
$(CC) $(CFLAGS) -c $< -o $@ |
|
|
|
|
|
|
|
|
$(CC) $(CFLAGS) $(FUSE_FLAGS) -c $< -o $@ |
|
|
|
|
|
|
|
|
clean: |
|
|
clean: |
|
|
rm -rf build |
|
|
rm -rf build |
|
|
|
|
|
|
|
|
distclean: clean |
|
|
distclean: clean |
|
|
|
|
|
|
|
|
install: build/mergerfs-mount build/mount.mergerfs |
|
|
|
|
|
install -D build/mergerfs-mount "$(DESTDIR)$(BINDIR)/mergerfs-mount" |
|
|
|
|
|
chown root:root "$(DESTDIR)$(BINDIR)/mergerfs-mount" |
|
|
|
|
|
chmod u+s "$(DESTDIR)$(BINDIR)/mergerfs-mount" |
|
|
|
|
|
install -D build/mount.mergerfs "$(DESTDIR)$(SBINDIR)/mount.mergerfs" |
|
|
|
|
|
|
|
|
strip: |
|
|
|
|
|
strip --strip-all build/mount.mergerfs |
|
|
|
|
|
strip --strip-all build/mergerfs-fusermount |
|
|
|
|
|
|
|
|
|
|
|
install: mergerfs-fusermount mount.mergerfs strip |
|
|
|
|
|
install -D build/mergerfs-fusermount "$(INSTALLBINDIR)/mergerfs-fusermount" |
|
|
|
|
|
install -D build/mount.mergerfs "$(INSTALLSBINDIR)/mount.mergerfs" |
|
|
|
|
|
chown root:root "$(INSTALLBINDIR)/mergerfs-fusermount" |
|
|
|
|
|
chmod u+s "$(INSTALLBINDIR)/mergerfs-fusermount" |
|
|
|
|
|
|
|
|
.PHONY: objects |
|
|
|
|
|
|
|
|
.PHONY: objects strip |
|
|
|
|
|
|
|
|
-include $(DEPS) |
|
|
-include $(DEPS) |