add link to projects using redo; fix t/example mention (#20)
also rename t/111-compile2 to t/111-example
This commit is contained in:
parent
2a936a7574
commit
59eb7e8f1e
12 changed files with 7 additions and 6 deletions
3
t/111-example/.gitignore
vendored
Normal file
3
t/111-example/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
*.o
|
||||
CC
|
||||
hello
|
||||
11
t/111-example/CC.do
Normal file
11
t/111-example/CC.do
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
redo-ifchange config.sh
|
||||
. ./config.sh
|
||||
exec >$3
|
||||
cat <<-EOF
|
||||
redo-ifchange \$2.c
|
||||
cc $CFLAGS -MD -MF \$3.deps -o \$3 -c \$2.c
|
||||
read DEPS <\$3.deps
|
||||
rm -f \$3.deps
|
||||
redo-ifchange \${DEPS#*:}
|
||||
EOF
|
||||
chmod +x $3
|
||||
6
t/111-example/Makefile
Normal file
6
t/111-example/Makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
all:
|
||||
|
||||
%: FORCE
|
||||
+redo $@
|
||||
|
||||
.PHONY: FORCE
|
||||
1
t/111-example/all.do
Normal file
1
t/111-example/all.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
redo-ifchange hello
|
||||
1
t/111-example/clean.do
Normal file
1
t/111-example/clean.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
rm -f *.tmp *~ *.o hello CC
|
||||
1
t/111-example/config.sh
Normal file
1
t/111-example/config.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
CFLAGS="-Wall"
|
||||
2
t/111-example/default.o.do
Normal file
2
t/111-example/default.o.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange CC
|
||||
. ./CC "$@"
|
||||
4
t/111-example/hello.do
Normal file
4
t/111-example/hello.do
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
DEPS="main.o
|
||||
mystr.o"
|
||||
redo-ifchange $DEPS
|
||||
cc -o $3 $DEPS
|
||||
8
t/111-example/main.c
Normal file
8
t/111-example/main.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include "mystr.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%s\n", mystr);
|
||||
return 0;
|
||||
}
|
||||
4
t/111-example/mystr.c
Normal file
4
t/111-example/mystr.c
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
#include "mystr.h"
|
||||
|
||||
char *mystr = "Hello, world!";
|
||||
6
t/111-example/mystr.h
Normal file
6
t/111-example/mystr.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef __MYSTR_H
|
||||
#define __MYSTR_H
|
||||
|
||||
extern char *mystr;
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue