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
25
scripts/build.c.app/instantiate
Normal file
25
scripts/build.c.app/instantiate
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
if [ $# -ne 0 ]
|
||||
then
|
||||
print_failure "Too many arguments. None required for this module."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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 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