2015-11-06 19:40:09 +00:00
|
|
|
CC = (getenv CC cc)
|
2015-11-06 19:38:37 +00:00
|
|
|
OBJ = (extreplace (glob *.c) .c .o)
|
2015-08-15 00:21:20 +00:00
|
|
|
|
|
|
|
rule test $OBJ [
|
|
|
|
echo " LD" $target
|
2015-09-21 19:44:48 +00:00
|
|
|
shell $CC -o $target $sources
|
2015-08-15 00:21:20 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
rule %.o %.c [
|
|
|
|
echo " CC" $target
|
2015-09-21 19:44:48 +00:00
|
|
|
shell $CC -c -o $target $source
|
2015-08-15 00:21:20 +00:00
|
|
|
]
|
|
|
|
|
2015-10-26 17:58:47 +00:00
|
|
|
action clean [
|
2015-08-15 00:21:20 +00:00
|
|
|
echo " CLEAN" $OBJ test
|
|
|
|
shell rm -f $OBJ test
|
|
|
|
]
|
|
|
|
|
2015-10-26 17:58:47 +00:00
|
|
|
action info [
|
2015-11-06 19:40:09 +00:00
|
|
|
echo compiler: $CC
|
|
|
|
echo number of CPUs: $numcpus
|
|
|
|
echo number of jobs: $numjobs
|
2015-10-25 18:30:01 +00:00
|
|
|
]
|
|
|
|
|
2015-10-29 17:34:33 +00:00
|
|
|
action test_invoke [
|
|
|
|
invoke test
|
|
|
|
]
|
|
|
|
|
2015-08-15 00:21:20 +00:00
|
|
|
// dependencies
|
|
|
|
|
2015-10-30 20:28:18 +00:00
|
|
|
depend foo.o foo.h
|
|
|
|
depend bar.o bar.h
|
2015-11-06 19:38:37 +00:00
|
|
|
depend test.o [foo.h bar.h]
|
|
|
|
|
|
|
|
// default rule
|
|
|
|
|
|
|
|
rule default test
|