This patch modifies several files in the build system (mainly common.rmk
and genmk.rb) to reduce the general verbosity of the build process to a
manageable, semi-informative level. Thus, what currently appears as
"gcc" calls, several lines long each is turned into lines like:

[M xfs.mod] COMPILE ../src/fs/xfs.c ->
xfs_mod-fs_xfs.o                                                                
                                                                  
[M xfs.mod] LINK xfs_mod-fs_xfs.o ->
pre-xfs.o                                                                       
                                                                    
[M xfs.mod] Looking for EXPORTED SYMBOL definitions: pre-xfs.o

And so on. The change also makes warning-hunting marginally easier,
though not by much since the patch intentionally shows a line for nearly
every process that did so previously. This behavior could be simplified
further if needed - this post is more of an RFC than anything else.
Also, it is by no means thorough or complete - only the most common
processes have been addressed - as I'm a bit busy with exams.

The patch makes the new behavior the default one, so a new make-time
option is added: V (for "verbose"), which must have the value 1 in order
to get the behavior, as in "make V=1"
Index: Makefile.in
===================================================================
--- Makefile.in	(revisión: 1954)
+++ Makefile.in	(copia de trabajo)
@@ -138,18 +138,30 @@
 CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA)
 pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst
 moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
-	cat $(DEFSYMFILES) /dev/null \
+ifneq ($(V),1)
+	@echo [L moddep.lst] Building MODULE DEPENDENCIES list
+endif
+	$(SILENT)cat $(DEFSYMFILES) /dev/null \
 	  | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
 	  || (rm -f $@; exit 1)
 
 command.lst: $(COMMANDFILES)
-	cat $^ /dev/null | sort > $@
+ifneq ($(V),1)
+	@echo [L command.lst] Building COMMAND list
+endif
+	$(SILENT)cat $^ /dev/null | sort > $@
 
 fs.lst: $(FSFILES)
-	cat $^ /dev/null | sort > $@
+ifneq ($(V),1)
+	@echo [L fs.lst] Building FILESYSTEM list
+endif
+	$(SILENT)cat $^ /dev/null | sort > $@
 
 partmap.lst: $(PARTMAPFILES)
-	cat $^ /dev/null | sort > $@
+ifneq ($(V),1)
+	@echo [L partmap.lst] Building PARTMAP list
+endif
+	$(SILENT)cat $^ /dev/null | sort > $@
 
 ifeq (, $(UNIFONT_BDF))
 else
Index: conf/common.rmk
===================================================================
--- conf/common.rmk	(revisión: 1954)
+++ conf/common.rmk	(copia de trabajo)
@@ -1,5 +1,9 @@
 # -*- makefile -*-
 
+ifneq ($(V),1)
+SILENT = @
+endif
+
 # For grub-mkelfimage.
 bin_UTILITIES += grub-mkelfimage
 grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
@@ -125,26 +129,27 @@
 
 # For grub-mkconfig
 grub-mkconfig: util/grub-mkconfig.in config.status
-	./config.status --file=$@:$<
-	chmod +x $@
+	$(SILENT)./config.status --file=$@:$<
+	$(SILENT)chmod +x $@
 sbin_SCRIPTS += grub-mkconfig
 CLEANFILES += grub-mkconfig
 
 grub-mkconfig_lib: util/grub-mkconfig_lib.in config.status
-	./config.status --file=$@:$<
-	chmod +x $@
+	$(SILENT)./config.status --file=$@:$<
+	$(SILENT)chmod +x $@
 lib_DATA += grub-mkconfig_lib
 CLEANFILES += grub-mkconfig_lib
 
 update-grub_lib: util/update-grub_lib.in config.status
-	./config.status --file=$@:$<
-	chmod +x $@
+	$(SILENT)./config.status --file=$@:$<
+	$(SILENT)chmod +x $@
 lib_DATA += update-grub_lib
 CLEANFILES += update-grub_lib
 
 %: util/grub.d/%.in config.status
-	./config.status --file=$@:$<
-	chmod +x $@
+#no need to echo nothing here: config.status already does so
+	$(SILENT)./config.status --file=$@:$<
+	$(SILENT)chmod +x $@
 grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom
 ifeq ($(target_os), cygwin)
 grub-mkconfig_SCRIPTS += 10_windows
Index: genmk.rb
===================================================================
--- genmk.rb	(revisión: 1954)
+++ genmk.rb	(copia de trabajo)
@@ -57,10 +57,16 @@
 MOSTLYCLEANFILES += #{deps_str}
 
 #...@name}: #{exe}
