Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable quiet build using automake?

Tags:

automake

Imagine the following target and command generated by autoconf:

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
    $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo

I'm looking for a way in Makefile.am to manipulate that command, knowing that the command is generated by autoconf and I don't know what it is. In theory, something like this:

if BUILD_QUIETLY
    Q=@
endif

.c.lo:
     $(Q)$(autoconf-command-for-c-lo)

Or something like this (this is similar to Linux kernel's build output):

quiet_cmd_cc = CC     $@
      cmd_cc = $(autoconf-command-for-c-o)

.c.o:
    $(call cmd,cc)

Where cmd is a function that executes cmd_$1 and either prints quiet_cmd_$1 or cmd_$1 based on a variable.

I looked for this on the internet, but most of the websites talk about the basics of autoconf. There doesn't seem to be any questions related to this here either.

Is this even possible?

like image 545
Shahbaz Avatar asked Oct 19 '25 10:10

Shahbaz


1 Answers

Per chirlu's comment, automake has an option to generate quiet output builds.

This page has the necessary instructions. In short, put the following in configure.ac:

AM_SILENT_RULES([yes])

To then disable it, either do:

make V=0

after configuration, or:

./configure --enable-silent-rules

on configuration.

like image 91
Shahbaz Avatar answered Oct 22 '25 05:10

Shahbaz