summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in30
1 files changed, 29 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 0a1aece7..ac6b353b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,11 +6,14 @@
# test run the full testsuite
# install install to default location (/usr/local)
# clean clean built binaries (not the documentation)
+# clean-all clean as above, clean docs and generated files
#
# Tuning by variables (environment or make arguments):
# V=1 verbose, print command lines (default: quiet)
# C=1 run checker before compilation (default checker: sparse)
+# D=1 debugging build, turn off optimizations
# W=123 build with warnings (default: off)
+# DEBUG_CFLAGS additional compiler flags for debugging build
# EXTRA_CFLAGS additional compiler flags
# EXTRA_LDFLAGS additional linker flags
#
@@ -36,13 +39,20 @@ DISABLE_BTRFSCONVERT = @DISABLE_BTRFSCONVERT@
EXTRA_CFLAGS :=
EXTRA_LDFLAGS :=
+DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3
+DEBUG_CFLAGS_INTERNAL =
+DEBUG_CFLAGS :=
+
# Common build flags
CFLAGS = @CFLAGS@ \
-include config.h \
-DBTRFS_FLAT_INCLUDES \
-D_XOPEN_SOURCE=700 \
-fno-strict-aliasing \
- -fPIC $(EXTRAWARN_CFLAGS) $(EXTRA_CFLAGS)
+ -fPIC \
+ $(EXTRAWARN_CFLAGS) \
+ $(DEBUG_CFLAGS_INTERNAL) \
+ $(EXTRA_CFLAGS)
LDFLAGS = @LDFLAGS@ \
-rdynamic $(EXTRA_LDFLAGS)
@@ -84,11 +94,15 @@ libbtrfs_headers = send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \
extent_io.h ioctl.h ctree.h btrfsck.h version.h
TESTS = fsck-tests.sh convert-tests.sh
+udev_rules = 64-btrfs-dm.rules
+
prefix ?= @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir ?= @libdir@
incdir = @includedir@/btrfs
+udevdir = @UDEVDIR@
+udevruledir = ${udevdir}/rules.d
ifeq ("$(origin V)", "command line")
BUILD_VERBOSE = $(V)
@@ -103,6 +117,10 @@ else
Q = @
endif
+ifeq ("$(origin D)", "command line")
+ DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS)
+endif
+
MAKEOPTS = --no-print-directory Q=$(Q)
# build all by default
@@ -224,6 +242,12 @@ test-clean:
@echo "Cleaning tests"
$(Q)bash tests/clean-tests.sh
+test-inst: all
+ @tmpdest=`mktemp --tmpdir -d btrfs-inst.XXXXXX` && \
+ echo "Test installation to $$tmpdest" && \
+ $(MAKE) DESTDIR=$$tmpdest install && \
+ $(RM) -rf -- $$tmpdest
+
test: test-fsck test-mkfs test-convert test-misc test-fuzz
#
@@ -390,6 +414,10 @@ install: $(libs) $(progs_install) $(INSTALLDIRS)
cp -a $(lib_links) $(DESTDIR)$(libdir)
$(INSTALL) -m755 -d $(DESTDIR)$(incdir)
$(INSTALL) -m644 $(headers) $(DESTDIR)$(incdir)
+ifneq ($(udevdir),)
+ $(INSTALL) -m755 -d $(DESTDIR)$(udevruledir)
+ $(INSTALL) -m644 $(udev_rules) $(DESTDIR)$(udevruledir)
+endif
install-static: $(progs_static) $(INSTALLDIRS)
$(INSTALL) -m755 -d $(DESTDIR)$(bindir)