From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/955 Path: news.gmane.org!not-for-mail From: Luca Barbato Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] makefile: add silent rules Date: Thu, 7 Jun 2012 10:13:05 +0200 Message-ID: <1339056785-21979-1-git-send-email-lu_zero@gentoo.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1339056775 702 80.91.229.3 (7 Jun 2012 08:12:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2012 08:12:55 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-956-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 07 10:12:55 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ScXpu-0004gP-A1 for gllmg-musl@plane.gmane.org; Thu, 07 Jun 2012 10:12:54 +0200 Original-Received: (qmail 14225 invoked by uid 550); 7 Jun 2012 08:12:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 14211 invoked from network); 7 Jun 2012 08:12:53 -0000 X-Mailer: git-send-email 1.7.8.rc1 Xref: news.gmane.org gmane.linux.lib.musl.general:955 Archived-At: 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