Work in progress; some improvements to the instantiation bit (factorise certain things, etc.)

This commit is contained in:
Laurence Withers 2006-07-25 19:49:22 +01:00
commit 34237efa4b
3 changed files with 25 additions and 25 deletions

View file

@ -1,13 +1,10 @@
if [ $# -ne 2 ]
then
print_failure "Not enough arguments after module; need CNAME HEADER_NAME."
echo "CNAME is the C identifier version of the module name."
print_failure "Not enough arguments after module; need HEADER_NAME."
echo "HEADER_NAME is the name of the header file."
exit 1
fi
CNAME=$1
shift
HEADER_NAME=$1
shift
@ -33,12 +30,9 @@ 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,@CNAME@,${CNAME},g" -i {} \; || exit 1
do_cmd find . -type f -exec sed -e "s,@NAMEMINUSL@,${NAMEMINUSL},g" -i {} \; || exit 1
do_cmd find . -type f -exec sed -e "s,@HEADER_NAME@,${HEADER_NAME},g" -i {} \; || exit 1
do_cmd grep "@TODO@" * || exit 1
print_success "Module instantiated."
do_parameter_subst NAMEMINUSL HEADER_NAME
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4