diff --git a/examples/template_use/Jamfile b/examples/template_use/Jamfile new file mode 100644 index 000000000..f425c2f07 --- /dev/null +++ b/examples/template_use/Jamfile @@ -0,0 +1,24 @@ +# Copyright (C) 2002, Rene Rivera. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears in +# all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. + +# Example of how to define a template. +# This is for Boost.Build-V1 + +subproject tools/build/examples/template_use ; + +# Declare the template as a target. The sources, requirements, and +# default builds sections are copied to the targets that depend (use) +# this template. +# +template t-common + : + # SOURCES + : + # REQUIREMENTS + $(SUBDIR)/include + SOME_DEFINE + : + # DEFAULT BUILDS + ; diff --git a/examples/template_use/include/simple.h b/examples/template_use/include/simple.h new file mode 100644 index 000000000..cf304470a --- /dev/null +++ b/examples/template_use/include/simple.h @@ -0,0 +1,12 @@ +/* +Copyright (C) 2002, Rene Rivera. Permission to copy, use, modify, sell and +distribute this software is granted provided this copyright notice appears in +all copies. This software is provided "as is" without express or implied +warranty, and with no claim as to its suitability for any purpose. +*/ +#ifndef simple_h +#define simple_h + +extern int lib_call(int x); + +#endif diff --git a/examples/template_use/sub/Jamfile b/examples/template_use/sub/Jamfile new file mode 100644 index 000000000..fbe7e82fa --- /dev/null +++ b/examples/template_use/sub/Jamfile @@ -0,0 +1,44 @@ +# Copyright (C) 2002, Rene Rivera. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears in +# all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. + +# Example of how to use a template target declared in another project. +# This is for Boost.Build-V1 + +subproject tools/build/examples/template_use/sub ; + +# Declare a library target. This 'inherits' the attributes of +# the template which in this case adds the needed include +# directory. Because templates are "special" targets they +# appear in the source dependencies section and must be +# a relative reference to the template target in it's declared +# location. +# +lib simple + : + # SOURCES +