btrfs-progs: dump-tree: print missing inode_item data
[platform/upstream/btrfs-progs.git] / Makefile.in
1 # btrfs-progs
2 #
3 # Basic build targets:
4 #   all         all main tools
5 #   static      build static bnaries, requires static version of the libraries
6 #   test        run the full testsuite
7 #   install     install to default location (/usr/local)
8 #   clean       clean built binaries (not the documentation)
9 #   clean-all   clean as above, clean docs and generated files
10 #
11 # Tuning by variables (environment or make arguments):
12 #   V=1            verbose, print command lines (default: quiet)
13 #   C=1            run checker before compilation (default checker: sparse)
14 #   D=1            debugging build, turn off optimizations
15 #   D=dflags       dtto, turn on additional debugging features:
16 #                  verbose - print file:line along with error/warning messages
17 #                  trace   - print trace before the error/warning messages
18 #                  abort   - call abort() on first error (dumps core)
19 #                  all     - shortcut for all of the above
20 #                  asan    - enable address 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
27 #
28 # Static checkers:
29 #   CHECKER        static checker binary to be called (default: sparse)
30 #   CHECKER_FLAGS  flags to pass to CHECKER, can override CFLAGS
31 #
32
33 # Export all variables to sub-makes by default
34 export
35
36 include Makefile.extrawarn
37
38 CC = @CC@
39 LN_S = @LN_S@
40 AR = @AR@
41 RM = @RM@
42 RMDIR = @RMDIR@
43 INSTALL = @INSTALL@
44 DISABLE_DOCUMENTATION = @DISABLE_DOCUMENTATION@
45 DISABLE_BTRFSCONVERT = @DISABLE_BTRFSCONVERT@
46 BTRFSCONVERT_EXT2 = @BTRFSCONVERT_EXT2@
47
48 EXTRA_CFLAGS :=
49 EXTRA_LDFLAGS :=
50
51 DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3
52 DEBUG_CFLAGS_INTERNAL =
53 DEBUG_CFLAGS :=
54
55 TOPDIR := $(shell pwd)
56
57 # Common build flags
58 CFLAGS = @CFLAGS@ \
59          -include config.h \
60          -DBTRFS_FLAT_INCLUDES \
61          -D_XOPEN_SOURCE=700  \
62          -fno-strict-aliasing \
63          -fPIC \
64          -I$(TOPDIR) \
65          -I$(TOPDIR)/kernel-lib \
66          $(EXTRAWARN_CFLAGS) \
67          $(DEBUG_CFLAGS_INTERNAL) \
68          $(EXTRA_CFLAGS)
69
70 LDFLAGS = @LDFLAGS@ \
71           -rdynamic $(EXTRA_LDFLAGS)
72
73 LIBS = @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread
74 LIBBTRFS_LIBS = $(LIBS)
75
76 # Static compilation flags
77 STATIC_CFLAGS = $(CFLAGS) -ffunction-sections -fdata-sections
78 STATIC_LDFLAGS = -static -Wl,--gc-sections
79 STATIC_LIBS = @UUID_LIBS_STATIC@ @BLKID_LIBS_STATIC@ \
80               @ZLIB_LIBS_STATIC@ @LZO2_LIBS_STATIC@ -L. -pthread
81
82 # don't use FORTIFY with sparse because glibc with FORTIFY can
83 # generate so many sparse errors that sparse stops parsing,
84 # which masks real errors that we want to see.
85 CHECKER := sparse
86 check_defs := .cc-defines.h
87 CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \
88         -D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized -Wshadow -Wundef \
89         -U_FORTIFY_SOURCE
90
91 objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
92           root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
93           extent-cache.o extent_io.o volumes.o utils.o repair.o \
94           qgroup.o raid56.o free-space-cache.o kernel-lib/list_sort.o props.o \
95           ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \
96           inode.o file.o find-root.o free-space-tree.o help.o
97 cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
98                cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
99                cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
100                cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
101                cmds-property.o cmds-fi-usage.o cmds-inspect-dump-tree.o \
102                cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o
103 libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
104                    kernel-lib/crc32c.o \
105                    uuid-tree.o utils-lib.o rbtree-utils.o
106 libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
107                kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
108                kernel-lib/radix-tree.h extent-cache.h \
109                extent_io.h ioctl.h ctree.h btrfsck.h version.h
110 TESTS = fsck-tests.sh convert-tests.sh
111
112 udev_rules = 64-btrfs-dm.rules
113
114 prefix ?= @prefix@
115 exec_prefix = @exec_prefix@
116 bindir = @bindir@
117 libdir ?= @libdir@
118 incdir = @includedir@/btrfs
119 udevdir = @UDEVDIR@
120 udevruledir = ${udevdir}/rules.d
121
122 ifeq ("$(origin V)", "command line")
123   BUILD_VERBOSE = $(V)
124 endif
125 ifndef BUILD_VERBOSE
126   BUILD_VERBOSE = 0
127 endif
128
129 ifeq ($(BUILD_VERBOSE),1)
130   Q =
131 else
132   Q = @
133 endif
134
135 ifeq ("$(origin D)", "command line")
136   DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS)
137 endif
138
139 ifneq (,$(findstring verbose,$(D)))
140   DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
141 endif
142
143 ifneq (,$(findstring trace,$(D)))
144   DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
145 endif
146
147 ifneq (,$(findstring abort,$(D)))
148   DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
149 endif
150
151 ifneq (,$(findstring all,$(D)))
152   DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1
153   DEBUG_CFLAGS_INTERNAL += -DDEBUG_TRACE_ON_ERROR=1
154   DEBUG_CFLAGS_INTERNAL += -DDEBUG_ABORT_ON_ERROR=1
155 endif
156
157 ifneq (,$(findstring asan,$(D)))
158   DEBUG_CFLAGS_INTERNAL += -fsanitize=address
159 endif
160
161 ifneq (,$(findstring ubsan,$(D)))
162   DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined
163 endif
164
165 ifneq (,$(findstring bcheck,$(D)))
166   DEBUG_CFLAGS_INTERNAL += -DDEBUG_BUILD_CHECKS
167 endif
168
169 MAKEOPTS = --no-print-directory Q=$(Q)
170
171 # build all by default
172 progs = $(progs_install) btrfsck btrfs-corrupt-block btrfs-calc-size
173
174 # install only selected
175 progs_install = btrfs mkfs.btrfs btrfs-debug-tree \
176         btrfs-map-logical btrfs-image btrfs-zero-log \
177         btrfs-find-root btrfstune btrfs-show-super \
178         btrfs-select-super
179
180 progs_extra = btrfs-fragments
181
182 progs_static = $(foreach p,$(progs),$(p).static)
183
184 ifneq ($(DISABLE_BTRFSCONVERT),1)
185 progs_install += btrfs-convert
186 endif
187
188 # external libs required by various binaries; for btrfs-foo,
189 # specify btrfs_foo_libs = <list of libs>; see $($(subst...)) rules below
190 btrfs_convert_libs = @EXT2FS_LIBS@ @COM_ERR_LIBS@
191 btrfs_convert_cflags = -DBTRFSCONVERT_EXT2=$(BTRFSCONVERT_EXT2)
192 btrfs_fragments_libs = -lgd -lpng -ljpeg -lfreetype
193 btrfs_debug_tree_objects = cmds-inspect-dump-tree.o
194 btrfs_show_super_objects = cmds-inspect-dump-super.o
195 btrfs_calc_size_objects = cmds-inspect-tree-stats.o
196
197 # collect values of the variables above
198 standalone_deps = $(foreach dep,$(patsubst %,%_objects,$(subst -,_,$(filter btrfs-%, $(progs)))),$($(dep)))
199
200 SUBDIRS =
201 BUILDDIRS = $(patsubst %,build-%,$(SUBDIRS))
202 INSTALLDIRS = $(patsubst %,install-%,$(SUBDIRS))
203 CLEANDIRS = $(patsubst %,clean-%,$(SUBDIRS))
204
205 ifneq ($(DISABLE_DOCUMENTATION),1)
206 BUILDDIRS += build-Documentation
207 INSTALLDIRS += install-Documentation
208 endif
209
210 .PHONY: $(SUBDIRS)
211 .PHONY: $(BUILDDIRS)
212 .PHONY: $(INSTALLDIRS)
213 .PHONY: $(TESTDIRS)
214 .PHONY: $(CLEANDIRS)
215 .PHONY: all install clean
216
217 # Create all the static targets
218 static_objects = $(patsubst %.o, %.static.o, $(objects))
219 static_cmds_objects = $(patsubst %.o, %.static.o, $(cmds_objects))
220 static_libbtrfs_objects = $(patsubst %.o, %.static.o, $(libbtrfs_objects))
221
222 libs_shared = libbtrfs.so.0.1
223 libs_static = libbtrfs.a
224 libs = $(libs_shared) $(libs_static)
225 lib_links = libbtrfs.so.0 libbtrfs.so
226 headers = $(libbtrfs_headers)
227
228 # make C=1 to enable sparse
229 ifdef C
230         # We're trying to use sparse against glibc headers which go wild
231         # trying to use internal compiler macros to test features.  We
232         # copy gcc's and give them to sparse.  But not __SIZE_TYPE__
233         # 'cause sparse defines that one.
234         #
235         dummy := $(shell $(CC) -dM -E -x c - < /dev/null | \
236                         grep -v __SIZE_TYPE__ > $(check_defs))
237         check = $(CHECKER)
238         check_echo = echo
239 else
240         check = true
241         check_echo = true
242 endif
243
244 %.o.d: %.c
245         $(Q)$(CC) -MD -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
246
247 #
248 # Pick from per-file variables, btrfs_*_cflags
249 #
250 .c.o:
251         @$(check_echo) "    [SP]     $<"
252         $(Q)$(check) $(CFLAGS) $(CHECKER_FLAGS) $<
253         @echo "    [CC]     $@"
254         $(Q)$(CC) $(CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.o=%)-cflags))
255
256 %.static.o: %.c
257         @echo "    [CC]     $@"
258         $(Q)$(CC) $(STATIC_CFLAGS) -c $< -o $@ $($(subst -,_,$(@:%.static.o=%)-cflags))
259
260 all: $(progs) $(BUILDDIRS)
261 $(SUBDIRS): $(BUILDDIRS)
262 $(BUILDDIRS):
263         @echo "Making all in $(patsubst build-%,%,$@)"
264         $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst build-%,%,$@)
265
266 test-convert: btrfs btrfs-convert
267         @echo "    [TEST]   convert-tests.sh"
268         $(Q)bash tests/convert-tests.sh
269
270 test-check: test-fsck
271 test-fsck: btrfs btrfs-image btrfs-corrupt-block btrfs-debug-tree mkfs.btrfs
272         @echo "    [TEST]   fsck-tests.sh"
273         $(Q)bash tests/fsck-tests.sh
274
275 test-misc: btrfs btrfs-image btrfs-corrupt-block btrfs-debug-tree mkfs.btrfs btrfstune
276         @echo "    [TEST]   misc-tests.sh"
277         $(Q)bash tests/misc-tests.sh
278
279 test-mkfs: btrfs mkfs.btrfs
280         @echo "    [TEST]   mkfs-tests.sh"
281         $(Q)bash tests/mkfs-tests.sh
282
283 test-fuzz: btrfs
284         @echo "    [TEST]   fuzz-tests.sh"
285         $(Q)bash tests/fuzz-tests.sh
286
287 test-cli: btrfs
288         @echo "    [TEST]   cli-tests.sh"
289         $(Q)bash tests/cli-tests.sh
290
291 test-clean:
292         @echo "Cleaning tests"
293         $(Q)bash tests/clean-tests.sh
294
295 test-inst: all
296         @tmpdest=`mktemp --tmpdir -d btrfs-inst.XXXXXX` && \
297                 echo "Test installation to $$tmpdest" && \
298                 $(MAKE) DESTDIR=$$tmpdest install && \
299                 $(RM) -rf -- $$tmpdest
300
301 test: test-fsck test-mkfs test-convert test-misc test-fuzz
302
303 #
304 # NOTE: For static compiles, you need to have all the required libs
305 #       static equivalent available
306 #
307 static: $(progs_static)
308
309 version.h: version.sh version.h.in configure.ac
310         @echo "    [SH]     $@"
311         $(Q)bash ./config.status --silent $@
312
313 $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
314         @echo "    [LD]     $@"
315         $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(LDFLAGS) $(LIBBTRFS_LIBS) \
316                 -shared -Wl,-soname,libbtrfs.so.0 -o libbtrfs.so.0.1
317
318 $(libs_static): $(libbtrfs_objects)
319         @echo "    [AR]     $@"
320         $(Q)$(AR) cr libbtrfs.a $(libbtrfs_objects)
321
322 $(lib_links):
323         @echo "    [LN]     $@"
324         $(Q)$(LN_S) -f libbtrfs.so.0.1 $@
325
326 # keep intermediate files from the below implicit rules around
327 .PRECIOUS: $(addsuffix .o,$(progs))
328
329 # Make any btrfs-foo out of btrfs-foo.o, with appropriate libs.
330 # The $($(subst...)) bits below takes the btrfs_*_libs definitions above and
331 # turns them into a list of libraries to link against if they exist
332 #
333 # For static variants, use an extra $(subst) to get rid of the ".static"
334 # from the target name before translating to list of libs
335
336 btrfs-%.static: $(static_objects) btrfs-%.static.o $(static_libbtrfs_objects) $(patsubst %.o,%.static.o,$(standalone_deps))
337         @echo "    [LD]     $@"
338         $(Q)$(CC) $(STATIC_CFLAGS) -o $@ $@.o $(static_objects) \
339                 $(patsubst %.o, %.static.o, $($(subst -,_,$(subst .static,,$@)-objects))) \
340                 $(static_libbtrfs_objects) $(STATIC_LDFLAGS) \
341                 $($(subst -,_,$(subst .static,,$@)-libs)) $(STATIC_LIBS)
342
343 btrfs-%: $(objects) $(libs_static) btrfs-%.o $(standalone_deps)
344         @echo "    [LD]     $@"
345         $(Q)$(CC) $(CFLAGS) -o $@ $(objects) $@.o \
346                 $($(subst -,_,$@-objects)) \
347                 $(libs_static) \
348                 $(LDFLAGS) $(LIBS) $($(subst -,_,$@-libs))
349
350 btrfs: $(objects) btrfs.o $(cmds_objects) $(libs_static)
351         @echo "    [LD]     $@"
352         $(Q)$(CC) $(CFLAGS) -o btrfs btrfs.o $(cmds_objects) \
353                 $(objects) $(libs_static) $(LDFLAGS) $(LIBS)
354
355 btrfs.static: $(static_objects) btrfs.static.o $(static_cmds_objects) $(static_libbtrfs_objects)
356         @echo "    [LD]     $@"
357         $(Q)$(CC) $(STATIC_CFLAGS) -o btrfs.static btrfs.static.o $(static_cmds_objects) \
358                 $(static_objects) $(static_libbtrfs_objects) $(STATIC_LDFLAGS) $(STATIC_LIBS)
359
360 # For backward compatibility, 'btrfs' changes behaviour to fsck if it's named 'btrfsck'
361 btrfsck: btrfs
362         @echo "    [LN]     $@"
363         $(Q)$(LN_S) -f btrfs btrfsck
364
365 btrfsck.static: btrfs.static
366         @echo "    [LN]     $@"
367         $(Q)$(LN_S) -f $^ $@
368
369 mkfs.btrfs: $(objects) $(libs_static) mkfs.o
370         @echo "    [LD]     $@"
371         $(Q)$(CC) $(CFLAGS) -o mkfs.btrfs $(objects) $(libs_static) mkfs.o $(LDFLAGS) $(LIBS)
372
373 mkfs.btrfs.static: $(static_objects) mkfs.static.o $(static_libbtrfs_objects)
374         @echo "    [LD]     $@"
375         $(Q)$(CC) $(STATIC_CFLAGS) -o mkfs.btrfs.static mkfs.static.o $(static_objects) \
376                 $(static_libbtrfs_objects) $(STATIC_LDFLAGS) $(STATIC_LIBS)
377
378 btrfstune: $(objects) $(libs_static) btrfstune.o
379         @echo "    [LD]     $@"
380         $(Q)$(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(libs_static) $(LDFLAGS) $(LIBS)
381
382 btrfstune.static: $(static_objects) btrfstune.static.o $(static_libbtrfs_objects)
383         @echo "    [LD]     $@"
384         $(Q)$(CC) $(STATIC_CFLAGS) -o $@ btrfstune.static.o $(static_objects) \
385                 $(static_libbtrfs_objects) $(STATIC_LDFLAGS) $(STATIC_LIBS)
386
387 dir-test: $(objects) $(libs) dir-test.o
388         @echo "    [LD]     $@"
389         $(Q)$(CC) $(CFLAGS) -o dir-test $(objects) $(libs) dir-test.o $(LDFLAGS) $(LIBS)
390
391 quick-test: $(objects) $(libs) quick-test.o
392         @echo "    [LD]     $@"
393         $(Q)$(CC) $(CFLAGS) -o quick-test $(objects) $(libs) quick-test.o $(LDFLAGS) $(LIBS)
394
395 ioctl-test.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
396         @echo "    [CC]   $@"
397         $(Q)$(CC) $(CFLAGS) -c $< -o $@
398
399 ioctl-test-32.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
400         @echo "    [CC32]   $@"
401         $(Q)$(CC) $(CFLAGS) -m32 -c $< -o $@
402
403 ioctl-test-64.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
404         @echo "    [CC64]   $@"
405         $(Q)$(CC) $(CFLAGS) -m64 -c $< -o $@
406
407 ioctl-test: ioctl-test.o
408         @echo "    [LD]   $@"
409         $(Q)$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
410         @echo "   ?[PAHOLE] $@.pahole"
411         -$(Q)pahole $@ > $@.pahole
412
413 ioctl-test-32: ioctl-test-32.o
414         @echo "    [LD32]   $@"
415         $(Q)$(CC) $(CFLAGS) -m32 -o $@ $< $(LDFLAGS)
416         @echo "   ?[PAHOLE] $@.pahole"
417         -$(Q)pahole $@ > $@.pahole
418
419 ioctl-test-64: ioctl-test-64.o
420         @echo "    [LD64]   $@"
421         $(Q)$(CC) $(CFLAGS) -m64 -o $@ $< $(LDFLAGS)
422         @echo "   ?[PAHOLE] $@.pahole"
423         -$(Q)pahole $@ > $@.pahole
424
425 test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64
426         @echo "    [TEST/ioctl]"
427         $(Q)./ioctl-test > ioctl-test.log
428         $(Q)./ioctl-test-32 > ioctl-test-32.log
429         $(Q)./ioctl-test-64 > ioctl-test-64.log
430
431 library-test: $(libs_shared) library-test.o
432         @echo "    [LD]     $@"
433         $(Q)$(CC) $(CFLAGS) -o library-test library-test.o $(LDFLAGS) -lbtrfs
434
435 library-test.static: $(libs_static) library-test.o
436         @echo "    [LD]     $@"
437         $(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
438
439 test-build: test-build-pre test-build-real
440
441 test-build-pre:
442         $(MAKE) clean-all
443         ./autogen.sh
444         ./configure
445
446 test-build-real:
447         $(MAKE) library-test
448         -$(MAKE) library-test.static
449         $(MAKE) -j 8 all
450         -$(MAKE) -j 8 static
451         $(MAKE) -j 8 $(progs_extra)
452
453 manpages:
454         $(Q)$(MAKE) $(MAKEOPTS) -C Documentation
455
456
457 clean-all: clean clean-doc clean-gen
458
459 clean: $(CLEANDIRS)
460         @echo "Cleaning"
461         $(Q)$(RM) -f -- $(progs) cscope.out *.o *.o.d \
462                 kernel-lib/*.o kernel-lib/*.o.d \
463               dir-test ioctl-test quick-test library-test library-test-static \
464               btrfs.static mkfs.btrfs.static \
465               $(check_defs) \
466               $(libs) $(lib_links) \
467               $(progs_static) $(progs_extra)
468
469 clean-doc:
470         @echo "Cleaning Documentation"
471         $(Q)$(MAKE) $(MAKEOPTS) -C Documentation clean
472
473 clean-gen:
474         @echo "Cleaning Generated Files"
475         $(Q)$(RM) -rf -- version.h config.status config.cache connfig.log \
476                 configure.lineno config.status.lineno Makefile \
477                 Documentation/Makefile \
478                 config.log config.h config.h.in~ aclocal.m4 \
479                 configure autom4te.cache/ config/
480
481 $(CLEANDIRS):
482         @echo "Cleaning $(patsubst clean-%,%,$@)"
483         $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst clean-%,%,$@) clean
484
485 install: $(libs) $(progs_install) $(INSTALLDIRS)
486         $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
487         $(INSTALL) $(progs_install) $(DESTDIR)$(bindir)
488         $(INSTALL) fsck.btrfs $(DESTDIR)$(bindir)
489         # btrfsck is a link to btrfs in the src tree, make it so for installed file as well
490         $(LN_S) -f btrfs $(DESTDIR)$(bindir)/btrfsck
491         $(INSTALL) -m755 -d $(DESTDIR)$(libdir)
492         $(INSTALL) $(libs) $(DESTDIR)$(libdir)
493         cp -a $(lib_links) $(DESTDIR)$(libdir)
494         $(INSTALL) -m755 -d $(DESTDIR)$(incdir)
495         $(INSTALL) -m644 $(headers) $(DESTDIR)$(incdir)
496 ifneq ($(udevdir),)
497         $(INSTALL) -m755 -d $(DESTDIR)$(udevruledir)
498         $(INSTALL) -m644 $(udev_rules) $(DESTDIR)$(udevruledir)
499 endif
500
501 install-static: $(progs_static) $(INSTALLDIRS)
502         $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
503         $(INSTALL) $(progs_static) $(DESTDIR)$(bindir)
504         # btrfsck is a link to btrfs in the src tree, make it so for installed file as well
505         $(LN_S) -f btrfs.static $(DESTDIR)$(bindir)/btrfsck.static
506
507 $(INSTALLDIRS):
508         @echo "Making install in $(patsubst install-%,%,$@)"
509         $(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst install-%,%,$@) install
510
511 uninstall:
512         $(Q)$(MAKE) $(MAKEOPTS) -C Documentation uninstall
513         cd $(DESTDIR)$(incdir); $(RM) -f -- $(headers)
514         $(RMDIR) -p --ignore-fail-on-non-empty -- $(DESTDIR)$(incdir)
515         cd $(DESTDIR)$(libdir); $(RM) -f -- $(lib_links) $(libs)
516         cd $(DESTDIR)$(bindir); $(RM) -f -- btrfsck fsck.btrfs $(progs_install)
517
518 ifneq ($(MAKECMDGOALS),clean)
519 -include $(objects:.o=.o.d) $(cmds_objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d)))
520 endif