+ifneq ($(V),1)
+	@echo [I #...@name}] OBJCOPY $< '->' $@
+endif
 	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
 
 #{exe}: #{objs_str}
-	$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
+ifneq ($(V),1)
+	@echo [I #...@name}] LINK $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -71,7 +77,10 @@
       dir = File.dirname(src)
       
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
+ifneq ($(V),1)
+	@echo [I #...@name}] COMPILE $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
 "
@@ -113,29 +122,47 @@
 UNDSYMFILES += #{undsym}
 
 #...@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF)
-	-rm -f $@
-	$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj}
-	if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi
-	$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@
+	$(SILENT)-rm -f $@
+ifneq ($(V),1)
+	@echo [M #...@name}] LINK #{pre_obj} #{mod_obj} '->' $@
+endif
+	$(SILENT)$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj}
+	$(SILENT)if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi
+ifneq ($(V),1)
+	@echo [M #...@name}] STRIP $@
+endif
+	$(SILENT)$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@
 
 #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-	-rm -f $@
-	$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{objs_str}
+	$(SILENT)-rm -f $@
+ifneq ($(V),1)
+	@echo [M #...@name}] LINK #{objs_str} '->' $@
+endif
+	$(SILENT)$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{objs_str}
 
 #{mod_obj}: #{mod_src}
-	$(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
+ifneq ($(V),1)
+	@echo [M #...@name}] COMPILE $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
 
 #{mod_src}: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh
-	sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1)
+	$(SILENT)sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1)
 
 ifneq ($(#{prefix}_EXPORTS),no)
 #{defsym}: #{pre_obj}
-	$(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1 #{mod_name}/' > $@
+ifneq ($(V),1)
+	@echo [M #...@name}] Looking for EXPORTED SYMBOL definitions: $<
 endif
+	$(SILENT)$(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1 #{mod_name}/' > $@
+endif
 
 #{undsym}: #{pre_obj}
-	echo '#{mod_name}' > $@
-	$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
+ifneq ($(V),1)
+	@echo [M #...@name}] Looking for REQUESTED SYMBOL definitions: $<
+endif
+	$(SILENT)echo '#{mod_name}' > $@
+	$(SILENT)$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -149,7 +176,10 @@
       dir = File.dirname(src)
 
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
+ifneq ($(V),1)
+	@echo [M #...@name}] COMPILE $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
 CLEANFILES += #{command} #{fs} #{partmap}
@@ -158,17 +188,26 @@
 PARTMAPFILES += #{partmap}
 
 #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh
-	set -e; \
+ifneq ($(V),1)
+	@echo [M #...@name}] Looking for COMMAND definitions: $<
+endif
+	$(SILENT)set -e; \
 	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 #{fs}: #{src} $(#{src}_DEPENDENCIES) genfslist.sh
-	set -e; \
+ifneq ($(V),1)
+	@echo [M #...@name}] Looking for FILESYSTEM definitions: $<
+endif
+	$(SILENT)set -e; \
 	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 #{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh
-	set -e; \
+ifneq ($(V),1)
+	@echo [M #...@name}] Looking for PARTMAP definitions: $<
+endif
+	$(SILENT)set -e; \
 	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
@@ -199,7 +238,10 @@
 MOSTLYCLEANFILES += #{deps_str}
 
 #...@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-	$(CC) -o $@ #{objs_str} $(LDFLAGS) $(#{prefix}_LDFLAGS)
+ifneq ($(V),1)
+	@echo [U #...@name}] LINK $< '->' $@
+endif
+	$(SILENT)$(CC) -o $@ #{objs_str} $(LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -208,7 +250,10 @@
       dir = File.dirname(src)
 
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
-	$(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -MD -c -o $@ $<
+ifneq ($(V),1)
+	@echo [U #...@name}] COMPILE $< '->' $@
+endif
+	$(SILENT)$(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -MD -c -o $@ $<
 -include #{dep}
 
 "
@@ -237,7 +282,10 @@
 MOSTLYCLEANFILES += #{deps_str}
 
 #...@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-	$(TARGET_CC) -o $@ #{objs_str} $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
+ifneq ($(V),1)
+	@echo [P #...@name}] LINK $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) -o $@ #{objs_str} $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -246,7 +294,10 @@
       dir = File.dirname(src)
 
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $<
+ifneq ($(V),1)
+	@echo [P #...@name}] COMPILE $< '->' $@
+endif
+	$(SILENT)$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $<
 -include #{dep}
 
 "
@@ -273,8 +324,9 @@
     "CLEANFILES += #...@name}
 
 #...@name}: #{src} $(#{src}_DEPENDENCIES) config.status
-	./config.status --file=#{name}:#{src}
-	chmod +x $@
+#no need to echo nothing here: config.status already does so
+	$(SILENT)./config.status --file=#{name}:#{src}
+	$(SILENT)chmod +x $@
 
 "
   end

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to