[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/3] Enable silent builds by default if available
From: |
Guillem Jover |
Subject: |
[PATCH 2/3] Enable silent builds by default if available |
Date: |
Sun, 15 Nov 2009 19:20:00 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
* configure.ac (AM_SILENT_RULES): Add silent rules support if available,
and enable it by defualt.
* Makefile.am (NM_V, NM_V_, NM_V_0): New variables.
(gnumach-undef): Use NM_V in front of NM.
(gnumach-undef-bad): Use AM_V_GEN in front of sed.
(clib-routines.o): Use AM_V_at in fron of undefined symbols check. Use
AM_V_CCLD in front of CCLD.
* Makefrag.am (gnumach.msgids): Use AM_V_GEN in front of cat.
* Makerules.am (AWK_V, AWK_V_, AWK_V_0): New variables.
(%.symc): Use AWK_V in front of AWK.
(%.symc.o): Use AM_V_CC in front of COMPILE.
(%.h): Use AM_V_GEN in front of sed.
(GZIP_V, GZIP_V_, GZIP_V_0): New variables.
(%.gz): Use GZIP_V in front of GZIP.
* Makerules.mig.am (MIGCOM_V, MIGCOM_V_, MIGCOM_V_0): New variables.
(%.server.h %.server.c %.server.msgids): Use MIGCOM_V in front of MIGCOM.
(%.user.h %.user.c %.user.msgids): Likewise.
(%.server.defs.c): use AM_V_GEN in front of command.
(%.user.defs.c): Likewise.
---
Makefile.am | 12 ++++++++----
Makefrag.am | 4 ++--
Makerules.am | 16 ++++++++++++----
Makerules.mig.am | 24 ++++++++++++++----------
configure.ac | 3 +++
5 files changed, 39 insertions(+), 20 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index d6fbb54..bc4df2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,6 +123,10 @@ include doc/Makefrag.am
# Kernel Image
#
+NM_V = $(NM_V_$(V))
+NM_V_ = $(NM_V_$(AM_DEFAULT_VERBOSITY))
+NM_V_0 = @echo " NM $@";
+
# We need the following junk because of the include-files-from-libc.a magic.
# TODO. Is the following kosher from a Automake point of view? (I.e. a
# program `gnumach.o' that is then later used again as an object file.)
@@ -139,15 +143,15 @@ clib_routines := memcpy memmove memset bcopy bzero
\
udivdi3 __udivdi3 \
etext _edata end _end # actually ld magic, not libc.
gnumach-undef: gnumach.$(OBJEXT)
- $(NM) -u $< | sed 's/ *U *//' | sort -u > $@
+ $(NM_V) $(NM) -u $< | sed 's/ *U *//' | sort -u > $@
MOSTLYCLEANFILES += gnumach-undef
gnumach-undef-bad: gnumach-undef Makefile
- sed '$(foreach r,$(clib_routines),/^$r$$/d;)' $< > $@
+ $(AM_V_GEN) sed '$(foreach r,$(clib_routines),/^$r$$/d;)' $< > $@
MOSTLYCLEANFILES += gnumach-undef-bad
clib-routines.o: gnumach-undef gnumach-undef-bad
- if test -s gnumach-undef-bad; \
+ $(AM_V_at) if test -s gnumach-undef-bad; \
then cat gnumach-undef-bad; exit 2; else true; fi
- $(CCLD) -nostdlib -nostartfiles -r -static \
+ $(AM_V_CCLD) $(CCLD) -nostdlib -nostartfiles -r -static \
-o $@ `sed 's/^/-Wl,-u,/' < $<` -x c /dev/null -lc -lgcc
gnumach_LINK = $(LD) $(LINKFLAGS) $(gnumach_LINKFLAGS) -o $@
diff --git a/Makefrag.am b/Makefrag.am
index c33a378..9648ece 100644
--- a/Makefrag.am
+++ b/Makefrag.am
@@ -487,8 +487,8 @@ nodist_libkernel_a_SOURCES += \
MOSTLYCLEANFILES += \
gnumach.msgids
gnumach.msgids: $(filter %.msgids,$(nodist_libkernel_a_SOURCES))
- cat $^ > $@.new
- mv $@.new $@
+ $(AM_V_at) cat $^ > $@.new
+ $(AM_V_GEN) mv $@.new $@
# `exec_' prefix, so that we don't try to build that file during when running
# `make install-data', as it may fail there, but isn't needed there either.
exec_msgidsdir = $(datadir)/msgids
diff --git a/Makerules.am b/Makerules.am
index 37d383a..eff1405 100644
--- a/Makerules.am
+++ b/Makerules.am
@@ -17,14 +17,18 @@
# Building foo.h from foo.sym.
#
+AWK_V = $(AWK_V_$(V))
+AWK_V_ = $(AWK_V_$(AM_DEFAULT_VERBOSITY))
+AWK_V_0 = @echo " AWK $@";
+
EXTRA_DIST += \
gensym.awk
%.symc: %.sym gensym.awk
- $(AWK) -f $(word 2,$^) $< > $@
+ $(AWK_V) $(AWK) -f $(word 2,$^) $< > $@
%.symc.o: %.symc
- $(COMPILE) -S -x c -o $@ $<
+ $(AM_V_CC) $(COMPILE) -S -x c -o $@ $<
%.h: %.symc.o
- sed < $< > $@ \
+ $(AM_V_GEN) sed < $< > $@ \
-e 's/^[^*].*$$//' \
-e 's/^[*]/#define/' \
-e 's/mAgIc[^-0-9]*//'
@@ -36,8 +40,12 @@ include Makerules.mig.am
# gzip files.
#
+GZIP_V = $(GZIP_V_$(V))
+GZIP_V_ = $(GZIP_V_$(AM_DEFAULT_VERBOSITY))
+GZIP_V_0 = @echo " GZIP $@";
+
%.gz: %
- $(GZIP) -9 < $< > $@
+ $(GZIP_V) $(GZIP) -9 < $< > $@
#
# strip files.
diff --git a/Makerules.mig.am b/Makerules.mig.am
index b3f76da..2b6b1fe 100644
--- a/Makerules.mig.am
+++ b/Makerules.mig.am
@@ -57,6 +57,10 @@
# Building RPC stubs.
#
+MIGCOM_V = $(MIGCOM_V_$(V))
+MIGCOM_V_ = $(MIGCOM_V_$(AM_DEFAULT_VERBOSITY))
+MIGCOM_V_0 = @echo " MIG $@";
+
# TODO. Get rid of that stuff, lib_dep_tr_for_defs.a and the four following
# rules. See the thread at
# <http://lists.gnu.org/archive/html/automake/2006-10/msg00039.html> about what
@@ -72,20 +76,20 @@ lib_dep_tr_for_defs_a_CPPFLAGS = $(AM_CPPFLAGS) \
-E
%.server.defs.c: %.srv
- rm -f $@
- cp -p $< $@
+ $(AM_V_at) rm -f $@
+ $(AM_V_GEN) cp -p $< $@
%.user.defs.c: %.cli
- rm -f $@
- cp -p $< $@
+ $(AM_V_at) rm -f $@
+ $(AM_V_GEN) cp -p $< $@
%.server.h %.server.c %.server.msgids:
lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT)
- $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
- -sheader $*.server.h -server $*.server.c \
- -list $*.server.msgids \
+ $(MIGCOM_V) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
+ -sheader $*.server.h -server $*.server.c \
+ -list $*.server.msgids \
< $<
%.user.h %.user.c %.user.msgids: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT)
- $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
- -user $*.user.c -header $*.user.h \
- -list $*.user.msgids \
+ $(MIGCOM_V) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
+ -user $*.user.c -header $*.user.h \
+ -list $*.user.msgids \
< $<
# This is how it should be done, but this is not integrated into GNU Automake
diff --git a/configure.ac b/configure.ac
index 4e37590..1ba15f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,9 @@ dnl Do not clutter the main build directory.
dnl We require GNU make.
[-Wall -Wno-portability]
)
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
#
# Deduce the architecture we're building for.
--
1.6.5.2