mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] makefile: add silent rules
@ 2012-06-07  8:13 Luca Barbato
  2012-06-07 13:12 ` Igmar Palsenberg
  2012-06-07 13:19 ` John Spencer
  0 siblings, 2 replies; 4+ messages in thread
From: Luca Barbato @ 2012-06-07  8:13 UTC (permalink / raw)
  To: musl

make V=1 to disable them
---
 Makefile |   57 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index 1bdea61..503dcc5 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,8 @@ CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED -O3
 
 AR      = $(CROSS_COMPILE)ar
 RANLIB  = $(CROSS_COMPILE)ranlib
+INSTALL = install
+LN      = ln -sf
 
 ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h) $(GENH))
 
@@ -47,6 +49,20 @@ TOOL_LIBS = lib/musl-gcc.specs
 ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
 ALL_TOOLS = tools/musl-gcc
 
+ifndef V
+Q      = @
+ECHO   = printf "$(1)\t%s\n" $(2)
+BRIEF  = CC AS AR LD HOSTCC SH LN
+SILENT = DEPCC RM RANLIB
+MSG    = $@
+M      = @$(call ECHO,$(TAG),$@);
+$(foreach VAR,$(BRIEF), \
+    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
+$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
+$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
+endif
+
+
 LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH).so.1
 
 -include config.mak
@@ -56,16 +72,16 @@ all: $(ALL_LIBS) $(ALL_TOOLS)
 install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:tools/%=$(DESTDIR)$(bindir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
 
 clean:
-	rm -f crt/*.o
-	rm -f $(OBJS)
-	rm -f $(LOBJS)
-	rm -f $(ALL_LIBS) lib/*.[ao] lib/*.so
-	rm -f $(ALL_TOOLS)
-	rm -f $(GENH) 
-	rm -f include/bits
+	$(RM) crt/*.o
+	$(RM) $(OBJS)
+	$(RM) $(LOBJS)
+	$(RM) $(ALL_LIBS) lib/*.[ao] lib/*.so
+	$(RM) $(ALL_TOOLS)
+	$(RM) $(GENH)
+	$(RM) include/bits
 
 distclean: clean
-	rm -f config.mak
+	$(RM) config.mak
 
 include/bits:
 	@test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; }
@@ -94,41 +110,42 @@ lib/libc.so: $(LOBJS)
 	-Wl,-soname=libc.so -o $@ $(LOBJS) -lgcc
 
 lib/libc.a: $(OBJS)
-	rm -f $@
+	$(RM) $@
 	$(AR) rc $@ $(OBJS)
 	$(RANLIB) $@
 
 $(EMPTY_LIBS):
-	rm -f $@
+	$(RM) $@
 	$(AR) rc $@
 
 lib/%.o: crt/%.o
-	cp $< $@
+	$(Q)cp $< $@
 
 lib/musl-gcc.specs: tools/musl-gcc.specs.sh config.mak
-	sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
+	$(Q)sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
 
 tools/musl-gcc: config.mak
-	printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
-	chmod +x $@
+	$(Q)printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
+	$(Q)chmod +x $@
 
 $(DESTDIR)$(bindir)/%: tools/%
-	install -D $< $@
+	$(INSTALL) -D $< $@
 
 $(DESTDIR)$(libdir)/%.so: lib/%.so
-	install -D -m 755 $< $@
+	$(INSTALL) -D -m 755 $< $@
 
 $(DESTDIR)$(libdir)/%: lib/%
-	install -D -m 644 $< $@
+	$(INSTALL) -D -m 644 $< $@
 
 $(DESTDIR)$(includedir)/%: include/%
-	install -D -m 644 $< $@
+	$(INSTALL) -D -m 644 $< $@
 
 $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(syslibdir)
-	ln -sf $(libdir)/libc.so $@ || true
+	echo $(ARCH)
+	$(LN) $(libdir)/libc.so $@ || true
 
 $(DESTDIR)$(syslibdir):
-	install -d -m 755 $(DESTDIR)$(syslibdir)
+	$(INSTALL) -d -m 755 $(DESTDIR)$(syslibdir)
 
 .PRECIOUS: $(CRT_LIBS:lib/%=crt/%)
 
-- 
1.7.8.rc1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makefile: add silent rules
  2012-06-07  8:13 [PATCH] makefile: add silent rules Luca Barbato
@ 2012-06-07 13:12 ` Igmar Palsenberg
  2012-06-07 13:18   ` Rich Felker
  2012-06-07 13:19 ` John Spencer
  1 sibling, 1 reply; 4+ messages in thread
From: Igmar Palsenberg @ 2012-06-07 13:12 UTC (permalink / raw)
  To: musl



> make V=1 to disable them

<snip>

This was NACK'ed a month ago. I'm with the NACK crew, I hardly find this useful, and I like fast scrolling terminals :)



	Igmar



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makefile: add silent rules
  2012-06-07 13:12 ` Igmar Palsenberg
@ 2012-06-07 13:18   ` Rich Felker
  0 siblings, 0 replies; 4+ messages in thread
From: Rich Felker @ 2012-06-07 13:18 UTC (permalink / raw)
  To: musl

On Thu, Jun 07, 2012 at 03:12:48PM +0200, Igmar Palsenberg wrote:
> 
> 
> > make V=1 to disable them
> 
> <snip>
> 
> This was NACK'ed a month ago. I'm with the NACK crew, I hardly find
> this useful, and I like fast scrolling terminals :)

I'm not as adamant on it, but I'm also in the group that doesn't like
this "new style" of makefile output. Most annoyingly, when something
goes wrong, you have to re-run make with V=1 to see what was actually
happening. Oftentimes I find I want to rerun a command with -S instead
of -c (to examine the generated asm) or with different CFLAGS when
dealing with an unexpected ICE or similar.

By the way, I'm also against using $(RM), $(LN), etc.; as far as I can
tell that's useless Windows pandering, since these commands are
entirely standard on POSIX. $(INSTALL) might make sense (since it's
not specified in the standards) but it would be a low priority. The
reason $(AR) and $(RANLIB) exist is for the purpose of cross
compiling (although in reality, .a files are mostly arch-agnostic and
the host ar probably works fine for the target).

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makefile: add silent rules
  2012-06-07  8:13 [PATCH] makefile: add silent rules Luca Barbato
  2012-06-07 13:12 ` Igmar Palsenberg
@ 2012-06-07 13:19 ` John Spencer
  1 sibling, 0 replies; 4+ messages in thread
From: John Spencer @ 2012-06-07 13:19 UTC (permalink / raw)
  To: musl; +Cc: Luca Barbato

On 06/07/2012 10:13 AM, Luca Barbato wrote:
> make V=1 to disable them
> ---
>
please see the mail georgi sent to the list at 13th may and the followup 
responses.

maybe 10% of users want a "quiet" build, so why force your preference on 
anybody ?

if it was the other way around (explicitly enable the "quiet" stuff), i 
wouldn't be as opposed to this idea.
but effectively it gains you nothing except "awesome looks" *sigh*, and 
adds additional bloat to the Makefile.

-- JS


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-07 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07  8:13 [PATCH] makefile: add silent rules Luca Barbato
2012-06-07 13:12 ` Igmar Palsenberg
2012-06-07 13:18   ` Rich Felker
2012-06-07 13:19 ` John Spencer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).