This commit is contained in:
Laurence Withers 2006-12-08 15:51:18 +00:00
parent 726ec70f7a
commit aacb01917c
16 changed files with 74 additions and 5 deletions

View File

@ -6,7 +6,6 @@
if [ -z ${@CNAME@_BUILT} ]
then
@CNAME@="obj/@NAME@"
[ -z "${QTSTUFF}" ] && QTSTUFF="-I${QTDIR}/include -L${QTDIR}/lib -lqt-mt"
EXTRAS="${QTSTUFF}" # @TODO@ cflags, libs
echo "Building application ${@CNAME@}..."

View File

@ -5,6 +5,10 @@ then
fi
do_parameter_subst
add_config_option "CXX" "${COPT_CXX_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
add_config_option "QTSTUFF" "${COPT_QTSTUFF_DEFAULT}"
add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -5,6 +5,9 @@ then
fi
do_parameter_subst
add_config_option "CXX" "${COPT_CXX_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -5,6 +5,9 @@ then
fi
do_parameter_subst
add_config_option "CC" "${COPT_CC_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -5,6 +5,7 @@ then
fi
do_parameter_subst
add_config_option "FILESDIR" "${COPT_FILESDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -27,8 +27,7 @@ then
then
echo " Compiling..."
[ -z "${GPASM}" ] && GPASM="gpasm"
do_cmd ${GPASM} -p"${PROCESSOR}" -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
do_cmd ${GPASM} ${GPASM_FLAGS} -p"${PROCESSOR}" -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
print_success "Firmware built"
else

View File

@ -5,6 +5,9 @@ then
fi
do_parameter_subst
add_config_option "HEXDIR" "${COPT_HEXDIR_DEFAULT}"
add_config_option "GPASM" "gpasm"
add_config_option "GPASM_FLAGS" ""
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -26,7 +26,6 @@ then
then
echo " Compiling..."
SDCCFLAGS="" # @TODO@
do_cmd ${SDCC} ${SDCCFLAGS} -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
print_success "Firmware built"

View File

@ -5,6 +5,9 @@ then
fi
do_parameter_subst
add_config_option "HEXDIR" "${COPT_HEXDIR_DEFAULT}"
add_config_option "SDCC" "sdcc"
add_config_option "SDCCFLAGS" ""
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -18,6 +18,13 @@ else
fi
do_parameter_subst NAMEMINUSL HEADER_NAME
add_config_option "CC" "${COPT_CC_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}"
add_config_option "LIBDIR" "${COPT_LIBDIR_DEFAULT}"
add_config_option "INCLUDEDIR" "${COPT_INCLUDEDIR_DEFAULT}"
add_config_option "FINALLIBDIR" "${COPT_FINALLIBDIR_DEFAULT}"
add_config_option "FINALINCLUDEDIR" "${COPT_FINALINCLUDEDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -18,6 +18,13 @@ else
fi
do_parameter_subst NAMEMINUSL HEADER_NAME
add_config_option "CC" "${COPT_CC_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}"
add_config_option "LIBDIR" "${COPT_LIBDIR_DEFAULT}"
add_config_option "INCLUDEDIR" "${COPT_INCLUDEDIR_DEFAULT}"
add_config_option "FINALLIBDIR" "${COPT_FINALLIBDIR_DEFAULT}"
add_config_option "FINALINCLUDEDIR" "${COPT_FINALINCLUDEDIR_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -22,6 +22,8 @@ do
done
do_parameter_subst TEST_LIBS LINK_LIBS TEST_HEADERS
add_config_option "CXX" "${COPT_CXX_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -22,6 +22,8 @@ do
done
do_parameter_subst TEST_LIBS LINK_LIBS TEST_HEADERS
add_config_option "CC" "${COPT_CC_DEFAULT}"
add_config_option "CFLAGS" "${COPT_CFLAGS_DEFAULT}"
true
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;

View File

@ -73,6 +73,30 @@ do_parameter_subst() {
# function used to add configuration variables
# adds variables to the 'config' file; expects name and default value
# some default default values are given below
add_config_option() {
# don't add it if it already exists
grep -q "{$1}" ../../config && return 0
# add the default line
echo "[ -z \"\${$1}\" ] && $1=\"$2\"" >> ../../config
}
COPT_BINDIR_DEFAULT='${PREFIX}/bin'
COPT_LIBDIR_DEFAULT='${PREFIX}/lib'
COPT_HEXDIR_DEFAULT="hexdir"
COPT_INCLUDEDIR_DEFAULT='${PREFIX}/include'
COPT_FINALLIBDIR_DEFAULT='${LIBDIR}'
COPT_FINALLINCLUDEDIR_DEFAULT='${INCLUDEDIR}'
COPT_CC_DEFAULT="gcc"
COPT_CXX_DEFAULT="g++"
COPT_CFLAGS_DEFAULT="-g -O2 -W -Wall"
COPT_QTSTUFF_DEFAULT='-I${QTDIR}/include -L${QTDIR}/lib -lqt-mt'
COPT_FILESDIR_DEFAULT='${PREFIX}/share/@P@/@NAME@'
if [ ! -e "src" ]
then
do_cmd mkdir src || exit 1

View File

@ -9,6 +9,7 @@ Really Quick Instructions
To build: ./make.sh
To install: ./make.sh install
(you might want to set PREFIX, by default it's /usr/local)
You might want to edit 'config' first.
@TODO@

12
skel/config Executable file
View File

@ -0,0 +1,12 @@
# @P@/config
# kate: @KATE_MODELINE@
# vim: @VIM_MODELINE@
#
# (c)2006, @AUTHOR@, <@EMAIL@>.
# Released under the GNU GPLv2. See file COPYING or
# http://www.gnu.org/copyleft/gpl.html for details.
#
# This file contains options used to build @P@.
#
[ -z "${PREFIX}" ] && PREFIX="/usr/local"