Browse Source

Merge pull request #808 from slashbeast/Makefiles-support-ar-cflags-cxxflags-ldflags-from-env

Makefiles fixes: support environmental passed $AR, $CFLAGS, $CXXFLAGS and $LDFLAGS
pull/810/head
trapexit 4 years ago
committed by GitHub
parent
commit
90081f4e61
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      Makefile
  2. 14
      libfuse/Makefile

15
Makefile

@ -61,13 +61,14 @@ SRC = $(wildcard src/*.cpp)
OBJS = $(SRC:src/%.cpp=build/%.o) OBJS = $(SRC:src/%.cpp=build/%.o)
DEPS = $(SRC:src/%.cpp=build/%.d) DEPS = $(SRC:src/%.cpp=build/%.d)
MANPAGE = mergerfs.1 MANPAGE = mergerfs.1
CXXFLAGS = \
CXXFLAGS ?= ${OPT_FLAGS}
CXXFLAGS := \
${CXXFLAGS} \
-std=c++0x \ -std=c++0x \
$(OPT_FLAGS) \
$(STATIC_FLAGS) \ $(STATIC_FLAGS) \
$(LTO_FLAGS) \ $(LTO_FLAGS) \
-Wall \ -Wall \
-Wno-unused-result \
-Wno-unused-result \
-MMD -MMD
FUSE_FLAGS = \ FUSE_FLAGS = \
-Ilibfuse/include \ -Ilibfuse/include \
@ -76,9 +77,11 @@ FUSE_FLAGS = \
MFS_FLAGS = \ MFS_FLAGS = \
-DUSE_XATTR=$(USE_XATTR) \ -DUSE_XATTR=$(USE_XATTR) \
-DUGID_USE_RWLOCK=$(UGID_USE_RWLOCK) -DUGID_USE_RWLOCK=$(UGID_USE_RWLOCK)
LDFLAGS = \
-pthread \
-lrt
LDFLAGS := \
${LDFLAGS} \
-pthread \
-lrt
DESTDIR = DESTDIR =
PREFIX = /usr/local PREFIX = /usr/local

14
libfuse/Makefile

@ -29,6 +29,8 @@ INSTALLBINDIR = $(DESTDIR)$(BINDIR)
INSTALLSBINDIR = $(DESTDIR)$(SBINDIR) INSTALLSBINDIR = $(DESTDIR)$(SBINDIR)
INSTALLMAN1DIR = $(DESTDIR)$(MAN1DIR) INSTALLMAN1DIR = $(DESTDIR)$(MAN1DIR)
AR ?= ar
SRC = \ SRC = \
lib/buffer.c \ lib/buffer.c \
lib/cuse_lowlevel.c \ lib/cuse_lowlevel.c \
@ -46,9 +48,10 @@ SRC = \
lib/mount.c lib/mount.c
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 = \
$(OPT_FLAGS) \
CFLAGS ?= \
$(OPT_FLAGS)
CFLAGS := \
${CFLAGS} \
-Wall \ -Wall \
-pipe \ -pipe \
-MMD -MMD
@ -61,7 +64,8 @@ FUSE_FLAGS = \
-DFUSE_USE_VERSION=29 \ -DFUSE_USE_VERSION=29 \
-DPACKAGE_VERSION=\"$(VERSION)\" \ -DPACKAGE_VERSION=\"$(VERSION)\" \
-DFUSERMOUNT_DIR=\"$(FUSERMOUNT_DIR)\" -DFUSERMOUNT_DIR=\"$(FUSERMOUNT_DIR)\"
LDFLAGS = \
LDFLAGS := \
${LDFLAGS} \
-lrt \ -lrt \
-pthread -pthread
@ -78,7 +82,7 @@ objects: build/config.h
$(MAKE) $(OBJS) $(MAKE) $(OBJS)
build/libfuse.a: objects build/libfuse.a: objects
ar rcs build/libfuse.a $(OBJS)
${AR} rcs build/libfuse.a $(OBJS)
utils: mergerfs-fusermount mount.mergerfs utils: mergerfs-fusermount mount.mergerfs

Loading…
Cancel
Save