Create a local copy of the scripts directory.
The idea is to move the build system out of the project tree as much as possible. This has two benefits: - it does not add any baggage to somebody who just wants to compile the project, and doesn't want to create any new modules, - it means that project trees don't have to be updated every time a change is made to the module instantiation stuff.
This commit is contained in:
parent
201586b051
commit
87272247fb
65 changed files with 1561 additions and 0 deletions
43
scripts/build.c.tests/build.tests
Normal file
43
scripts/build.c.tests/build.tests
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# @NAME@_BUILT
|
||||
#
|
||||
|
||||
#@TODO@ build_target libs || return 1
|
||||
|
||||
if [ -z ${@NAME@_BUILT} ]
|
||||
then
|
||||
LIBS="" # @TODO@ internal libs
|
||||
EXTRAS="" # @TODO@ libs, cflags
|
||||
|
||||
echo "Building test programs..."
|
||||
do_cmd mkdir -p obj/tests || return 1
|
||||
|
||||
for SRC in src/@NAME@/*.c
|
||||
do
|
||||
TEST="obj/tests/$(basename ${SRC} | sed -e 's,.c$,,')"
|
||||
MODIFIED=0
|
||||
for file in ${LIBS} ${SRC} src/@NAME@/build.tests
|
||||
do
|
||||
if [ ${file} -nt ${TEST} ]
|
||||
then
|
||||
MODIFIED=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${MODIFIED} -ne 0 ]
|
||||
then
|
||||
do_cmd ${CC} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} || return 1
|
||||
print_success "Built ${TEST}"
|
||||
else
|
||||
print_success "${TEST} is up to date"
|
||||
fi
|
||||
done
|
||||
|
||||
print_success "All tests built"
|
||||
|
||||
@NAME@_BUILT=1
|
||||
fi
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
# vim: expandtab:ts=4:sw=4
|
||||
Loading…
Add table
Add a link
Reference in a new issue