diff --git a/scripts/build.c++.app/build.app b/scripts/build.c++.app/build.app index 4b38f97..a0e67d5 100644 --- a/scripts/build.c++.app/build.app +++ b/scripts/build.c++.app/build.app @@ -26,7 +26,7 @@ then then echo " Compiling..." - do_cmd ${CXX} ${CFLAGS} -o "${@NAME@}" ${SRC} ${EXTRAS} || return 1 + do_cmd ${CXX} ${CFLAGS} -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1 print_success "Application built" else diff --git a/scripts/build.c.app/build.app b/scripts/build.c.app/build.app index bd1167f..4da727d 100644 --- a/scripts/build.c.app/build.app +++ b/scripts/build.c.app/build.app @@ -26,7 +26,7 @@ then then echo " Compiling..." - do_cmd ${CC} ${CFLAGS} -o "${@NAME@}" ${SRC} ${EXTRAS} || return 1 + do_cmd ${CC} ${CFLAGS} -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1 print_success "Application built" else diff --git a/scripts/build.c.app/build.monolithic b/scripts/build.c.app/build.monolithic index 878d05d..e9258b4 100644 --- a/scripts/build.c.app/build.monolithic +++ b/scripts/build.c.app/build.monolithic @@ -7,7 +7,7 @@ MONOLITHIC_TESTS="src/@NAME@/build.app src/@NAME@/build.monolithic" if [ -z "${@NAME@_MONOLITHIC}" ] then - MONOLITHIC_SOURCE="$(echo src/@NAME@/TopHeader.h) $(echo src/@NAME@/TopSource.c)" + MONOLITHIC_SOURCE="$(echo src/@NAME@/TopSource.c)" make_monolithic ${SRC} C || return 1 @NAME@_MONOLITHIC=1 diff --git a/scripts/build.c.app/instantiate b/scripts/build.c.app/instantiate index f8f4e51..9fb90de 100644 --- a/scripts/build.c.app/instantiate +++ b/scripts/build.c.app/instantiate @@ -4,22 +4,8 @@ then 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." +do_parameter_subst +true # kate: replace-trailing-space-save true; space-indent true; tab-width 4; # vim: expandtab:ts=4:sw=4 diff --git a/scripts/module-create.sh b/scripts/module-create.sh index 0d840c8..cbea1f6 100755 --- a/scripts/module-create.sh +++ b/scripts/module-create.sh @@ -75,12 +75,18 @@ then exit 1 fi -echo "Instantiating module 'src/${NAME}'..." -do_cmd cp -r ${TEMPLATE} src/${NAME} || exit 1 -do_cmd cd src/${NAME} || exit 1 -do_cmd rm instantiate || exit 1 +cleanup() { + rm -rf "src/${NAME}" + print_failure "Removed 'src/${NAME}'" + exit 1 +} -do_cmd source ${TEMPLATE}/instantiate || exit 1 +echo "Instantiating module 'src/${NAME}'..." +do_cmd cp -rL ${TEMPLATE} src/${NAME} || cleanup +do_cmd cd src/${NAME} || cleanup +do_cmd rm instantiate || cleanup + +( source ../../${TEMPLATE}/instantiate ) || cleanup print_success "Module instantiated" grep -r "@TODO@" .