tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: asynchronous make(1), anyone?



On Wed, Apr 11, 2012 at 05:01:34PM -0500, David Young wrote:
> You can save a programmer who is in an edit-compile-test loop some
> effort at the keyboard if, as soon as they write a new version of some
> source file, the computer automatically recompiles their program.
> 
> One way to automate that is to run make(1) in a tight loop,
> 
>         while true; do
>                 make <targets>
>         done
> 
> but I think that to do that fast enough that the programmer does not
> have to wait very often for the computer, you would have to be very
> fast, and the computer will waste a lot of energy re-running make(1).
> 
> How hard would it be to make make(1) sleep until any one of its targets
> was older than its sources, build out-of-date targets, and repeat?  This
> may be a good application for kqueue(2)'s EVFILT_VNODE filter?
> 
> Any volunteers to make it so?
> 
> Dave

Yes, I've been looking for such a tool for some time, and finally wrote
such utility to do just this:

https://bitbucket.org/eradman/entr/

  Event Notify Test Runner

  entr - a utility for running arbitrary commands when files change.
  Uses kqueue(2) to avoid polling.

Feedback is welcome!

--
Eric Radman  |  http://eradman.com


Home | Main Index | Thread Index | Old Index