3 # all all main tools and the shared library
4 # static build static bnaries, requires static version of the libraries
5 # test run the full testsuite
6 # install install to default location (/usr/local)
7 # clean clean built binaries (not the documentation)
8 # clean-all clean as above, clean docs and generated files
10 # Tuning by variables (environment or make arguments):
11 # V=1 verbose, print command lines (default: quiet)
12 # C=1 run checker before compilation (default checker: sparse)
13 # D=1 debugging build, turn off optimizations
14 # D=dflags dtto, turn on additional debugging features:
15 # verbose - print file:line along with error/warning messages
16 # trace - print trace before the error/warning messages
17 # abort - call abort() on first error (dumps core)
18 # all - shortcut for all of the above
19 # asan - enable address sanitizer compiler feature
20 # tsan - enable thread sanitizer compiler feature
21 # ubsan - undefined behaviour sanitizer compiler feature
22 # bcheck - extended build checks
23 # W=123 build with warnings (default: off)
24 # DEBUG_CFLAGS additional compiler flags for debugging build
25 # EXTRA_CFLAGS additional compiler flags
26 # EXTRA_LDFLAGS additional linker flags
28 # Testing-specific options (see also tests/README.md):
29 # TEST=GLOB run test(s) from directories matching GLOB
30 # TEST_LOG=tty print name of a command run via the execution helpers
31 # TEST_LOG=dump dump testing log file when a test fails
34 # CHECKER static checker binary to be called (default: sparse)
35 # CHECKER_FLAGS flags to pass to CHECKER, can override CFLAGS
38 # Export all variables to sub-makes by default
42 ifneq ($(MAKEFILE_INC_INCLUDED),yes)
43 $(error Makefile.inc not generated, please configure first)
47 CSCOPE_CMD := cscope -u -b -c -q
49 include Makefile.extrawarn
54 DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3
55 DEBUG_CFLAGS_INTERNAL =
58 DEBUG_LDFLAGS_DEFAULT =
59 DEBUG_LDFLAGS_INTERNAL =
62 TOPDIR := $(shell pwd)
65 CFLAGS = $(SUBST_CFLAGS) \
68 -DBTRFS_FLAT_INCLUDES \
70 -fno-strict-aliasing \
73 -I$(TOPDIR)/kernel-lib \
75 $(DEBUG_CFLAGS_INTERNAL) \
78 LDFLAGS = $(SUBST_LDFLAGS) \
79 -rdynamic -L$(TOPDIR) \
80 $(DEBUG_LDFLAGS_INTERNAL) \
84 LIBBTRFS_LIBS = $(LIBS_BASE)
86 # Static compilation flags
87 STATIC_CFLAGS = $(CFLAGS) -ffunction-sections -fdata-sections
88 STATIC_LDFLAGS = -static -Wl,--gc-sections
89 STATIC_LIBS = $(STATIC_LIBS_BASE)
91 # don't use FORTIFY with sparse because glibc with FORTIFY can
92 # generate so many sparse errors that sparse stops parsing,
93 # which masks real errors that we want to see.
95 check_defs := .cc-defines.h
96 CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \
97 -D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized -Wshadow -Wundef \
100 objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
101 root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
102 extent-cache.o extent_io.o volumes.o utils.o repair.o \
103 qgroup.o free-space-cache.o kernel-lib/list_sort.o props.o \
104 kernel-shared/ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \
105 inode.o file.o find-root.o free-space-tree.o help.o send-dump.o \
106 fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o
107 cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
108 cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
109 cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
110 cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
111 cmds-property.o cmds-fi-usage.o cmds-inspect-dump-tree.o \
112 cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \
114 libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
115 kernel-lib/crc32c.o messages.o \
116 uuid-tree.o utils-lib.o rbtree-utils.o
117 libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
118 kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
119 kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
120 extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
121 convert_objects = convert/main.o convert/common.o convert/source-fs.o \
122 convert/source-ext2.o convert/source-reiserfs.o
123 mkfs_objects = mkfs/main.o mkfs/common.o
125 TESTS = fsck-tests.sh convert-tests.sh
127 udev_rules = 64-btrfs-dm.rules
129 ifeq ("$(origin V)", "command line")
136 ifeq ($(BUILD_VERBOSE),1)
142 ifeq ("$(origin D)", "command line")
143 DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS)
144 DEBUG_LDFLAGS_INTERNAL = $(DEBUG_LDFLAGS_DEFAULT) $(DEBUG_LDFLAGS)
147 ifneq (,$(findstring verbose,$(D)))
148 DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
151 ifneq (,$(findstring trace,$(D)))
152 DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
155 ifneq (,$(findstring abort,$(D)))
156 DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
159 ifneq (,$(findstring all,$(D)))
160 DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
161 DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
162 DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
165 ifneq (,$(findstring asan,$(D)))
166 DEBUG_CFLAGS_INTERNAL += -fsanitize=address
167 DEBUG_LDFLAGS_INTERNAL += -fsanitize=address -lasan
170 ifneq (,$(findstring tsan,$(D)))
171 DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIC
172 DEBUG_LDFLAGS_INTERNAL += -fsanitize=thread -ltsan -pie
175 ifneq (,$(findstring ubsan,$(D)))
176 DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined
177 DEBUG_LDFLAGS_INTERNAL += -fsanitize=undefined -lubsan
180 ifneq (,$(findstring bcheck,$(D)))
181 DEBUG_CFLAGS_INTERNAL += -DDEBUG_BUILD_CHECKS
184 MAKEOPTS = --no-print-directory Q=$(Q)
186 # build all by default
187 progs = $(progs_install) btrfsck btrfs-corrupt-block
189 # install only selected
190 progs_install = btrfs mkfs.btrfs btrfs-debug-tree \
191 btrfs-map-logical btrfs-image btrfs-zero-log \
192 btrfs-find-root btrfstune \
195 # other tools, not built by default
196 progs_extra = btrfs-fragments btrfs-calc-size btrfs-show-super
198 progs_static = $(foreach p,$(progs),$(p).static)
200 ifneq ($(DISABLE_BTRFSCONVERT),1)
201 progs_install += btrfs-convert
204 # external libs required by various binaries; for btrfs-foo,
205 # specify btrfs_foo_libs = <list of libs>; see $($(subst...)) rules below
206 btrfs_convert_cflags = -DBTRFSCONVERT_EXT2=$(BTRFSCONVERT_EXT2)
207 btrfs_convert_cflags += -DBTRFSCONVERT_REISERFS=$(BTRFSCONVERT_REISERFS)
208 btrfs_fragments_libs = -lgd -lpng -ljpeg -lfreetype
209 btrfs_debug_tree_objects = cmds-inspect-dump-tree.o
210 btrfs_show_super_objects = cmds-inspect-dump-super.o
211 btrfs_calc_size_objects = cmds-inspect-tree-stats.o
213 # collect values of the variables above
214 standalone_deps = $(foreach dep,$(patsubst %,%_objects,$(subst -,_,$(filter btrfs-%, $(progs)))),$($(dep)))
217 BUILDDIRS = $(patsubst %,build-%,$(SUBDIRS))
218 INSTALLDIRS = $(patsubst %,install-%,$(SUBDIRS))
219 CLEANDIRS = $(patsubst %,clean-%,$(SUBDIRS))
221 ifneq ($(DISABLE_DOCUMENTATION),1)
222 BUILDDIRS += build-Documentation
223 INSTALLDIRS += install-Documentation
228 .PHONY: $(INSTALLDIRS)
231 .PHONY: all install clean
234 # Create all the static targets
235 static_objects = $(patsubst %.o, %.static.o, $(objects))
236 static_cmds_objects = $(patsubst %.o, %.static.o, $(cmds_objects))
237 static_libbtrfs_objects = $(patsubst %.o, %.static.o, $(libbtrfs_objects))
238 static_convert_objects = $(patsubst %.o, %.static.o, $(convert_objects))
239 static_mkfs_objects = $(patsubst %.o, %.static.o, $(mkfs_objects))
241 libs_shared = libbtrfs.so.0.1
242 libs_static = libbtrfs.a
243 libs = $(libs_shared) $(libs_static)
244 lib_links = libbtrfs.so.0 libbtrfs.so
245 headers = $(libbtrfs_headers)
247 # make C=1 to enable sparse
249 # We're trying to use sparse against glibc headers which go wild
250 # trying to use internal compiler macros to test features. We
251 # copy gcc's and give them to sparse. But not __SIZE_TYPE__
252 # 'cause sparse defines that one.
254 dummy := $(shell $(CC) -dM -E -x c - < /dev/null | \
255 grep -v __SIZE_TYPE__ > $(check_defs))
264 $(Q)$(CC) -MD -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
267 # Pick from per-file variables, btrfs_*_cflags
270 @$(check_echo) " [SP] $<"
271 $(Q)$(check) $(CFLAGS) $(CHECKER_FLAGS) $<
273 $(Q)$(CC) $(CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.o=%)-cflags)) \
274 $($(subst -,_,btrfs-$(@:%/$(notdir $@)=%)-cflags))
278 $(Q)$(CC) $(STATIC_CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.static.o=%)-cflags)) \
279 $($(subst -,_,btrfs-$(@:%/$(notdir $@)=%)-cflags))
281 all: $(progs) libbtrfs $(BUILDDIRS)
282 $(SUBDIRS): $(BUILDDIRS)
284 @echo "Making all in $(patsubst build-%,%,$@)"
285 $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst build-%,%,$@)
287 test-convert: btrfs btrfs-convert
288 @echo " [TEST] convert-tests.sh"
289 $(Q)bash tests/convert-tests.sh
291 test-check: test-fsck
292 test-fsck: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune
293 @echo " [TEST] fsck-tests.sh"
294 $(Q)bash tests/fsck-tests.sh
296 test-misc: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune fssum \
297 btrfs-zero-log btrfs-find-root btrfs-select-super
298 @echo " [TEST] misc-tests.sh"
299 $(Q)bash tests/misc-tests.sh
301 test-mkfs: btrfs mkfs.btrfs
302 @echo " [TEST] mkfs-tests.sh"
303 $(Q)bash tests/mkfs-tests.sh
306 @echo " [TEST] fuzz-tests.sh"
307 $(Q)bash tests/fuzz-tests.sh
310 @echo " [TEST] cli-tests.sh"
311 $(Q)bash tests/cli-tests.sh
314 @echo "Cleaning tests"
315 $(Q)bash tests/clean-tests.sh
318 @tmpdest=`mktemp --tmpdir -d btrfs-inst.XXXXXX` && \
319 echo "Test installation to $$tmpdest" && \
320 $(MAKE) $(MAKEOPTS) DESTDIR=$$tmpdest install && \
321 $(RM) -rf -- $$tmpdest
323 test: test-fsck test-mkfs test-convert test-misc test-fuzz test-cli
326 # NOTE: For static compiles, you need to have all the required libs
327 # static equivalent available
329 static: $(progs_static)
331 version.h: version.sh version.h.in configure.ac
333 $(Q)bash ./config.status --silent $@
335 mktables: kernel-lib/mktables.c
337 $(Q)$(CC) $(CFLAGS) $< -o $@
339 # the target can be regenerated manually using mktables, but a local copy is
340 # kept so the build process is simpler
343 $(Q)./mktables > $@ || ($(RM) -f $@ && exit 1)
345 libbtrfs: $(libs_shared) $(lib_links)
347 $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
349 $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(LDFLAGS) $(LIBBTRFS_LIBS) \
350 -shared -Wl,-soname,libbtrfs.so.0 -o libbtrfs.so.0.1
352 $(libs_static): $(libbtrfs_objects)
354 $(Q)$(AR) cr libbtrfs.a $(libbtrfs_objects)
358 $(Q)$(LN_S) -f libbtrfs.so.0.1 $@
360 # keep intermediate files from the below implicit rules around
361 .PRECIOUS: $(addsuffix .o,$(progs))
363 # Make any btrfs-foo out of btrfs-foo.o, with appropriate libs.
364 # The $($(subst...)) bits below takes the btrfs_*_libs definitions above and
365 # turns them into a list of libraries to link against if they exist
367 # For static variants, use an extra $(subst) to get rid of the ".static"
368 # from the target name before translating to list of libs
370 btrfs-%.static: btrfs-%.static.o $(static_objects) $(patsubst %.o,%.static.o,$(standalone_deps)) $(static_libbtrfs_objects)
372 $(Q)$(CC) -o $@ $@.o $(static_objects) \
373 $(patsubst %.o, %.static.o, $($(subst -,_,$(subst .static,,$@)-objects))) \
374 $(static_libbtrfs_objects) $(STATIC_LDFLAGS) \
375 $($(subst -,_,$(subst .static,,$@)-libs)) $(STATIC_LIBS)
377 btrfs-%: btrfs-%.o $(objects) $(standalone_deps) $(libs_static)
379 $(Q)$(CC) -o $@ $(objects) $@.o \
380 $($(subst -,_,$@-objects)) \
382 $(LDFLAGS) $(LIBS) $($(subst -,_,$@-libs))
384 btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static)
386 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP)
388 btrfs.static: btrfs.static.o $(static_objects) $(static_cmds_objects) $(static_libbtrfs_objects)
390 $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP)
392 # For backward compatibility, 'btrfs' changes behaviour to fsck if it's named 'btrfsck'
395 $(Q)$(LN_S) -f btrfs btrfsck
397 btrfsck.static: btrfs.static
401 mkfs.btrfs: $(mkfs_objects) $(objects) $(libs_static)
403 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
405 mkfs.btrfs.static: $(static_mkfs_objects) $(static_objects) $(static_libbtrfs_objects)
407 $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS)
409 btrfstune: btrfstune.o $(objects) $(libs_static)
411 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
413 btrfstune.static: btrfstune.static.o $(static_objects) $(static_libbtrfs_objects)
415 $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS)
417 btrfs-image: image/main.o $(objects) $(libs_static)
419 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP)
421 btrfs-image.static: image/main.static.o $(static_objects) $(static_libbtrfs_objects)
423 $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(STATIC_LIBS) $(STATIC_LIBS_COMP)
425 btrfs-convert: $(convert_objects) $(objects) $(libs_static)
427 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(btrfs_convert_libs) $(LIBS)
429 btrfs-convert.static: $(static_convert_objects) $(static_objects) $(static_libbtrfs_objects)
431 $(Q)$(CC) -o $@ $^ $(STATIC_LDFLAGS) $(btrfs_convert_libs) $(STATIC_LIBS)
433 dir-test: dir-test.o $(objects) $(libs)
435 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
437 quick-test: quick-test.o $(objects) $(libs)
439 $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
441 ioctl-test.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
443 $(Q)$(CC) $(CFLAGS) -c $< -o $@
445 ioctl-test-32.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
447 $(Q)$(CC) $(CFLAGS) -m32 -c $< -o $@
449 ioctl-test-64.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
451 $(Q)$(CC) $(CFLAGS) -m64 -c $< -o $@
453 ioctl-test: ioctl-test.o
455 $(Q)$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
456 @echo " ?[PAHOLE] $@.pahole"
457 -$(Q)pahole $@ > $@.pahole
459 ioctl-test-32: ioctl-test-32.o
461 $(Q)$(CC) -m32 -o $@ $< $(LDFLAGS)
462 @echo " ?[PAHOLE] $@.pahole"
463 -$(Q)pahole $@ > $@.pahole
465 ioctl-test-64: ioctl-test-64.o
467 $(Q)$(CC) -m64 -o $@ $< $(LDFLAGS)
468 @echo " ?[PAHOLE] $@.pahole"
469 -$(Q)pahole $@ > $@.pahole
471 test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64
472 @echo " [TEST/ioctl]"
473 $(Q)./ioctl-test > ioctl-test.log
474 $(Q)./ioctl-test-32 > ioctl-test-32.log
475 $(Q)./ioctl-test-64 > ioctl-test-64.log
477 library-test: library-test.c $(libs_shared)
478 @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
479 $(Q)mkdir -p $(TMPD)/include/btrfs && \
480 cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
481 cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(TOPDIR)/,$^) -Wl,-rpath=$(TOPDIR) -lbtrfs
482 @echo " [TEST RUN] $@"
483 $(Q)cd $(TMPD) && ./$@
484 @echo " [TEST CLEAN] $@"
485 $(Q)$(RM) -rf -- $(TMPD)
487 library-test.static: library-test.c $(libs_static)
488 @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
489 $(Q)mkdir -p $(TMPD)/include/btrfs && \
490 cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
491 cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(TOPDIR)/,$^) $(STATIC_LDFLAGS) $(STATIC_LIBS)
492 @echo " [TEST RUN] $@"
493 $(Q)cd $(TMPD) && ./$@
494 @echo " [TEST CLEAN] $@"
495 $(Q)$(RM) -rf -- $(TMPD)
497 fssum: tests/fssum.c tests/sha224-256.c
499 $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
501 test-build: test-build-pre test-build-real
504 $(MAKE) $(MAKEOPTS) clean-all
509 $(MAKE) $(MAKEOPTS) library-test
510 -$(MAKE) $(MAKEOPTS) library-test.static
511 $(MAKE) $(MAKEOPTS) -j 8 all
512 -$(MAKE) $(MAKEOPTS) -j 8 static
513 $(MAKE) $(MAKEOPTS) -j 8 $(progs_extra)
516 $(Q)$(MAKE) $(MAKEOPTS) -C Documentation
519 @echo " [TAGS] $(TAGS_CMD)"
520 $(Q)$(TAGS_CMD) *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch]
523 @echo " [CSCOPE] $(CSCOPE_CMD)"
524 $(Q)ls -1 *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] > cscope.files
527 clean-all: clean clean-doc clean-gen
531 $(Q)$(RM) -f -- $(progs) *.o *.o.d \
532 kernel-lib/*.o kernel-lib/*.o.d \
533 kernel-shared/*.o kernel-shared/*.o.d \
534 image/*.o image/*.o.d \
535 convert/*.o convert/*.o.d \
536 mkfs/*.o mkfs/*.o.d \
537 dir-test ioctl-test quick-test library-test library-test-static \
538 mktables btrfs.static mkfs.btrfs.static fssum \
540 $(libs) $(lib_links) \
541 $(progs_static) $(progs_extra)
544 @echo "Cleaning Documentation"
545 $(Q)$(MAKE) $(MAKEOPTS) -C Documentation clean
548 @echo "Cleaning Generated Files"
549 $(Q)$(RM) -rf -- version.h config.status config.cache connfig.log \
550 configure.lineno config.status.lineno Makefile.inc \
551 Documentation/Makefile tags \
552 cscope.files cscope.out cscope.in.out cscope.po.out \
553 config.log config.h config.h.in~ aclocal.m4 \
554 configure autom4te.cache/ config/
557 @echo "Cleaning $(patsubst clean-%,%,$@)"
558 $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst clean-%,%,$@) clean
560 install: $(libs) $(progs_install) $(INSTALLDIRS)
561 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
562 $(INSTALL) $(progs_install) $(DESTDIR)$(bindir)
563 $(INSTALL) fsck.btrfs $(DESTDIR)$(bindir)
564 # btrfsck is a link to btrfs in the src tree, make it so for installed file as well
565 $(LN_S) -f btrfs $(DESTDIR)$(bindir)/btrfsck
566 $(INSTALL) -m755 -d $(DESTDIR)$(libdir)
567 $(INSTALL) $(libs) $(DESTDIR)$(libdir)
568 cp -a $(lib_links) $(DESTDIR)$(libdir)
569 $(INSTALL) -m755 -d $(DESTDIR)$(incdir)
570 $(INSTALL) -m644 $(headers) $(DESTDIR)$(incdir)
572 $(INSTALL) -m755 -d $(DESTDIR)$(udevruledir)
573 $(INSTALL) -m644 $(udev_rules) $(DESTDIR)$(udevruledir)
576 install-static: $(progs_static) $(INSTALLDIRS)
577 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
578 $(INSTALL) $(progs_static) $(DESTDIR)$(bindir)
579 # btrfsck is a link to btrfs in the src tree, make it so for installed file as well
580 $(LN_S) -f btrfs.static $(DESTDIR)$(bindir)/btrfsck.static
583 @echo "Making install in $(patsubst install-%,%,$@)"
584 $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst install-%,%,$@) install
587 $(Q)$(MAKE) $(MAKEOPTS) -C Documentation uninstall
588 cd $(DESTDIR)$(incdir); $(RM) -f -- $(headers)
589 $(RMDIR) -p --ignore-fail-on-non-empty -- $(DESTDIR)$(incdir)
590 cd $(DESTDIR)$(libdir); $(RM) -f -- $(lib_links) $(libs)
591 cd $(DESTDIR)$(bindir); $(RM) -f -- btrfsck fsck.btrfs $(progs_install)
593 ifneq ($(MAKECMDGOALS),clean)
594 -include $(objects:.o=.o.d) $(cmds_objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d)))