WIP
This commit is contained in:
parent
726ec70f7a
commit
aacb01917c
|
@ -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@}..."
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,7 +26,6 @@ then
|
|||
then
|
||||
echo " Compiling..."
|
||||
|
||||
SDCCFLAGS="" # @TODO@
|
||||
do_cmd ${SDCC} ${SDCCFLAGS} -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
|
||||
|
||||
print_success "Firmware built"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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@
|
||||
|
|
|
@ -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"
|
Loading…
Reference in New Issue