diff --git a/create.sh b/create.sh index 73e9c08..38ed309 100755 --- a/create.sh +++ b/create.sh @@ -64,10 +64,6 @@ print_success "Done: $(pwd)" # Fixups echo "Installing symlinks, fixing up stuff..." -# Move the project files to something more sensible -do_cmd mv project.kdevelop ${P}.kdevelop || exit 1 -do_cmd mv project.kdevelop.filelist ${P}.kdevelop.filelist || exit 1 - # Install devscript symlinks do_cmd ln -s ${DEVSCRIPTS}/* scripts/ || exit 1 diff --git a/scripts/build.app.c++-qt/TopSource.cpp b/scripts/build.app.c++-qt/TopSource.cpp index 74a966e..10a0b59 100644 --- a/scripts/build.app.c++-qt/TopSource.cpp +++ b/scripts/build.app.c++-qt/TopSource.cpp @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/TopSource.cpp * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.app.c++/TopSource.cpp b/scripts/build.app.c++/TopSource.cpp index 74a966e..10a0b59 100644 --- a/scripts/build.app.c++/TopSource.cpp +++ b/scripts/build.app.c++/TopSource.cpp @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/TopSource.cpp * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.app.c/TopSource.c b/scripts/build.app.c/TopSource.c index 6f29253..debda3b 100644 --- a/scripts/build.app.c/TopSource.c +++ b/scripts/build.app.c/TopSource.c @@ -1,11 +1,11 @@ /* @P@/src/@NAME@/TopSource.c * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @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. +/* Below are all the includes used throughout the application. */ /* options for text editors kate: @KATE_MODELINE@ diff --git a/scripts/build.app.sh/build.install b/scripts/build.app.sh/build.install new file mode 100644 index 0000000..ef2021c --- /dev/null +++ b/scripts/build.app.sh/build.install @@ -0,0 +1 @@ +source src/@NAME@/build.install-app diff --git a/scripts/build.app.sh/build.install-app b/scripts/build.app.sh/build.install-app new file mode 100644 index 0000000..a6e27a5 --- /dev/null +++ b/scripts/build.app.sh/build.install-app @@ -0,0 +1,13 @@ +# make paths (this is for Gentoo in particular) +build_dir_tree "${BINDIR}" || return 1 + +# install binary +echo "Installing binaries into '${BINDIR}'" +for script in src/@NAME@/*.sh +do + install_file "${script}" "${BINDIR}" 0755 || return 1 +done +print_success "Done" + +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.app.sh/instantiate b/scripts/build.app.sh/instantiate new file mode 100644 index 0000000..10fc290 --- /dev/null +++ b/scripts/build.app.sh/instantiate @@ -0,0 +1,12 @@ +if [ $# -ne 0 ] +then + print_failure "Too many arguments. None required for this module." + exit 1 +fi + +do_parameter_subst +add_config_option "BINDIR" "${COPT_BINDIR_DEFAULT}" +true + +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; +# vim: expandtab:ts=4:sw=4 diff --git a/scripts/build.docs.doxygen/Doxyfile.in b/scripts/build.docs.doxygen/Doxyfile.in index cbf6337..304645e 100644 --- a/scripts/build.docs.doxygen/Doxyfile.in +++ b/scripts/build.docs.doxygen/Doxyfile.in @@ -1,6 +1,6 @@ # @P@/src/@NAME@/Doxyfile.in # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # diff --git a/scripts/build.docs.doxygen/MainPage.dox b/scripts/build.docs.doxygen/MainPage.dox index 34482ec..74ab478 100644 --- a/scripts/build.docs.doxygen/MainPage.dox +++ b/scripts/build.docs.doxygen/MainPage.dox @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/MainPage.dox * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.files.none/build.install-files b/scripts/build.files.none/build.install-files index dd8242e..d2be502 100644 --- a/scripts/build.files.none/build.install-files +++ b/scripts/build.files.none/build.install-files @@ -4,11 +4,11 @@ echo "Installing files into ${FILESDIR}" build_dir_tree "${FILESDIR}" || return 1 -# copy across the Doxygen-generated documentation +# copy across the files (note this copies everything with mode 0644). for file in src/@NAME@/* do [ "$(echo $(basename ${file}) | cut -b1-6)" == "build." ] && continue - do_cmd cp -a ${file} ${FILESDIR} || return 1 + install_file ${file} ${FILESDIR} 0644 || return 1 done print_success "Files installed" diff --git a/scripts/build.firmware.gpasm/BottomSource.asm b/scripts/build.firmware.gpasm/BottomSource.asm index 8ebd13a..31468b4 100644 --- a/scripts/build.firmware.gpasm/BottomSource.asm +++ b/scripts/build.firmware.gpasm/BottomSource.asm @@ -1,6 +1,6 @@ ; @P@/src/@NAME@/BottomSource.asm ; -; (c)2006, @AUTHOR@, <@EMAIL@>. +; (c)2007, @AUTHOR@, <@EMAIL@>. ; Released under the GNU GPLv2. See file COPYING or ; http://www.gnu.org/copyleft/gpl.html for details. ; diff --git a/scripts/build.firmware.gpasm/TopSource.asm b/scripts/build.firmware.gpasm/TopSource.asm index 2233a89..578d03b 100644 --- a/scripts/build.firmware.gpasm/TopSource.asm +++ b/scripts/build.firmware.gpasm/TopSource.asm @@ -1,6 +1,6 @@ ; @P@/src/@NAME@/TopSource.asm ; -; (c)2006, @AUTHOR@, <@EMAIL@>. +; (c)2007, @AUTHOR@, <@EMAIL@>. ; Released under the GNU GPLv2. See file COPYING or ; http://www.gnu.org/copyleft/gpl.html for details. ; diff --git a/scripts/build.firmware.sdcc/TopSource.c b/scripts/build.firmware.sdcc/TopSource.c index 6f29253..debda3b 100644 --- a/scripts/build.firmware.sdcc/TopSource.c +++ b/scripts/build.firmware.sdcc/TopSource.c @@ -1,11 +1,11 @@ /* @P@/src/@NAME@/TopSource.c * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @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. +/* Below are all the includes used throughout the application. */ /* options for text editors kate: @KATE_MODELINE@ diff --git a/scripts/build.lib.c++/BottomHeader.h b/scripts/build.lib.c++/BottomHeader.h index 2ac14cb..27b7e48 100644 --- a/scripts/build.lib.c++/BottomHeader.h +++ b/scripts/build.lib.c++/BottomHeader.h @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/BottomHeader.h * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.lib.c++/TopHeader.h b/scripts/build.lib.c++/TopHeader.h index 7e327af..347827c 100644 --- a/scripts/build.lib.c++/TopHeader.h +++ b/scripts/build.lib.c++/TopHeader.h @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/TopHeader.h * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.lib.c++/TopSource.cpp b/scripts/build.lib.c++/TopSource.cpp index 3689d7b..6aeaf33 100644 --- a/scripts/build.lib.c++/TopSource.cpp +++ b/scripts/build.lib.c++/TopSource.cpp @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/TopSource.cpp * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.lib.c++/build.install-lib b/scripts/build.lib.c++/build.install-lib index a95f944..721f818 100644 --- a/scripts/build.lib.c++/build.install-lib +++ b/scripts/build.lib.c++/build.install-lib @@ -22,7 +22,7 @@ install_header ${@CNAME@_HEADER} ${INCLUDEDIR} 0644 || return 1 # install config script echo "Installing config script into ${PKGCONFDIR}" -CONFFILE="${BINDIR}/@NAME@-config" +CONFFILE="${INSTALL_PREFIX}${BINDIR}/@NAME@-config" do_cmd rm -f "${CONFFILE}" do_cmd_redir "${CONFFILE}" sed \ diff --git a/scripts/build.lib.c++/soversion b/scripts/build.lib.c++/soversion index faa4d94..acc10ed 100644 --- a/scripts/build.lib.c++/soversion +++ b/scripts/build.lib.c++/soversion @@ -1,6 +1,6 @@ # @P@/src/@NAME@/soversion # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # diff --git a/scripts/build.lib.c/BottomHeader.h b/scripts/build.lib.c/BottomHeader.h index 2ac14cb..27b7e48 100644 --- a/scripts/build.lib.c/BottomHeader.h +++ b/scripts/build.lib.c/BottomHeader.h @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/BottomHeader.h * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.lib.c/TopHeader.h b/scripts/build.lib.c/TopHeader.h index 7e327af..18d1c02 100644 --- a/scripts/build.lib.c/TopHeader.h +++ b/scripts/build.lib.c/TopHeader.h @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/TopHeader.h * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -8,7 +8,7 @@ #ifndef HEADER_@CNAME@ #define HEADER_@CNAME@ -// standard includes, or includes needed for type declarations +/* standard includes, or includes needed for type declarations */ /* options for text editors kate: @KATE_MODELINE@ diff --git a/scripts/build.lib.c/TopSource.c b/scripts/build.lib.c/TopSource.c index 805648b..32f6799 100644 --- a/scripts/build.lib.c/TopSource.c +++ b/scripts/build.lib.c/TopSource.c @@ -1,13 +1,13 @@ /* @P@/src/@NAME@/TopSource.c * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ #include "@HEADER_NAME@" -// Below are all the includes used throughout the library. +/* Below are all the includes used throughout the library. */ /* options for text editors kate: @KATE_MODELINE@ diff --git a/scripts/build.lib.c/build.install-lib b/scripts/build.lib.c/build.install-lib index 848d5b4..7fa800f 100644 --- a/scripts/build.lib.c/build.install-lib +++ b/scripts/build.lib.c/build.install-lib @@ -22,7 +22,7 @@ install_header ${@CNAME@_HEADER} ${INCLUDEDIR} 0644 || return 1 # install config script echo "Installing config script into ${BINDIR}" -CONFFILE="${BINDIR}/@NAME@-config" +CONFFILE="${INSTALL_PREFIX}${BINDIR}/@NAME@-config" do_cmd rm -f "${CONFFILE}" do_cmd_redir "${CONFFILE}" sed \ diff --git a/scripts/build.lib.c/soversion b/scripts/build.lib.c/soversion index faa4d94..acc10ed 100644 --- a/scripts/build.lib.c/soversion +++ b/scripts/build.lib.c/soversion @@ -1,6 +1,6 @@ # @P@/src/@NAME@/soversion # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # diff --git a/scripts/build.module.c/TopSource.c b/scripts/build.module.c/TopSource.c new file mode 100644 index 0000000..2eb68a0 --- /dev/null +++ b/scripts/build.module.c/TopSource.c @@ -0,0 +1,13 @@ +/* @P@/src/@NAME@/TopSource.c + * + * (c)2007, @AUTHOR@, <@EMAIL@>. + * Released under the GNU GPLv2. See file COPYING or + * http://www.gnu.org/copyleft/gpl.html for details. +*/ + +/* Below are includes used throughout the module */ + +/* options for text editors +kate: @KATE_MODELINE@ +vim: @VIM_MODELINE@ +*/ diff --git a/scripts/build.module.c/build.default b/scripts/build.module.c/build.default new file mode 100644 index 0000000..a92d188 --- /dev/null +++ b/scripts/build.module.c/build.default @@ -0,0 +1 @@ +source src/@NAME@/build.module diff --git a/scripts/build.module.c/build.install b/scripts/build.module.c/build.install new file mode 100644 index 0000000..27faa5c --- /dev/null +++ b/scripts/build.module.c/build.install @@ -0,0 +1 @@ +source src/@NAME@/build.install-module diff --git a/scripts/build.module.c/build.install-module b/scripts/build.module.c/build.install-module new file mode 100644 index 0000000..c6254d6 --- /dev/null +++ b/scripts/build.module.c/build.install-module @@ -0,0 +1,12 @@ +build_target @NAME@ + +# make paths (this is for Gentoo in particular) +build_dir_tree "${MODULEDIR}" || return 1 + +# install module +echo "Installing module into '${MODULEDIR}'" +install_file ${@CNAME@} ${MODULEDIR} 0755 || return 1 +print_success "Done" + +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.module.c/build.module b/scripts/build.module.c/build.module new file mode 100644 index 0000000..f80b382 --- /dev/null +++ b/scripts/build.module.c/build.module @@ -0,0 +1,39 @@ +# These are external variables, and shouldn't clash with anything else +# @CNAME@ +# @CNAME@_BUILT + +if [ -z ${@CNAME@_BUILT} ] +then + @CNAME@="obj/@NAME@.so" + SO_EXTRA="" # @TODO@ + + echo "Building module ${@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 ${CC} ${CFLAGS} -Iobj -shared -fpic -o "${@CNAME@}" \ + ${SRC} ${SO_EXTRA} || return 1 + + print_success "Module built" + else + print_success "Module up to date" + fi + + @CNAME@_BUILT=1 +fi +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.module.c/build.monolithic b/scripts/build.module.c/build.monolithic new file mode 100644 index 0000000..789dc9e --- /dev/null +++ b/scripts/build.module.c/build.monolithic @@ -0,0 +1,17 @@ +# These are external variables, and shouldn't clash with anything else +# @CNAME@_MONOLITHIC + +SRC="obj/@NAME@.c" +HDR="obj/@HEADER_NAME@" + +MONOLITHIC_TESTS="src/@NAME@/build.module src/@NAME@/build.monolithic" + +if [ -z "${@CNAME@_MONOLITHIC}" ] +then + MONOLITHIC_SOURCE="$(echo src/@NAME@/TopSource.c)" + make_monolithic ${SRC} C || return 1 + + @CNAME@_MONOLITHIC=1 +fi +# kate: @KATE_MODELINE@ +# vim: @VIM_MODELINE@ diff --git a/scripts/build.module.c/instantiate b/scripts/build.module.c/instantiate new file mode 100644 index 0000000..1c99bcd --- /dev/null +++ b/scripts/build.module.c/instantiate @@ -0,0 +1,15 @@ +if [ $# -ne 0 ] +then + print_failure "Not expecting arguments." + exit 1 +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}" +add_config_option "MODULEDIR" "${COPT_LIBDIR_DEFAULT}/@TODO@/" +true + +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; +# vim: expandtab:ts=4:sw=4 diff --git a/scripts/build.tests.c++/template b/scripts/build.tests.c++/template index 007d255..2f09251 100644 --- a/scripts/build.tests.c++/template +++ b/scripts/build.tests.c++/template @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/???.cpp * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ diff --git a/scripts/build.tests.c/template b/scripts/build.tests.c/template index 6d9e4d8..0a6c277 100644 --- a/scripts/build.tests.c/template +++ b/scripts/build.tests.c/template @@ -1,6 +1,6 @@ /* @P@/src/@NAME@/???.c * - * (c)2006, @AUTHOR@, <@EMAIL@>. + * (c)2007, @AUTHOR@, <@EMAIL@>. * Released under the GNU GPLv2. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -21,10 +21,10 @@ int main(int argc, char* argv[]) } if(argc == 1) { - // empty argument list + /* empty argument list */ } - // TODO + /* TODO */ return ret; } diff --git a/scripts/config-printflags.sh b/scripts/config-printflags.sh new file mode 100755 index 0000000..05ddee5 --- /dev/null +++ b/scripts/config-printflags.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for pkg in $@ +do + varname="$(echo "${pkg}" | tr a-z A-Z)" + echo '[ -z "${'${varname}'_CFLAGS}" ] && '${varname}'_CFLAGS="$('${pkg}'-config --cflags)"' + echo '[ -z "${'${varname}'_LIBS}" ] && '${varname}'_LIBS="$('${pkg}'-config --libs)"' +done diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100755 index 0000000..11eb3d6 --- /dev/null +++ b/scripts/version.sh @@ -0,0 +1,126 @@ +#!/bin/sh + +if [ $# -eq 0 ] +then + echo "Usage: $0 COMMANDS" + echo "" + echo " major - bump major version, reset minor and micro" + echo " minor - bump minor version, reset micro" + echo " micro - bump micro version" + echo " libmajor LIB - as major but for soversion" + echo " libminor LIB - as minor but for soversion" + echo " libmicro LIB - as micro but for soversion" + echo " tag - tag version" + echo " push - do a git-push with --tags" + + exit 1 +fi + +edit_versions() { + file="$1" + shift + + SEDCMD="" + while [ $# -ne 0 ] + do + var="$1" + shift + value="$1" + shift + + SEDCMD="${SEDCMD} -e s,^${var}=.*$,${var}=${value}," + done + sed ${SEDCMD} -i "${file}" + git-commit -m "Bump version" "${file}" +} + +bump_major() { + source version + edit_versions "version" "VERMAJOR" "$[${VERMAJOR} + 1]" "VERMINOR" "0" "VERMICRO" "0" +} + +bump_minor() { + source version + edit_versions "version" "VERMINOR" "$[${VERMINOR} + 1]" "VERMICRO" "0" +} + +bump_micro() { + source version + edit_versions "version" "VERMICRO" "$[${VERMICRO} + 1]" +} + +bump_somajor() { + source src/$1/soversion + edit_versions "src/$1/soversion" "SOMAJOR" "$[${SOMAJOR} + 1]" "SOMINOR" "0" "SOMICRO" "0" +} + +bump_sominor() { + source src/$1/soversion + edit_versions "src/$1/soversion" "SOMINOR" "$[${SOMINOR} + 1]" "SOMICRO" "0" +} + +bump_somicro() { + source src/$1/soversion + edit_versions "src/$1/soversion" "SOMICRO" "$[${SOMICRO} + 1]" +} + +do_tag() { + source version + git-tag "${VERMAJOR}.${VERMINOR}.${VERMICRO}" +} + +do_push() { + git-push + git-push --tags +} + +set -ex + +while [ $# -ne 0 ] +do + case $1 in + major) + bump_major + ;; + + minor) + bump_minor + ;; + + micro) + bump_micro + ;; + + libmajor) + bump_somajor $2 + shift + ;; + + libminor) + bump_sominor $2 + shift + ;; + + libmicro) + bump_somicro $2 + shift + ;; + + tag) + do_tag + ;; + + push) + do_push + ;; + + *) + echo "Unrecognised command: $1" + exit 1 + ;; + esac + + shift +done + +true diff --git a/skel/README b/skel/README index fa36aa0..ea859d5 100644 --- a/skel/README +++ b/skel/README @@ -1,6 +1,6 @@ @P@ ======================================================================== -(c)2006, @AUTHOR@, <@EMAIL@>. +(c)2007, @AUTHOR@, <@EMAIL@>. Released under the GNU GPLv2. See file COPYING or http://www.gnu.org/copyleft/gpl.html for details. @@ -10,6 +10,8 @@ Really Quick Instructions To build: ./make.sh To install: ./make.sh install -You might want to edit 'config' first. +You might want to edit 'config' first. You might also want to set +'INSTALL_PREFIX', which is prepended onto the destination of any +installed file. @TODO@ diff --git a/skel/config b/skel/config index a873209..5980dbd 100644 --- a/skel/config +++ b/skel/config @@ -2,7 +2,7 @@ # kate: @KATE_MODELINE@ # vim: @VIM_MODELINE@ # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # diff --git a/skel/make.sh b/skel/make.sh index 47a4210..4134043 100755 --- a/skel/make.sh +++ b/skel/make.sh @@ -1,7 +1,7 @@ #!/bin/bash # @P@/make.sh # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2006-2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # @@ -22,10 +22,6 @@ source "config" # don't fail on error, since last command in config might return # Get version information source version || exit 1 VERSION="${VERMAJOR}.${VERMINOR}.${VERMICRO}" -if [ ! -z "${VEREXTRA}" ] -then - VERSION="${VERSION}-${VEREXTRA}" -fi @@ -48,6 +44,8 @@ OUTPUT_DIRS="obj html" # MONOLITHIC_TESTS if any file mentioned in this list is newer # than the output file, then we recreate it # MONOLITHIC_SOURCE a list (in order) of the source files +# MONOLITHIC_OPTIONS will #define the options to match the respective +# environment variables. # # Recognised formats are: # none no special processing happens before each file @@ -68,18 +66,21 @@ make_monolithic() { # extract options HASHLINE=0 VERDEFINE=0 + HASHDEFINE=0 if [ "$2" == "C" ] then HASHLINE=1 VERDEFINE=1 + HASHDEFINE=1 elif [ "$2" == "Ch" ] then HASHLINE=1 + HASHDEFINE=1 elif [ "$2" == "none" ] then - HASHLINE=0 # dummy command + HASHLINE=0 # dummy command else - print_failure "make_monolithic() called with unknown format $2" + print_failure "make_monolithic() called with unknown format $2" return 1 fi @@ -115,6 +116,14 @@ make_monolithic() { do_cmd_redir ${MONOLITHIC_OUT} echo "#define VEREXTRA \"${VEREXTRA}\"" || return 1 fi + if [ ${HASHDEFINE} -ne 0 ] + then + for opt in ${MONOLITHIC_OPTIONS} + do + do_cmd_redir ${MONOLITHIC_OUT} echo "#define ${opt} ${!opt}" || return 1 + done + fi + for FILE in ${MONOLITHIC_SOURCE} do if [ ${HASHLINE} -ne 0 ] @@ -142,6 +151,10 @@ build_dir_tree() { return 1 fi + build_dir_tree_recurse "${INSTALL_PREFIX}$1" +} + +build_dir_tree_recurse() { local DIR="$1" # if the directory already exists, return success @@ -160,8 +173,9 @@ build_dir_tree() { mkdir "${DIR}" >& /dev/null if [ $? -ne 0 ] then - build_dir_tree $(dirname "${DIR}") || return 1 - mkdir "${DIR}" + build_dir_tree_recurse $(dirname "${DIR}") || return 1 + echo " Creating directory '${DIR}'" + do_cmd mkdir "${DIR}" if [ $? -ne 0 ] then print_failure "Failed to create directory '${DIR}'" @@ -180,10 +194,10 @@ build_dir_tree() { # second is the destination. The third is the octal mode. install_file() { # figure out if $2 is a directory or not - DEST_FILE="$2" - [ -d "$2" ] && DEST_FILE="$2/$(basename $1)" + DEST_FILE="${INSTALL_PREFIX}$2" + [ -d "${DEST_FILE}" ] && DEST_FILE="${INSTALL_PREFIX}$2/$(basename $1)" - echo " Installing: '$1' -> '$2'" + echo " Installing: '$1' -> '${DEST_FILE}'" do_cmd cp -fP "$1" "${DEST_FILE}" || return 1 do_cmd chmod "$3" "${DEST_FILE}" || return 1 @@ -195,10 +209,10 @@ install_file() { # This will install a header file. It is basically similar to # install_file(), only we strip out the #line directives. install_header() { - DEST_FILE="$2" - [ -d "$2" ] && DEST_FILE="$2/$(basename $1)" + DEST_FILE="${INSTALL_PREFIX}$2" + [ -d "${DEST_FILE}" ] && DEST_FILE="${INSTALL_PREFIX}$2/$(basename $1)" - echo " Installing header: '$1' -> '$2'" + echo " Installing: '$1' -> '${DEST_FILE}'" do_cmd rm -f ${DEST_FILE} || exit 1 do_cmd_redir ${DEST_FILE} sed -e "s,^#line.*,," $1 || exit 1 do_cmd chmod "$3" "${DEST_FILE}" || return 1 @@ -212,9 +226,9 @@ install_header() { # second the symlink's source filename, and the third is the directory # in which to create the symlink. install_symlink() { - echo " Installing symlink: '$3/$2' -> '$1'" + echo " Installing symlink: '${INSTALL_PREFIX}$3/$1' -> '$2'" - ( do_cmd cd $3; ln -sf $2 $1 ) || return 1 + ( do_cmd ln -sf $2 ${INSTALL_PREFIX}$3/$1 ) || return 1 return 0 } diff --git a/skel/project.kdevelop b/skel/project.kdevelop deleted file mode 100644 index 5789f15..0000000 --- a/skel/project.kdevelop +++ /dev/null @@ -1,168 +0,0 @@ - - - - @AUTHOR@ - @EMAIL@ - $VERSION$ - KDevCustomProject - C++ - - . - false - - - - - - /bin/true - executable - / - - false - true - - - - make - - - - false - 1 - 0 - false - ./make.sh - default - - default - - - - - - - - - - - - - - - - - true - false - false - - - false - true - 10 - - - - - ada - ada_bugs_gcc - bash - bash_bugs - clanlib - fortran_bugs_gcc - gnome1 - gnustep - gtk - gtk_bugs - haskell - haskell_bugs_ghc - java_bugs_gcc - java_bugs_sun - kde2book - opengl - pascal_bugs_fp - php - php_bugs - perl - perl_bugs - python - python_bugs - qt-kdev3 - ruby - ruby_bugs - sdl - sw - w3c-dom-level2-html - w3c-svg - w3c-uaag10 - wxwidgets_bugs - - - Guide to the Qt Translation Tools - Qt Assistant Manual - Qt Designer Manual - Qt Reference Documentation - qmake User Guide - - - KDE Libraries (Doxygen) - - - - - - - - - - - - .h - .cpp - - - - - true - true - true - false - true - true - true - 1 - 1 - 250 - - - - set - m_,_ - theValue - true - true - - - - - - - - - - - - - false - false - - - *.o,*.lo,CVS - false - false - - - - - - - diff --git a/skel/project.kdevelop.filelist b/skel/project.kdevelop.filelist deleted file mode 100644 index 81bce2d..0000000 --- a/skel/project.kdevelop.filelist +++ /dev/null @@ -1,4 +0,0 @@ -# KDevelop Custom Project File List -src/lib/BottomHeader.h -src/lib/TopHeader.h -src/lib/TopSource.cpp diff --git a/skel/scripts/.gitignore b/skel/scripts/.gitignore index 8e5e559..82ea507 100644 --- a/skel/scripts/.gitignore +++ b/skel/scripts/.gitignore @@ -1,13 +1,18 @@ build.app.c build.app.c++ build.app.c++-qt +build.app.sh build.docs.doxygen build.files.none build.firmware.gpasm build.firmware.sdcc build.lib.c build.lib.c++ +build.module.c build.tests.c build.tests.c++ + +config-printflags.sh module-create.sh release.sh +version.sh diff --git a/skel/version b/skel/version index 7ef8ff3..62cb129 100644 --- a/skel/version +++ b/skel/version @@ -1,6 +1,6 @@ # @P@/version # -# (c)2006, @AUTHOR@, <@EMAIL@>. +# (c)2007, @AUTHOR@, <@EMAIL@>. # Released under the GNU GPLv2. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # @@ -13,7 +13,6 @@ VERMAJOR=0 VERMINOR=0 VERMICRO=0 -VEREXTRA="" # kate: @KATE_MODELINE@ # vim: @VIM_MODELINE@ diff --git a/update.sh b/update.sh index c07b3f8..53589e4 100755 --- a/update.sh +++ b/update.sh @@ -57,10 +57,6 @@ cleanup() { } do_cmd mkdir upgrade.tmp || cleanup -echo "DEBUG START" -ls -ls upgrade.tmp -echo "DEBUG END" do_cmd_redir /dev/null ${SCRIPT_ROOT}/create.sh ${PROJECT_ROOT}/upgrade.tmp ${P} || cleanup for module in src/* do