makefile - Getting Quiet Make to echo command lines on error -


i have makefile building many c files long long command lines , we've cleaned output having rules such as:

.c${mt}.doj:          @echo "compiling $<";\          $(compiler) $(copts) -c -o $@ $< 

now great @ suppresses compilation line being emitted. when error, error message, no command line. can think of "neat" way emit command line? can think of doing echoing file , have higher level make catch error , cat file. hacky know.

tested , worked (gnu make in linux):

.c${mt}.doj:      @echo "compiling $<";\           $(compiler) $(copts) -c -o $@ $<  \           || echo "error in command: $(compiler) $(copts) -c -o $@ $<" \           && false 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -