Major work in progress on build system module instantiation.
This commit is contained in:
parent
9e8d1e4c15
commit
11f2baa34b
53 changed files with 512 additions and 113 deletions
38
skel/scripts/build.c.tests/instantiate
Normal file
38
skel/scripts/build.c.tests/instantiate
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
if [ $# -lt 1 ]
|
||||
then
|
||||
print_failure "Not enough arguments after module; need LIBS."
|
||||
echo "LIBS are the library module names for these test programs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LIBS="$@"
|
||||
|
||||
for lib in ${LIBS}
|
||||
do
|
||||
if [ ! -e src/${lib} ]
|
||||
then
|
||||
print_failure "src/${lib} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e src/${NAME} ]
|
||||
then
|
||||
print_failure "src/${NAME} already exists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Instantiating module src/${NAME}..."
|
||||
|
||||
do_cmd mkdir src/${NAME} || exit 1
|
||||
do_cmd cp ${TEMPLATE}/* src/${NAME} || exit 1
|
||||
|
||||
do_cmd cd src/${NAME} || exit 1
|
||||
do_cmd rm instantiate || exit 1
|
||||
do_cmd find . -type f -exec sed -e "s,@NAME@,${NAME},g" -i {} \; || exit 1
|
||||
do_cmd find . -type f -exec sed -e "s,@LIBS@,${LIBS},g" -i {} \; || exit 1
|
||||
do_cmd grep "@TODO@" * || exit 1
|
||||
print_success "Module instantiated."
|
||||
|
||||
# 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