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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -