Suppose I have three files: foo, bar, and diff. Think of foo as a master file and bar as a variation. In reality there will be lots of bar files and corresponding diff files, but I think that if I can solve the problem for one, I can solve it for many.
The idea is that diff records the differences between foo and bar. So I have foo and bar, I can create diff by executing diff -u foo bar >diff Similarly, if I have foo and diff, I can create bar by executing patch -i diff -o bar foo I will never use foo or diff directly, but I will edit both foo and bar. Other files in the makefile will depend on bar, for example. Because bar can be made from foo and diff, one would think I should say bar: foo diff patch -i diff -o bar foo This will successfully recreate bar if I edit foo. However, it will not update diff. In general, I would like to update diff as soon as I change bar for any reason, which suggests adding this: diff: foo bar /bin/diff -u foo bar >diff But of course this creates a circular dependency. So far, the best way I've found to deal with this is the following: bar: foo diff patch -i foo -o bar diff -/bin/diff -u foo bar >diff touch --reference=diff bar So the idea is that whenever bar is out of date, I remake it from diff and foo, remake diff from foo and bar, and then give bar the same date as diff so that it won't be made again the next time around. But this procedure seems tricky enough that it makes me uncomfortable. I wonder if someone else has a better idea. _______________________________________________ help-gnu-utils mailing list help-gnu-utils@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-utils