aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-05 12:11:32 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-10 10:21:54 +0100
commit211cf0e6479157966b39a56bd5352ee430ef7166 (patch)
treef01a7b4afd072d4727dd99b7d92516f3295b0805 /Makefile
parent13ceb0dd87ffe705ac7a7701485dd2ac6a05daf7 (diff)
downloadsparse-dev-211cf0e6479157966b39a56bd5352ee430ef7166.tar.gz
build: simplify quiet commands
The current mechanism for the quiet commands, what's hiding the true command and emitting instead things like: CC target.o is, IMO, somehow unneedlessly sophisticated and this doesn't help to understand what's happening and to adapt things when needed. Change this by using simple 'echo' commands and make's '@' to display the short command and hiding the long one. Warning: There is a small change in behaviour with this: previously, when displaying the non-quiet commands with 'make V=1' the quiet ones were not emitted. Now, with this patch, the short/quiet command is emitted in both case. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 12 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 5b3cd66f..bf2f8204 100644
--- a/Makefile
+++ b/Makefile
@@ -159,13 +159,6 @@ LIBS := libsparse.a
#
V = @
Q = $(V:1=)
-QUIET_CC = $(Q:@=@echo " CC $@";)
-QUIET_CHECK = $(Q:@=@echo " CHECK $<";)
-QUIET_AR = $(Q:@=@echo " AR $@";)
-QUIET_GEN = $(Q:@=@echo " GEN $@";)
-QUIET_LINK = $(Q:@=@echo " LINK $@";)
-# We rely on the -v switch of install to print 'file -> $install_dir/file'
-QUIET_INST = $(Q:@=@echo -n " INSTALL ";)
compile_OBJS := compile-i386.o
@@ -176,10 +169,12 @@ ldflags += $($(@)-ldflags) $(LDFLAGS)
ldlibs += $($(@)-ldlibs) $(LDLIBS)
$(foreach p,$(PROGRAMS),$(eval $(p): $($(p)-objs)))
$(PROGRAMS): % : %.o $(LIBS)
- $(QUIET_LINK)$(LD) $(ldflags) $^ $(ldlibs) -o $@
+ @echo " LD $@"
+ $(Q)$(LD) $(ldflags) $^ $(ldlibs) -o $@
libsparse.a: $(LIB_OBJS)
- $(QUIET_AR)$(AR) rcs $@ $^
+ @echo " AR $@"
+ $(Q)$(AR) rcs $@ $^
OBJS := $(LIB_OBJS) $(PROGRAMS:%=%.o) $(foreach p,$(PROGRAMS),$($(p)-objs))
DEPS := $(OBJS:%.o=.%.o.d)
@@ -189,10 +184,12 @@ DEPS := $(OBJS:%.o=.%.o.d)
cflags += $($(*)-cflags) $(CPPFLAGS) $(CFLAGS)
%.o: %.c
- $(QUIET_CC)$(CC) $(cflags) -c -o $@ $<
+ @echo " CC $@"
+ $(Q)$(CC) $(cflags) -c -o $@ $<
%.sc: %.c sparse
- $(QUIET_CHECK) $(CHECKER) $(CHECKER_FLAGS) $(cflags) -c $<
+ @echo " CHECK $<"
+ $(Q) $(CHECKER) $(CHECKER_FLAGS) $(cflags) -c $<
selfcheck: $(OBJS:.o=.sc)
@@ -234,8 +231,10 @@ install-bin: $(INST_PROGRAMS:%=$(DESTDIR)$(BINDIR)/%)
install-man: $(INST_MAN1:%=$(DESTDIR)$(MAN1DIR)/%)
$(DESTDIR)$(BINDIR)/%: %
- $(QUIET_INST)install -v $< $@ || exit 1;
+ @echo " INSTALL $@"
+ $(Q)install $< $@ || exit 1;
$(DESTDIR)$(MAN1DIR)/%: %
- $(QUIET_INST)install -v -m 644 $< $@ || exit 1;
+ @echo " INSTALL $@"
+ $(Q)install -m 644 $< $@ || exit 1;
.PHONY: FORCE