On 1/24/09, Noah Slater <nsla...@gnu.org> wrote: > Hey, > > I have been using make to regenerate output documents as I write them in a > source format. This might involve writing in AsciiDoc and having make pick up > changes, generating a HTML page for me to preview my work. > > To aid the writing process I usually create a shell script like this: > > #!/bin/sh -e > > while true; do > make 2>&1 | grep -vi "nothing to be done" || true > sleep 1 > done > > This means that as I write, and save the file, my HTML is generated for me. > > When I think about it, there are many other situations where I can imagine it > would be useful to have make watch the input files for changes, updating the > output files when is appropriate.
Hi Noah, If you're running on a Linux machine, you might want to give tup a try: http://gittup.org/tup/ It's a build system based around a file monitor already (using inotify, hence the Linux-only requirement), so an autoupdate functionality sorta naturally followed. Assuming it works for you (which may be a big assumption - it's still pretty err... rough around the edges), it would be able to do what you're looking for without continually re-invoking a program every second. It also does a few other nice things, like delete old output files. For example, you could rename a webpage, and it would re-generate the output with the new name while getting rid of the old one. Of course, being fairly experimental at this point, it's entirely possible it won't do what you want or cause things to explode. Anyway, if you want to give it a shot feel free to send me a private email, as it's not technically related to GNU make, and the documentation probably isn't complete enough for someone unfamiliar with it to get started. I just posted the web pages a few minutes ago, so you would be wading into uncharted territory :). Hope it helps, -Mike _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make