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
Post a Comment