19

Is there a way to have make echo commands that are manually suppressed with @ in the makefile? I can't find this in the help or man page, it just says "--quiet" to do the opposite.

gatoatigrado
  • 16,580
  • 18
  • 81
  • 143

2 Answers2

24
  • The most obvious idea is to change the shell that runs the commands, e.g. modify your makefile and add to the top SHELL = sh -xv.
  • Another solution is to change how you call make to make SHELL='sh -xv'
  • Lastly if your Makefile is generated by cmake then call make with make VERBOSE=1
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177
reinierpost
  • 8,425
  • 1
  • 38
  • 70
  • I found out that the nVidia SDK makefiles actually have a VERBOSE option (so make VERBOSE= works), but this is an awesome and more general solution! Thanks! – gatoatigrado Dec 11 '10 at 04:14
  • SHELL = sh -xv isn't doing anything for me. neither (SHELL="sh -xv" make) nor (export SHELL="sh -xv" && make) – gman Jun 21 '12 at 09:42
  • 6
    @gman: You need it to include it into the make command (`make SHELL='sh -xv'` or into the Makefile. – reinierpost Jun 22 '12 at 09:25
  • 1
    `-v` had no effect on Dash 0.5.7 (Ubuntu 14.04), I think because it ignores `-c` commands, which is how `Make` must be running them. Works for GNU Bash though. – Ciro Santilli OurBigBook.com Aug 14 '15 at 13:33
  • A side effect of this approach is that it echoes any function exports that may be in the user's `.bashrc` contents for each shell instantiation. – gone Dec 23 '21 at 05:13
  • If using parallel building `-j#`, then the output may not be what you expect due to race conditions between spawned shells. – gone Dec 23 '21 at 06:32
11

I run into this question from time to time using cmake because it hides the command. You can use "make VERBOSE=true" to get them to print out.

cheshirekow
  • 4,797
  • 6
  • 43
  • 47