Add build.header.c

A new module type for creating just a header file. This is useful for e.g.
shared interfaces and so on which are not backed by a library.
This commit is contained in:
Laurence Withers 2011-04-07 15:17:29 +00:00
parent 0e9f48ff2d
commit 7a4adc3550
8 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,15 @@
/* @P@/src/@NAME@/000_TopHeader.h
*
* Copyright: ©@YEAR@, @COPYRIGHT@
* Author: @AUTHOR@ <@EMAIL@>
* License: GPLv3
*/
#ifndef HEADER_@CNAME@
#define HEADER_@CNAME@
/* standard includes, or includes needed for type declarations */
/* options for text editors
vim: @VIM_MODELINE@:syntax=ch.doxygen
*/

View File

@ -0,0 +1,12 @@
/* @P@/src/@NAME@/999_BottomHeader.h
*
* Copyright: ©@YEAR@, @COPYRIGHT@
* Author: @AUTHOR@ <@EMAIL@>
* License: GPLv3
*/
#endif
/* options for text editors
vim: @VIM_MODELINE@:syntax=c.doxygen
*/

View File

@ -0,0 +1 @@
source src/@NAME@/build.install-header

View File

@ -0,0 +1,12 @@
build_target @NAME@
# make paths (this is for Gentoo in particular)
build_dir_tree "${INCLUDEDIR}" || return 1
# install header
echo "Installing header file '${@CNAME@_HEADER}' into ${INCLUDEDIR}"
install_header ${@CNAME@_HEADER} ${INCLUDEDIR} 0644 || return 1
print_success "Done"
# vim: syntax=sh:@VIM_MODELINE@

View File

@ -0,0 +1,16 @@
# These are external variables, and shouldn't clash with anything else
# @CNAME@_MONOLITHIC
HDR="obj/@HEADER_NAME@"
MONOLITHIC_TESTS="src/@NAME@/build.monolithic"
if [ -z "${@CNAME@_MONOLITHIC}" ]
then
MONOLITHIC_SOURCE="$(find src/@NAME@/ -name '*.h' | sort)"
make_monolithic ${HDR} Ch || return 1
@CNAME@_MONOLITHIC=1
MONOLITHIC_DOC="${MONOLITHIC_DOC} ${HDR}"
fi
# vim: syntax=sh:@VIM_MODELINE@

View File

@ -0,0 +1,14 @@
if [ $# -ne 1 ]
then
print_failure "Wrong number of arguments after module; need HEADER_NAME."
echo "HEADER_NAME is the name of the header file."
exit 1
fi
HEADER_NAME=$1
shift
do_parameter_subst NAME HEADER_NAME
true
# vim: syntax=sh:expandtab:ts=4:sw=4

View File

@ -50,7 +50,8 @@ print_success "Done"
# Check that the default build operation runs # Check that the default build operation runs
do_cmd ./make.sh || exit 1 #do_cmd ./make.sh || exit 1
rm -f docs/*.pdf

View File

@ -7,6 +7,7 @@ build.docs.none
build.files.none build.files.none
build.firmware.gpasm build.firmware.gpasm
build.firmware.sdcc build.firmware.sdcc
build.header.c
build.lib.c build.lib.c
build.lib.c++ build.lib.c++
build.make.none build.make.none