makefile - Make doesn't finish when run with entr -


i'm trying use entr recompile change c file following command:

$ echo ex8.c | entr make ex8 && ./ex8 

when run cc output nothing happends

$ echo ex8.c | entr make ex8 && ./ex8 cc -wall -g    ex8.c   -o ex8 

if write manually works great

$ make ex8 && ./ex8 

how should write entr work?

the man page wasn't quite detailed enough, installed , tried it. note command 3 distinct shell commands: echo ex8.c, entr make ex8, , ./ex8. these connected pipe (the first two) , && operator (the final two). 2 commands in pipeline both started in parallel. final command not invoked until pipeline completes, if exit code success run.

this means final command ./ex8 not started until after entr make ex8 command finishes. but, entr not exit after runs make 1 time: entire point continue watch source file , run make every time changes. that's why final command never invoked: entr never exits.

there multiple ways fix simplest way add rule makefile build and run command, call make; add makefile:

.phony: run-ex8 run-ex8: ex8         ./$< 

now use entr this:

echo ex8.c | entr make run-ex8 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -