Commit graph

70 commits

Author SHA1 Message Date
Avery Pennarun
edd8382a52 Change the default rule name from 'it' to 'all'.
This is a departure from how djb seems to have it set up, but I just like it
better.  It's more like the reasonably-common Makefile standard.  (Although
what make *actually* does is just use the first target declared in the
file.)
2010-11-13 01:40:37 -08:00
Avery Pennarun
7a8b7340a3 Use the SHELL variable instead of assuming 'sh'.
This is what GNU make does.  If SHELL isn't defined, we still fall back to
calling sh.

Rumour has it that Google has some kind of build system that can be
massively distributed if you just set SHELL to the right program; maybe
it'll work with redo now.  (Of course it won't do you any good until we
implement parallel builds...)
2010-11-13 01:30:31 -08:00
Avery Pennarun
0bd6d07155 Prettier printing of errors. 2010-11-13 01:21:59 -08:00
Avery Pennarun
89449b909c redo.py: don't add dependencies on files we rebuild.
redo-ifchange already does this, and then calls redo.py, so it's redundant.

The only weird case is if a .do file calls 'redo' instead of
'redo-ifchange'.  I'm not sure what exactly is supposed to happen here.
test.do does this, for example, and it works, but only because we always do
'redo test' and nobody depends on 'redo-ifchange test'; if they did, the
dependencies would be off, I guess.  But maybe it's meaningless to do that
anyway.
2010-11-13 01:10:29 -08:00
Avery Pennarun
fc27b19108 Merge libdo.py and log.py into helpers.py. 2010-11-13 00:53:55 -08:00
Avery Pennarun
c57de820fb Move 'redo --ifchange' into 'redo-ifchange' to match djb's style.
It does simplify the logic of both redo.py and redo-ifchange.py, I suppose.
2010-11-13 00:47:49 -08:00
Avery Pennarun
63c596ac61 Move log stuff into a separate log.py. 2010-11-13 00:11:34 -08:00
Avery Pennarun
440af04821 Move creation of .redo directory.
This fixes "./redo clean test", since clean.do deletes .redo.
2010-11-12 23:58:39 -08:00
Avery Pennarun
903793ecd9 Colourize redo's output. 2010-11-12 23:58:32 -08:00
Avery Pennarun
2e71e20ce2 When auto-choosing a .redo dir, prefer ones uphill that already exist.
So if we're in redo/t/ and running 'redo hello', we'll detect redo/.redo and
use that one rather than creating a new redo/t/.redo directory.

The downside of this is we get slightly different behaviour if the *first*
thing you build isn't from the root.  Probably that's bad, but it should
hopefully be rare.
2010-11-12 23:23:06 -08:00
Avery Pennarun
3c16056c21 When running x/y/z/whatever.do, first cd to x/y/z.
That way it's exactly equivalent to
	cd x/y/z; redo whatever
2010-11-12 23:14:58 -08:00
Avery Pennarun
45c6aad649 use os.environ[] instead of os.getenv/os.putenv.
Oddly, in python, os.putenv() does not make changes that os.getenv() can see.
2010-11-12 23:14:02 -08:00
Avery Pennarun
f43187b73a 'make clean' can now safely remove .redo dirs. 2010-11-12 22:50:23 -08:00
Avery Pennarun
425a295d6f Use a single .redo dir for the entire build. 2010-11-12 22:47:03 -08:00
Avery Pennarun
2ed0511094 Cleaner environment variable management in redo.py. 2010-11-12 22:14:39 -08:00
Avery Pennarun
07d3e3b13c Extremely basic integration of wvtest for testing.
And move test scripts into t/ subdir to keep things clean.

As part of that, make sure redo adds itself to the PATH on startup so that
subscripts can find it.
2010-11-12 17:19:42 -08:00
Avery Pennarun
ae5b71fbc1 Add a -v (verbose) option. 2010-11-12 07:10:55 -08:00
Avery Pennarun
9a45f066f8 Add actual dependency checking. 2010-11-12 07:03:06 -08:00
Avery Pennarun
ee8a3c8c6e More comprehensible output as we produce stuff. 2010-11-12 05:32:38 -08:00
Avery Pennarun
a51764c907 Extremely basic first crack at implementing djb's redo.
And a test program.
2010-11-12 05:25:03 -08:00