summaryrefslogtreecommitdiff
path: root/solenv/doc
diff options
context:
space:
mode:
authorBjoern Michaelsen <b_michaelsen@openoffice.org>2010-04-29 11:51:30 +0200
committerBjoern Michaelsen <b_michaelsen@openoffice.org>2010-04-29 11:51:30 +0200
commit0408edd812369582faf4a12b9751d5b39b2e1e0f (patch)
treea9ecd896421a893612a2679d92d090e757801885 /solenv/doc
parent9c7c509ce9db36dc7986be323dce694947fde2fc (diff)
CWS gnumake2: refactoring, documenation
Diffstat (limited to 'solenv/doc')
-rw-r--r--solenv/doc/gbuild/doxygen.cfg4
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/alllangres.mk90
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/helper.mk42
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/library.mk5
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/linktarget.mk36
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/package.mk30
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/sdi.mk23
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/static_library.mk5
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/types.mk80
9 files changed, 269 insertions, 46 deletions
diff --git a/solenv/doc/gbuild/doxygen.cfg b/solenv/doc/gbuild/doxygen.cfg
index 86b35a6c5443..2345b58d5c30 100644
--- a/solenv/doc/gbuild/doxygen.cfg
+++ b/solenv/doc/gbuild/doxygen.cfg
@@ -170,7 +170,7 @@ SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
-TAB_SIZE = 8
+TAB_SIZE = 4
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
@@ -587,7 +587,7 @@ FILE_PATTERNS = *.mk
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
-RECURSIVE = NO
+RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
diff --git a/solenv/doc/gbuild/solenv/gbuild/alllangres.mk b/solenv/doc/gbuild/solenv/gbuild/alllangres.mk
new file mode 100644
index 000000000000..da55c114b983
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/alllangres.mk
@@ -0,0 +1,90 @@
+#include <types.h>
+
+namespace gb
+{
+ class SrsTarget;
+ class ResTarget;
+ class AllLangResTarget;
+
+ class SrsPartTarget : public Target, public HasDependencies, public UsesRsc
+ {
+ private:
+ /// SrsPartTarget do not need to be explicitly constructed.
+
+ /// They are a helper class for the SrsTarget class.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ SrsPartTarget(String name);
+ friend class SrsTarget;
+
+ /// Platformdependant command to generate the dependencies for the srs target.
+ static const Command command_dep(
+ String srsname,
+ Path sourcefile,
+ List<Path> include,
+ List<String> defs);
+ };
+
+ class SrsTarget : public Target, public HasDependencies, public IsCleanable
+ {
+ public:
+ /// Sets defines for srs processing.
+ /// \$\$(DEFS) contains the current flags and can be used, if
+ /// just a few need to be modified.
+ void set_defs(List<String> defs);
+ /// Sets the include paths for srs processing.
+ /// \$\$(INCLUDE) contains the current paths and can be used, if
+ /// just a few need to be modified.
+ void set_include(List<String> include);
+ /// Adds a SrsPartTarget to be processed.
+ void add_file(SrsPartTarget part);
+ /// Adds multiple SrsPartTarget s to be processed.
+ void add_files(List<SrsPartTarget> parts);
+ private:
+ /// SrsPartTarget do not need to be explicitly constructed.
+
+ /// They are a helper class for the ResTarget class.
+ SrsTarget(String name);
+ friend class ResTarget;
+
+ List<String> DEFS;
+ List<String> INCLUDE
+ List<SrsPartTarget> PARTS;
+ static const List<String> DEFAULTDEFS;
+ };
+
+ class ResTarget : public Target, public IsCleanable, public HasSrs
+ {
+ public:
+ void add_file(Path file);
+ void add_files(List<Path> files);
+ private:
+ /// ResTarget do not need to be explicitly constructed.
+
+ /// They are a helper class for the AllLangResTarget class.
+ ResTarget(String name, String library, Language lang, Path reslocation);
+ friend class AllLangResTarget;
+
+ String LIBRARY;
+ Language LANGUAGE;
+ Path RESLOCATION;
+ };
+
+ class AllLangResTarget : public Target, public IsCleanable, public HasSrs
+ {
+ public:
+ AllLangResTarget(String name);
+ /// Sets the location where resources are to be found. reslocation is a path relative to the default_images directory.
+ /// Resources will be found in reslocation itself and in the subdirectories res/ and imglst/ of it and again in subdirectories
+ /// of those named as the language of the processed resource. In addition, resources are found in the res/ directory directly
+ /// below default_images and the subdirectory of it named as the language of the processed resource.
+ void set_reslocation(Path reslocation);
+ private:
+ /// Sets the languages for which to create resources.
+ static void set_langs(List<Language> langs);
+
+ /// The list of languages that need to be build.
+ static List<Language> LANGS;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/helper.mk b/solenv/doc/gbuild/solenv/gbuild/helper.mk
new file mode 100644
index 000000000000..3fa666b857a8
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/helper.mk
@@ -0,0 +1,42 @@
+#include <types.h>
+
+String NEWLINE;
+String COMMA;
+
+namespace gb
+{
+ using namespace types;
+
+ class Helper
+ {
+ public:
+ /// Abbreviates the common directory roots in a command
+ static Command abbreviate_dirs(Command c);
+ /// Announces the start/end of an task.
+ static void announce(String announcement);
+ /// Creates the default get_clean_target() function for the type.
+ static void make_clean_target(TargetType t);
+ /// Creates the default get_clean_target() function for the types.
+ static void make_clean_targets(List<TargetType> ts);
+ /// Creates the default get_dep_target() function for the type.
+ static void make_dep_target(TargetType t);
+ /// Creates the default get_dep_target() function for the types.
+ static void make_dep_targets(List<TargetType> ts);
+ /// Creates the default get_dep_target() function for the type modifying the \$(OUTDIR).
+ static void make_outdir_clean_target(TargetType t);
+ /// Creates the default get_dep_target() function for types modifying the \$(OUTDIR).
+ static void make_outdir_clean_targets(List<TargetType> ts);
+ /// Returns the clean target of a target modifying the \$(OUTDIR).
+ static Path get_outdir_clean_target(Path target);
+
+ /// The path to a zero length file.
+ static const Path NULLFILE;
+ /// The path to the misc directory for temporary files etc.
+ static const Path MISC;
+ /// The path to a phony target, that is always outdated.
+ static const Path PHONY;
+ /// Internally used dummy file.
+ static const Path MISCDUMMY;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/library.mk b/solenv/doc/gbuild/solenv/gbuild/library.mk
index 152578074ce5..85e1f6141a0f 100644
--- a/solenv/doc/gbuild/solenv/gbuild/library.mk
+++ b/solenv/doc/gbuild/solenv/gbuild/library.mk
@@ -10,6 +10,11 @@ namespace gb
{
public:
Library(String name) {};
+ /// Returns how the library is named in the filesystem on the current platform.
+ /// Library filename schemes are defined in solenv/gbuild/libnames.mk (with some platformdependant hacks in solenv/gbuild/platform/*.mk.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_filename();
private:
/// private helper function for the constructor
diff --git a/solenv/doc/gbuild/solenv/gbuild/linktarget.mk b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk
index d1cf369d1974..1cef68c1a21b 100644
--- a/solenv/doc/gbuild/solenv/gbuild/linktarget.mk
+++ b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk
@@ -20,25 +20,25 @@ namespace gb
/// CObjects do not need to be explicitly constructed.
/// They are named after the path of their source file (without
/// file extension) from the root of their source repository.
- CObject(String name) {};
- friend LinkTarget;
+ CObject(String name);
+ friend class LinkTarget;
- /// Platformdependant command to compile a plain C object.
+ /// Platformdependent command to compile a plain C object.
static const Command command(
Path objectfile,
String name,
Path sourcefile,
List<String> defs,
List<String> cxxflags,
- List<String> include);
- /// Platformdependant command to generate plain C object dependancies.
+ List<Path> include);
+ /// Platformdependent command to generate plain C object dependencies.
static const Command command_dep(
Path depfile,
String name,
Path sourcefile,
List<String> defs,
List<String> cxxflags,
- List<String> include);
+ List<Path> include);
};
/// CxxObjects are never used standalone. They only exist as part of a
@@ -46,40 +46,40 @@ namespace gb
class CxxObject : public HasSource, public HasDependencies, public Target
{
public:
- Path get_source() {};
+ Path get_source();
private:
/// CxxObjects do not need to be explicitly constructed.
/// They are named after the path of their source file (without
/// file extension) from the root of their source repository.
- CxxObject(String name) {};
- friend LinkTarget;
+ CxxObject(String name);
+ friend class LinkTarget;
- /// Platformdependant command to compile a C++ object.
+ /// Platformdependent command to compile a C++ object.
static const Command command(
Path objectfile,
String name,
Path sourcefile,
List<String> defs,
List<String> cxxflags,
- List<String> include);
- /// Platformdependant command to generate C++ object dependancies.
+ List<Path> include);
+ /// Platformdependent command to generate C++ object dependencies.
static const Command command_dep(
Path objectfile,
String name,
Path sourcefile,
List<String> defs,
List<String> cxxflags,
- List<String> include);
+ List<Path> include);
};
class LinkTarget : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target
{
public:
- LinkTarget(String name) {};
+ LinkTarget(String name);
private:
- void get_external_headers_check() {};
- void add_internal_headers(const List<Target>& internal_headers) {};
+ void get_external_headers_check();
+ void add_internal_headers(const List<Target>& internal_headers);
/// @warning Evil Hack: SELF is set to the name of the LinkTarget
/// in the constructor. If SELF is not set to the LinkTarget name in
@@ -103,7 +103,7 @@ namespace gb
List<String> TARGETTYPE_FLAGS;
Path DLLTARGET;
- /// Platformdependant command for linking.
+ /// Platformdependent command for linking.
static const Command command (
Path linktargetfile,
String linktargetname,
@@ -112,7 +112,7 @@ namespace gb
List<StaticLibrary> linked_static_libs,
List<CObject> cobjects,
List<CxxObject> cxxobjects);
- /// Command to collect all dependancies of this LinkTarget.
+ /// Command to collect all dependencies of this LinkTarget.
static const Command command_dep(
Path depfile,
String linktargetname,
diff --git a/solenv/doc/gbuild/solenv/gbuild/package.mk b/solenv/doc/gbuild/solenv/gbuild/package.mk
new file mode 100644
index 000000000000..53daeb5c80af
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/package.mk
@@ -0,0 +1,30 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+ class PackagePart
+ {
+ private:
+ /// PackagePart s do not need to be explicitly constructed.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ PackagePart(String name, Path Source);
+ friend Package;
+ /// Returns a list of aboslute paths where files are copied to with the PackagePart class.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ static const List<Path> get_destinations();
+ };
+
+ class Package : public Target, public IsCleanable
+ {
+ public:
+ /// Creates a new package that copies files from source_dir to the \$(OUTDIR).
+ Package(String name, Path source_dir);
+ /// Adds a file to the package. destination is the relative path in
+ /// the \$(OUTDIR) and source is the relative path in the source_dir.
+ add_file(Path destination, Path source);
+ }
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/sdi.mk b/solenv/doc/gbuild/solenv/gbuild/sdi.mk
new file mode 100644
index 000000000000..f9f913fb141c
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/sdi.mk
@@ -0,0 +1,23 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class SdiTarget : public Target, public IsCleanable
+ {
+ public:
+ /// Creates a new SdiTarget.
+ SdiTarget(String name, String exports);
+ /// Sets the include paths for this SdiTarget.
+ set_include(List<Path> includes);
+ private:
+ /// The command to execute svidl.
+ static const Command SVIDLCOMMAND;
+ /// The target on with to depend to make sure the svidl executable is available.
+ static const Path SVIDLTARGET;
+ /// The target on with to depend to make sure the auxiliary files (libraries etc.) for the svidl executable are available.
+ static const Path SVIDLAUXDEPS;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/static_library.mk b/solenv/doc/gbuild/solenv/gbuild/static_library.mk
index c6b81960f74e..741589f582c2 100644
--- a/solenv/doc/gbuild/solenv/gbuild/static_library.mk
+++ b/solenv/doc/gbuild/solenv/gbuild/static_library.mk
@@ -10,6 +10,11 @@ namespace gb
{
public:
StaticLibrary(String name) {};
+ /// Returns how the library is named in the filesystem on the current platform.
+ /// StaticLibrary filename schemes are defined in solenv/gbuild/libnames.mk (with some platformdependant hacks in solenv/gbuild/platform/*.mk.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_filename();
private:
/// private helper function for the constructor
diff --git a/solenv/doc/gbuild/solenv/gbuild/types.mk b/solenv/doc/gbuild/solenv/gbuild/types.mk
index 1cddf1a7f401..ecb736834736 100644
--- a/solenv/doc/gbuild/solenv/gbuild/types.mk
+++ b/solenv/doc/gbuild/solenv/gbuild/types.mk
@@ -9,6 +9,8 @@ namespace gb {
namespace gb { namespace types
{
+ /// A type of target, with its set of rules etc., as used in the build system.
+ class TargetType {};
/// A plain old string.
class String {};
/// A partial, relative or absolute filesystem path.
@@ -18,10 +20,10 @@ namespace gb { namespace types
{
public:
/// The absolute filesystem path representing the target.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
Path get_target();
};
- /// A target that can be linked against statically.
- class StaticLinkable {};
/// A partial or complete shell-command.
class Command {};
/// A integer number.
@@ -53,6 +55,8 @@ namespace gb { namespace types
{
public:
/// The (phony) absolute filesystem path to clean the target.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
Path get_clean_target();
};
/// A target that has generated dependencies.
@@ -60,6 +64,8 @@ namespace gb { namespace types
{
public:
/// The absolute filesystem path to the file containing the dependencies.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
Path get_dep_target();
};
/// A target that has a source file from which it is generated.
@@ -74,68 +80,90 @@ namespace gb { namespace types
{
public:
/// Add a CObject to be compiled and linked.
- void add_cobject(const CObject& cobject);
+ void add_cobject(CObject cobject);
/// Add multiple CObject s to be compiled and linked.
- void add_cobjects(const List<CObject>& cobjects);
+ void add_cobjects(List<CObject> cobjects);
/// Add a CxxObject to be compiled and linked.
- void add_cxxobject(const CxxObject& cobject);
+ void add_cxxobject(CxxObject cobject);
/// Add multiple CxxObject s to be compiled and linked.
- void add_cxxobjects(const List<CxxObject>& cobjects);
+ void add_cxxobjects(List<CxxObject> cobjects);
/// Add multiple CxxObject s to be compiled and linked (with exceptions enabled).
- void add_exception_objects(const List<CxxObject>& cobject);
+ void add_exception_objects(List<CxxObject> cobject);
/// Add libraries to link against dynamically.
- void add_linked_libs(const List<Library>& linked_libs);
+ void add_linked_libs(List<Library> linked_libs);
/// Add libraries to link against statically.
- void add_linked_static_libs(const List<StaticLibrary>& linked_static_libs);
+ void add_linked_static_libs(List<StaticLibrary> linked_static_libs);
/// Add multiple CxxObject s to be compiled and linked (without exceptions enabled).
- /// @deprecated { We should not care about disabling exception. }
- void add_noexception_objects(const List<CxxObject>& cobject);
+ /// @deprecated We should not care about disabling exception.
+ void add_noexception_objects(List<CxxObject> cobject);
/// Set auxiliary files that are produced by linking (for cleanup and copying).
- void set_auxtargets(const List<Path>& auxtargets);
+ void set_auxtargets(List<Path> auxtargets);
/// Set the location for the produced DLL (used on Windows only).
- void set_dll_target(const Path& dlltarget);
+ void set_dll_target(Path dlltarget);
/// Set additional flags for the link command.
- void set_ldflags(const List<Path>& ldflags);
+ void set_ldflags(List<Path> ldflags);
};
/// A target that delivers headers of some kind.
class DeliversHeaders
{
public:
/// The absolute filesystem path which is touched when all headers for this target are prepared.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
Path get_headers_target();
/// The absolute filesystem path which is touched when all external headers for this target are prepared.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
Path get_external_headers_target();
/// Add multiple Packages that need to be delivered/generated
/// before compilation or dependency generation can start.
- void add_package_headers(const List<Package>& packages);
+ void add_package_headers(List<Package> packages);
/// Add multiple SdiTargets that need to be delivered/generated
/// before compilation or dependency generation can start.
- void add_sdi_headers(const List<SdiTarget>& sdis);
+ void add_sdi_headers(List<SdiTarget> sdis);
};
/// A target where settings for the compilation can be set.
class HasCompileSettings
{
public:
/// Sets flags for plain C compilation.
- /// \$\$(CFLAGS) contains the current flags and can be used, if
+ /// \$\$(CFLAGS) contains the current flags and can be used if
/// just a few need to be modified.
- void set_cflags(const List<String>& cflags);
+ void set_cflags(List<String> cflags);
/// Sets flags for C++ compilation.
- /// \$\$(CXXFLAGS) contains the current flags and can be used, if
+ /// \$\$(CXXFLAGS) contains the current flags and can be used if
/// just a few need to be modified.
- void set_cxxflags(const List<String>& cxxflags);
+ void set_cxxflags(List<String> cxxflags);
/// Sets defines for C/C++ compilation.
- /// \$\$(DEFS) contains the current flags and can be used, if
+ /// \$\$(DEFS) contains the current flags and can be used if
/// just a few need to be modified.
- void set_defs(const List<String>& defs);
+ void set_defs(List<String> defs);
/// Sets the include paths for C/C++ compilation.
- /// \$\$(INCLUDE) contains the current paths and can be used, if
+ /// \$\$(INCLUDE) contains the current paths and can be used if
/// just a few need to be modified.
- void set_include(const List<Path>& include);
+ void set_include(List<Path> include);
/// Sets the stl include paths for C++ compilation.
- /// \$\$(INCLUDE_STL) contains the current paths and can be used, if
+ /// \$\$(INCLUDE_STL) contains the current paths and can be used if
/// just a few need to be modified.
- void set_include_stl(const List<Path>& include_stl);
+ void set_include_stl(List<Path> include_stl);
+ };
+ /// A target using the resource compiler
+ class UsesRsc
+ {
+ public:
+ /// The command to execute rsc.
+ static const Command RSCCOMMAND;
+ /// The target on with to depend to make sure the rsc executable is available.
+ static const Path RSCTARGET;
+ };
+ /// A target processing a set of srs files
+ class HasSrs
+ {
+ public:
+ /// Add a SrsTarget to be processed.
+ void add_one_srs(SrsTarget srs);
+ /// Add multiple SrsTarget s to be processed.
+ void add_srs(List<SrsTarget> srs);
};
}};
/* vim: set filetype=cpp : */