forked from OctaForge/OctaBuild
36 lines
552 B
Plaintext
36 lines
552 B
Plaintext
CC = (getenv CC)
|
|
|
|
if (=s $CC "") [
|
|
echo "no compiler found, using cc"
|
|
CC = "cc"
|
|
] [
|
|
echo "using compiler:" $CC
|
|
]
|
|
|
|
echo "number of CPUs:" $numcpus
|
|
echo "number of jobs:" $numjobs
|
|
|
|
rule all test
|
|
|
|
OBJ = (strreplace (glob "*.c") ".c" ".o")
|
|
|
|
rule test $OBJ [
|
|
echo " LD" $target
|
|
shell $CC -o $target $sources
|
|
]
|
|
|
|
rule %.o %.c [
|
|
echo " CC" $target
|
|
shell $CC -c -o $target $source
|
|
]
|
|
|
|
rule clean [] [
|
|
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] |