Port over docs and firmware, and store module parameters.

This commit is contained in:
Laurence Withers 2006-07-26 19:38:18 +01:00
parent 6f0cbc059d
commit 22876dac1f
8 changed files with 24 additions and 51 deletions

View File

@ -1,11 +1,11 @@
# These are external variables, and shouldn't clash with anything else # These are external variables, and shouldn't clash with anything else
# @NAME@_BUILT # @CNAME@_BUILT
# #
MONOLITHIC_@NAME@="${MONOLITHIC_DOC} $(echo src/@NAME@/*.dox)" MONOLITHIC_DOC="${MONOLITHIC_DOC} $(echo src/@NAME@/*.dox)"
build_target monolithic build_target monolithic
if [ -z ${@NAME@_BUILT} ] if [ -z ${@CNAME@_BUILT} ]
then then
echo "Building documentation with Doxygen..." echo "Building documentation with Doxygen..."
@ -19,7 +19,7 @@ then
fi fi
MODIFIED=0 MODIFIED=0
for file in ${MONOLITHIC_@NAME@} for file in ${MONOLITHIC_DOC}
do do
if [ ${file} -nt html/index.html ] if [ ${file} -nt html/index.html ]
then then
@ -36,7 +36,7 @@ then
print_success "Documentation is up to date" print_success "Documentation is up to date"
fi fi
@NAME@_BUILT=1 @CNAME@_BUILT=1
fi fi
# kate: @KATE_MODELINE@ # kate: @KATE_MODELINE@

View File

@ -4,22 +4,8 @@ then
exit 1 exit 1
fi fi
if [ -e src/${NAME} ] do_parameter_subst
then true
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; # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4 # vim: expandtab:ts=4:sw=4

View File

@ -1,4 +1,4 @@
/* @P@/src/capp/TopSource.c /* @P@/src/@NAME@/TopSource.c
* *
* (c)2006, @AUTHOR@, <@EMAIL@>. * (c)2006, @AUTHOR@, <@EMAIL@>.
* Released under the GNU GPLv2. See file COPYING or * Released under the GNU GPLv2. See file COPYING or

View File

@ -1,21 +1,21 @@
# These are external variables, and shouldn't clash with anything else # These are external variables, and shouldn't clash with anything else
# @NAME@ # @CNAME@
# @NAME@_BUILT # @CNAME@_BUILT
# #
if [ -z ${@NAME@_BUILT} ] if [ -z ${@CNAME@_BUILT} ]
then then
@NAME@="obj/@NAME@.hex" @CNAME@="obj/@NAME@.hex"
EXTRAS="@TODO@" # cflags, libs EXTRAS="" # @TODO@ cflags, libs
echo "Building firmware ${@NAME@}..." echo "Building firmware ${@CNAME@}..."
do_cmd source src/@NAME@/build.monolithic || return 1 do_cmd source src/@NAME@/build.monolithic || return 1
MODIFIED=0 MODIFIED=0
for test in ${MONOLITHIC_TESTS} ${SRC} for test in ${MONOLITHIC_TESTS} ${SRC}
do do
if [ ${test} -nt ${@NAME@} ] if [ ${test} -nt ${@CNAME@} ]
then then
MODIFIED=1 MODIFIED=1
break break
@ -26,14 +26,14 @@ then
then then
echo " Compiling..." echo " Compiling..."
do_cmd ${SDCC} ${SDCCFLAGS} -o "${@NAME@}" ${SRC} ${EXTRAS} || return 1 do_cmd ${SDCC} ${SDCCFLAGS} -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
print_success "Firmware built" print_success "Firmware built"
else else
print_success "Firmware up to date" print_success "Firmware up to date"
fi fi
@NAME@_BUILT=1 @CNAME@_BUILT=1
fi fi

View File

@ -5,7 +5,7 @@ build_dir_tree "${HEXDIR}" || return 1
# install binary # install binary
echo "Installing firmware into '${HEXDIR}'" echo "Installing firmware into '${HEXDIR}'"
install_file "${@NAME@}" "${HEXDIR}" 0755 || return 1 install_file "${@CNAME@}" "${HEXDIR}" 0755 || return 1
print_success "Done" print_success "Done"
# kate: @KATE_MODELINE@ # kate: @KATE_MODELINE@

View File

@ -1,16 +1,16 @@
# These are external variables, and shouldn't clash with anything else # These are external variables, and shouldn't clash with anything else
# @NAME@_MONOLITHIC # @CNAME@_MONOLITHIC
# #
SRC="obj/@NAME@.c" SRC="obj/@NAME@.c"
MONOLITHIC_TESTS="src/@NAME@/build.firmware src/@NAME@/build.monolithic" MONOLITHIC_TESTS="src/@NAME@/build.firmware src/@NAME@/build.monolithic"
if [ -z "${@NAME@_MONOLITHIC}" ] if [ -z "${@CNAME@_MONOLITHIC}" ]
then then
MONOLITHIC_SOURCE="$(echo src/@NAME@/TopHeader.h) $(echo src/@NAME@/TopSource.c)" MONOLITHIC_SOURCE="$(echo src/@NAME@/TopHeader.h) $(echo src/@NAME@/TopSource.c)"
make_monolithic ${SRC} C || return 1 make_monolithic ${SRC} C || return 1
@NAME@_MONOLITHIC=1 @CNAME@_MONOLITHIC=1
MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}" MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}"
fi fi

View File

@ -4,22 +4,8 @@ then
exit 1 exit 1
fi fi
if [ -e src/${NAME} ] do_parameter_subst
then true
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; # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4 # vim: expandtab:ts=4:sw=4

View File

@ -87,6 +87,7 @@ echo "Instantiating module 'src/${NAME}'..."
do_cmd cp -rL ${TEMPLATE} src/${NAME} || cleanup do_cmd cp -rL ${TEMPLATE} src/${NAME} || cleanup
do_cmd cd src/${NAME} || cleanup do_cmd cd src/${NAME} || cleanup
do_cmd rm instantiate || cleanup do_cmd rm instantiate || cleanup
do_cmd_redir .params echo "$@" || cleanup
( source ../../${TEMPLATE}/instantiate ) || cleanup ( source ../../${TEMPLATE}/instantiate ) || cleanup