2015-09-21 19:44:48 +00:00
|
|
|
CC = (getenv CC)
|
|
|
|
|
|
|
|
if (=s $CC "") [
|
|
|
|
echo "no compiler found, using cc"
|
|
|
|
CC = "cc"
|
|
|
|
] [
|
|
|
|
echo "using compiler:" $CC
|
|
|
|
]
|
|
|
|
|
2015-09-26 14:13:17 +00:00
|
|
|
echo "number of CPUs:" $numcpus
|
|
|
|
echo "number of jobs:" $numjobs
|
|
|
|
|
2015-08-15 00:21:20 +00:00
|
|
|
rule all test
|
|
|
|
|
2015-08-23 08:06:32 +00:00
|
|
|
OBJ = (strreplace (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-06 11:32:47 +00:00
|
|
|
rule- clean [
|
2015-08-15 00:21:20 +00:00
|
|
|
echo " CLEAN" $OBJ test
|
|
|
|
shell rm -f $OBJ test
|
|
|
|
]
|
|
|
|
|
|
|
|
// dependencies
|
|
|
|
|
|
|
|
rule foo.o foo.h
|
|
|
|
rule bar.o bar.h
|
|
|
|
rule test.o [foo.h bar.h]
|