Merge branch 'master' of tourmaline:git/lw-build-system
This commit is contained in:
commit
53c0b20f9d
42 changed files with 328 additions and 230 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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@
|
||||
|
|
|
|||
1
scripts/build.app.sh/build.install
Normal file
1
scripts/build.app.sh/build.install
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/@NAME@/build.install-app
|
||||
13
scripts/build.app.sh/build.install-app
Normal file
13
scripts/build.app.sh/build.install-app
Normal file
|
|
@ -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@
|
||||
12
scripts/build.app.sh/instantiate
Normal file
12
scripts/build.app.sh/instantiate
Normal file
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
;
|
||||
|
|
|
|||
|
|
@ -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@
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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@
|
||||
|
|
|
|||
|
|
@ -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@
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
#
|
||||
|
|
|
|||
13
scripts/build.module.c/TopSource.c
Normal file
13
scripts/build.module.c/TopSource.c
Normal file
|
|
@ -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@
|
||||
*/
|
||||
1
scripts/build.module.c/build.default
Normal file
1
scripts/build.module.c/build.default
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/@NAME@/build.module
|
||||
1
scripts/build.module.c/build.install
Normal file
1
scripts/build.module.c/build.install
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/@NAME@/build.install-module
|
||||
12
scripts/build.module.c/build.install-module
Normal file
12
scripts/build.module.c/build.install-module
Normal file
|
|
@ -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@
|
||||
39
scripts/build.module.c/build.module
Normal file
39
scripts/build.module.c/build.module
Normal file
|
|
@ -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@
|
||||
17
scripts/build.module.c/build.monolithic
Normal file
17
scripts/build.module.c/build.monolithic
Normal file
|
|
@ -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@
|
||||
15
scripts/build.module.c/instantiate
Normal file
15
scripts/build.module.c/instantiate
Normal file
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
8
scripts/config-printflags.sh
Executable file
8
scripts/config-printflags.sh
Executable file
|
|
@ -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
|
||||
126
scripts/version.sh
Executable file
126
scripts/version.sh
Executable file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue