diff --git a/scripts/build.c++.qtapp/TopSource.cpp b/scripts/build.c++.qtapp/TopSource.cpp new file mode 100644 index 0000000..74a966e --- /dev/null +++ b/scripts/build.c++.qtapp/TopSource.cpp @@ -0,0 +1,13 @@ +/* @P@/src/@NAME@/TopSource.cpp + * + * (c)2006, @AUTHOR@, <@EMAIL@>. + * Released under the GNU GPLv2. See file COPYING or + * http://www.gnu.org/copyleft/gpl.html for details. +*/ + +// Below are all the includes used throughout the application. + +/* options for text editors +kate: @KATE_MODELINE@ +vim: @VIM_MODELINE@ +*/ diff --git a/scripts/build.c++.qtapp/build.app b/scripts/build.c++.qtapp/build.app new file mode 100644 index 0000000..e9eddf5 --- /dev/null +++ b/scripts/build.c++.qtapp/build.app @@ -0,0 +1,42 @@ +# These are external variables, and shouldn't clash with anything else +# @CNAME@ +# @CNAME@_BUILT +# + +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@}..." + + do_cmd source src/@NAME@/build.monolithic || return 1 + + MODIFIED=0 + for test in ${MONOLITHIC_TESTS} ${SRC} + do + if [ ${test} -nt ${@CNAME@} ] + then + MODIFIED=1 + break + fi + done + + if [ ${MODIFIED} -ne 0 ] + then + echo " Compiling..." + + do_cmd ${CXX} ${CFLAGS} -Iobj -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1 + + print_success "Application built" + else + print_success "Application up to date" + fi + + @CNAME@_BUILT=1 + +fi + +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.c++.qtapp/build.default b/scripts/build.c++.qtapp/build.default new file mode 100644 index 0000000..5f2b4b0 --- /dev/null +++ b/scripts/build.c++.qtapp/build.default @@ -0,0 +1 @@ +source src/@NAME@/build.app diff --git a/scripts/build.c++.qtapp/build.install b/scripts/build.c++.qtapp/build.install new file mode 100644 index 0000000..ef2021c --- /dev/null +++ b/scripts/build.c++.qtapp/build.install @@ -0,0 +1 @@ +source src/@NAME@/build.install-app diff --git a/scripts/build.c++.qtapp/build.install-app b/scripts/build.c++.qtapp/build.install-app new file mode 100644 index 0000000..739cc0c --- /dev/null +++ b/scripts/build.c++.qtapp/build.install-app @@ -0,0 +1,12 @@ +build_target @NAME@ + +# make paths (this is for Gentoo in particular) +build_dir_tree "${BINDIR}" || return 1 + +# install binary +echo "Installing binaries into '${BINDIR}'" +install_file "${@CNAME@}" "${BINDIR}" 0755 || return 1 +print_success "Done" + +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.c++.qtapp/build.monolithic b/scripts/build.c++.qtapp/build.monolithic new file mode 100644 index 0000000..2df0dc8 --- /dev/null +++ b/scripts/build.c++.qtapp/build.monolithic @@ -0,0 +1,27 @@ +# These are external variables, and shouldn't clash with anything else +# @CNAME@_MONOLITHIC +# + +SRC="obj/@NAME@.cpp" +MONOLITHIC_TESTS="src/@NAME@/build.app src/@NAME@/build.monolithic" + +if [ -z "${@CNAME@_MONOLITHIC}" ] +then + PREMOC="${SRC}.premoc.cpp" + MONOLITHIC_SOURCE="$(echo src/@NAME@/TopSource.cpp)" + make_monolithic ${PREMOC} C || return 1 + + if [ "${PREMOC}" -nt "${SRC}" ] + then + [ -z "${MOC}" ] && MOC="$QTDIR/bin/moc" + do_cmd cp "${PREMOC}" "${SRC}" || return 1 + do_cmd_redir ${SRC} echo "#line 1 \"__generated_by_qt_moc__.cpp\"" || return 1 + do_cmd_redir ${SRC} ${MOC} <${PREMOC} || return 1 + fi + + @CNAME@_MONOLITHIC=1 + MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}" +fi + +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.c++.qtapp/instantiate b/scripts/build.c++.qtapp/instantiate new file mode 100644 index 0000000..9fb90de --- /dev/null +++ b/scripts/build.c++.qtapp/instantiate @@ -0,0 +1,11 @@ +if [ $# -ne 0 ] +then + print_failure "Too many arguments. None required for this module." + exit 1 +fi + +do_parameter_subst +true + +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; +# vim: expandtab:ts=4:sw=4