From 69af4b4ee272ffcb1709aed47b08d7c41c6ac557 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 24 Jan 2013 17:32:52 -0600 Subject: [PATCH] btrfs-progs pretty/quiet build A quieter build makes warnings more obvious. This could probably be improved, but just to see if people like this or if they hate it. :) make V=1 overrides it and gets you the full glory again. [CC] ctree.o [CC] disk-io.o [CC] radix-tree.o [CC] extent-tree.o ... Signed-off-by: Eric Sandeen --- Makefile | 94 ++++++++++++++++++++++++++++++++++++++++++------------------ man/Makefile | 29 +++++++------------ 2 files changed, 77 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index d524f69..4dd405d 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,21 @@ bindir = $(prefix)/bin LIBS=-luuid -lm RESTORE_LIBS=-lz +ifeq ("$(origin V)", "command line") + BUILD_VERBOSE = $(V) +endif +ifndef BUILD_VERBOSE + BUILD_VERBOSE = 0 +endif + +ifeq ($(BUILD_VERBOSE),1) + Q = +else + Q = @ +endif + +MAKEOPTS = --no-print-directory Q=$(Q) + progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \ btrfs btrfs-map-logical btrfs-image btrfs-zero-log btrfs-convert \ btrfs-find-root btrfs-restore btrfstune btrfs-show-super @@ -28,93 +43,116 @@ progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \ ifdef C check = sparse $(CHECKFLAGS) else - check = ls + check = true endif .c.o: - $(check) $< - $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $< + $(Q)$(check) $< + @echo " [CC] $@" + $(Q)$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $< all: version $(progs) manpages version: - bash version.sh + $(Q)bash version.sh btrfs: $(objects) btrfs.o help.o common.o $(cmds_objects) - $(CC) $(CFLAGS) -o btrfs btrfs.o help.o common.o $(cmds_objects) \ + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs btrfs.o help.o common.o $(cmds_objects) \ $(objects) $(LDFLAGS) $(LIBS) -lpthread calc-size: $(objects) calc-size.o - $(CC) $(CFLAGS) -o calc-size calc-size.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o calc-size calc-size.o $(objects) $(LDFLAGS) $(LIBS) btrfs-find-root: $(objects) find-root.o - $(CC) $(CFLAGS) -o btrfs-find-root find-root.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-find-root find-root.o $(objects) $(LDFLAGS) $(LIBS) btrfs-restore: $(objects) restore.o - $(CC) $(CFLAGS) -o btrfs-restore restore.o $(objects) $(LDFLAGS) $(LIBS) $(RESTORE_LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-restore restore.o $(objects) $(LDFLAGS) $(LIBS) $(RESTORE_LIBS) btrfsctl: $(objects) btrfsctl.o - $(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) btrfs-vol: $(objects) btrfs-vol.o - $(CC) $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) btrfs-show: $(objects) btrfs-show.o - $(CC) $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS) btrfsck: $(objects) btrfsck.o - $(CC) $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfsck btrfsck.o $(objects) $(LDFLAGS) $(LIBS) mkfs.btrfs: $(objects) mkfs.o - $(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) -lblkid + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) -lblkid btrfs-debug-tree: $(objects) debug-tree.o - $(CC) $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS) btrfs-zero-log: $(objects) btrfs-zero-log.o - $(CC) $(CFLAGS) -o btrfs-zero-log $(objects) btrfs-zero-log.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-zero-log $(objects) btrfs-zero-log.o $(LDFLAGS) $(LIBS) btrfs-show-super: $(objects) btrfs-show-super.o - $(CC) $(CFLAGS) -o btrfs-show-super $(objects) btrfs-show-super.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-show-super $(objects) btrfs-show-super.o $(LDFLAGS) $(LIBS) btrfs-select-super: $(objects) btrfs-select-super.o - $(CC) $(CFLAGS) -o btrfs-select-super $(objects) btrfs-select-super.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-select-super $(objects) btrfs-select-super.o $(LDFLAGS) $(LIBS) btrfstune: $(objects) btrfstune.o - $(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS) btrfs-map-logical: $(objects) btrfs-map-logical.o - $(CC) $(CFLAGS) -o btrfs-map-logical $(objects) btrfs-map-logical.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-map-logical $(objects) btrfs-map-logical.o $(LDFLAGS) $(LIBS) btrfs-corrupt-block: $(objects) btrfs-corrupt-block.o - $(CC) $(CFLAGS) -o btrfs-corrupt-block $(objects) btrfs-corrupt-block.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-corrupt-block $(objects) btrfs-corrupt-block.o $(LDFLAGS) $(LIBS) btrfs-image: $(objects) btrfs-image.o - $(CC) $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-image $(objects) btrfs-image.o -lpthread -lz $(LDFLAGS) $(LIBS) dir-test: $(objects) dir-test.o - $(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS) quick-test: $(objects) quick-test.o - $(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) btrfs-convert: $(objects) convert.o - $(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS) ioctl-test: $(objects) ioctl-test.o - $(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS) + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS) manpages: - cd man; $(MAKE) + $(Q)$(MAKE) $(MAKEOPTS) -C man install-man: cd man; $(MAKE) install clean : - rm -f $(progs) cscope.out *.o .*.d btrfs-convert btrfs-image btrfs-select-super \ + @echo "Cleaning" + $(Q)rm -f $(progs) cscope.out *.o .*.d btrfs-convert btrfs-image btrfs-select-super \ btrfs-zero-log btrfstune dir-test ioctl-test quick-test version.h - cd man; $(MAKE) clean + $(Q)$(MAKE) $(MAKEOPTS) -C man $@ install: $(progs) install-man $(INSTALL) -m755 -d $(DESTDIR)$(bindir) diff --git a/man/Makefile b/man/Makefile index f7b57f7..fefbda9 100644 --- a/man/Makefile +++ b/man/Makefile @@ -6,31 +6,24 @@ bindir = $(prefix)/bin mandir = $(prefix)/man man8dir = $(mandir)/man8 +# clear out all suffixes +.SUFFIXES: +# list only those we use +.SUFFIXES: .in .gz + MANPAGES = mkfs.btrfs.8.gz btrfsctl.8.gz btrfsck.8.gz btrfs-image.8.gz \ btrfs-show.8.gz btrfs.8.gz +INFILES = ${MANPAGES:.in=.gz} all: $(MANPAGES) -mkfs.btrfs.8.gz: mkfs.btrfs.8.in - $(GZIPCMD) -n -c mkfs.btrfs.8.in > mkfs.btrfs.8.gz - -btrfs.8.gz: btrfs.8.in - $(GZIPCMD) -n -c btrfs.8.in > btrfs.8.gz - -btrfsctl.8.gz: btrfsctl.8.in - $(GZIPCMD) -n -c btrfsctl.8.in > btrfsctl.8.gz - -btrfsck.8.gz: btrfsck.8.in - $(GZIPCMD) -n -c btrfsck.8.in > btrfsck.8.gz - -btrfs-image.8.gz: btrfs-image.8.in - $(GZIPCMD) -n -c btrfs-image.8.in > btrfs-image.8.gz - -btrfs-show.8.gz: btrfs-show.8.in - $(GZIPCMD) -n -c btrfs-show.8.in > btrfs-show.8.gz +.in.gz : + @echo " [MAN] $@" + $(Q)$(GZIPCMD) -n -c $< > $@ clean : - rm -f $(MANPAGES) + @echo "Cleaning manpages" + $(Q)rm -f $(MANPAGES) install: $(MANPAGES) $(INSTALL) -m755 -d $(DESTDIR)$(man8dir) -- 2.7.4