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
# @NAME@_BUILT
# @CNAME@_BUILT
#
MONOLITHIC_@NAME@="${MONOLITHIC_DOC} $(echo src/@NAME@/*.dox)"
MONOLITHIC_DOC="${MONOLITHIC_DOC} $(echo src/@NAME@/*.dox)"
build_target monolithic
if [ -z ${@NAME@_BUILT} ]
if [ -z ${@CNAME@_BUILT} ]
then
echo "Building documentation with Doxygen..."
@ -19,7 +19,7 @@ then
fi
MODIFIED=0
for file in ${MONOLITHIC_@NAME@}
for file in ${MONOLITHIC_DOC}
do
if [ ${file} -nt html/index.html ]
then
@ -36,7 +36,7 @@ then
print_success "Documentation is up to date"
fi
@NAME@_BUILT=1
@CNAME@_BUILT=1
fi
# kate: @KATE_MODELINE@

View File

@ -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

View File

@ -1,4 +1,4 @@
/* @P@/src/capp/TopSource.c
/* @P@/src/@NAME@/TopSource.c
*
* (c)2006, @AUTHOR@, <@EMAIL@>.
* 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
# @NAME@
# @NAME@_BUILT
# @CNAME@
# @CNAME@_BUILT
#
if [ -z ${@NAME@_BUILT} ]
if [ -z ${@CNAME@_BUILT} ]
then
@NAME@="obj/@NAME@.hex"
EXTRAS="@TODO@" # cflags, libs
@CNAME@="obj/@NAME@.hex"
EXTRAS="" # @TODO@ cflags, libs
echo "Building firmware ${@NAME@}..."
echo "Building firmware ${@CNAME@}..."
do_cmd source src/@NAME@/build.monolithic || return 1
MODIFIED=0
for test in ${MONOLITHIC_TESTS} ${SRC}
do
if [ ${test} -nt ${@NAME@} ]
if [ ${test} -nt ${@CNAME@} ]
then
MODIFIED=1
break
@ -26,14 +26,14 @@ then
then
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"
else
print_success "Firmware up to date"
fi
@NAME@_BUILT=1
@CNAME@_BUILT=1
fi

View File

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

View File

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

View File

@ -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

View File

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