forked from Telodendria/Telodendria
Add a recipe to build the examples.
This commit is contained in:
parent
faaa12c51f
commit
c511ca9f0f
1 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,7 @@ addprefix() {
|
||||||
|
|
||||||
: "${SRC:=src}"
|
: "${SRC:=src}"
|
||||||
: "${TOOLS:=tools}"
|
: "${TOOLS:=tools}"
|
||||||
|
: "${EXAMPLES:=examples}"
|
||||||
: "${BUILD:=build}"
|
: "${BUILD:=build}"
|
||||||
: "${OUT:=out}"
|
: "${OUT:=out}"
|
||||||
: "${STUB:=RtStub}"
|
: "${STUB:=RtStub}"
|
||||||
|
@ -195,6 +196,22 @@ recipe_build() {
|
||||||
recipe_docs
|
recipe_docs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recipe_examples() {
|
||||||
|
for src in $(find "${EXAMPLES}" -name '*.c'); do
|
||||||
|
out=$(basename "$src" .c)
|
||||||
|
out="${OUT}/bin/$out"
|
||||||
|
|
||||||
|
if [ $(mod_time "$src") -ge $(mod_time "$out") ]; then
|
||||||
|
echo "CC $(basename $out)"
|
||||||
|
mkdir -p "$(dirname $out)"
|
||||||
|
if ! $CC $CFLAGS -o "$out" "$src" "${OUT}/lib/${LIB_NAME}.o" "-L${OUT}/lib" "-l${LIB_NAME}" ${LDFLAGS}; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
recipe_clean() {
|
recipe_clean() {
|
||||||
rm -r "${BUILD}" "${OUT}"
|
rm -r "${BUILD}" "${OUT}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue