Support for default.*.do rules.

I *think* this was the last missing part from djb's spec.  Certainly it's an
important one for any real project.
This commit is contained in:
Avery Pennarun 2010-11-16 01:59:32 -08:00
commit c1f09f564b
11 changed files with 75 additions and 16 deletions

6
t/.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
c
c.c
c.c.c
c.c.c.b
c.c.c.b.b
d

View file

@ -1,2 +1,2 @@
redo-ifchange hello yellow bellow
redo-ifchange hello yellow bellow c d

1
t/c.c.c.b.b.a Normal file
View file

@ -0,0 +1 @@
chicken

3
t/c.do Normal file
View file

@ -0,0 +1,3 @@
redo-ifchange $1$2.c
echo c.do
cat $1$2.c

3
t/clean.do Normal file
View file

@ -0,0 +1,3 @@
rm -f c c.c c.c.c c.c.c.b c.c.c.b.b d

10
t/default.b.do Normal file
View file

@ -0,0 +1,10 @@
if [ -e "$1$2.a" -o -e "default$2.a" ]; then
redo-ifchange "$1$2.a"
echo a-to-b
cat "$1$2.a"
else
redo-ifchange "$1$2.b"
echo b-to-b
cat "$1$2.b"
fi
./sleep 1.1

4
t/default.c.c.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange $1$2.b
echo b-to-cc
cat $1$2.b
./sleep 1.2

4
t/default.c.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange $1$2.c
echo c-to-c
cat $1$2.c
./sleep 1.3

4
t/default.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange c
echo default-rule
cat c
./sleep 1.4