diff options
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/doc/gbuild/doxygen.cfg | 4 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/executable.mk | 27 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/gbuild.mk | 46 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/library.mk | 37 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/linktarget.mk | 128 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/static_library.mk | 35 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/gbuild/types.mk | 141 | ||||
-rw-r--r-- | solenv/doc/gbuild/solenv/inc/gbuild.mk | 254 | ||||
-rw-r--r-- | solenv/gbuild/alllangres.mk | 10 | ||||
-rw-r--r-- | solenv/gbuild/executable.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/library.mk | 8 | ||||
-rw-r--r-- | solenv/gbuild/linktarget.mk | 37 | ||||
-rw-r--r-- | solenv/gbuild/platform/linux.mk | 16 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk (renamed from solenv/inc/platform/solaris.mk) | 18 | ||||
-rw-r--r-- | solenv/gbuild/platform/windows.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/static_library.mk | 4 |
16 files changed, 475 insertions, 306 deletions
diff --git a/solenv/doc/gbuild/doxygen.cfg b/solenv/doc/gbuild/doxygen.cfg index 8e2fd440fcb4..86b35a6c5443 100644 --- a/solenv/doc/gbuild/doxygen.cfg +++ b/solenv/doc/gbuild/doxygen.cfg @@ -564,7 +564,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = solenv/inc/gbuild.mk +INPUT = solenv/gbuild # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -830,7 +830,7 @@ DOCSET_FEEDNAME = "Doxygen generated docs" # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. -DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_BUNDLE_ID = org.openoffice.gbuild # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the diff --git a/solenv/doc/gbuild/solenv/gbuild/executable.mk b/solenv/doc/gbuild/solenv/gbuild/executable.mk new file mode 100644 index 000000000000..523f18330012 --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/executable.mk @@ -0,0 +1,27 @@ +#include <types.h> + +namespace gb +{ + using namespace types; + + class LinkTarget; + + class Executable : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target + { + public: + Executable(String name) {}; + + private: + /// private helper function for the constructor + void Executable_impl( + LinkTarget library_linktarget) {}; + /// platformdependant additional setup for constructor (used on Windows only) + void Executable_platform( + LinkTarget library_linktarget); + /// helper function to wrap LinkTargets functions (this is more or less pimpl ...) + void forward_to_linktarget(Function f) {}; + + static const List<String> TARGETTYPEFLAGS; + }; +} +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/gbuild/gbuild.mk b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk new file mode 100644 index 000000000000..ec51b7ae6b3a --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk @@ -0,0 +1,46 @@ + +#include <types.mk> +using namespace gb::types; + +// GNU make specific setup +static const Command SHELL; + + +// gbuild root directorys +static Path SRCDIR; +static Path OUTDIR; +static Path WORKDIR; + +// Expected from configure/environment +static const Integer OSL_DEBUG_LEVEL; +static const List<Path> JDKINCS; +static const List<Path> SOLARINC; +static const List<Path> SOLARLIB; +static const Path GBUILDDIR; +static const Path INPATH; +static const Path JAVA_HOME; +static const Path UPD; +static const String CVER; +static const String LIBXML_CFLAGS; +static const String OS; +static const String STLPORT_VER; +static const Bool DEBUG; +static const Bool PRODUCT; + +// gbuild global variables derived from the configure/environment +namespace gb +{ + static const Integer PRODUCT; + static const Integer DEBUGLEVEL; + static const Bool FULLDEPS; + static const List<String> GLOBALDEFS; +}; + +// GXX_INCLUDE_PATH (Linux) +// PTHREAD_CFLAGS (Linux) +// SYSTEM_ICU (Linux) +// SYSTEM_JPEG (Linux) +// SYSTEM_LIBXML (Linux) +// USE_SYSTEM_STL (Linux) + +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/gbuild/library.mk b/solenv/doc/gbuild/solenv/gbuild/library.mk new file mode 100644 index 000000000000..152578074ce5 --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/library.mk @@ -0,0 +1,37 @@ +#include <types.h> + +namespace gb +{ + using namespace types; + + class LinkTarget; + + class Library : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target + { + public: + Library(String name) {}; + + private: + /// private helper function for the constructor + void Library_impl( + LinkTarget library_linktarget) {}; + /// platformdependant additional setup for constructor (used on Windows only) + void Library_platform( + LinkTarget library_linktarget, + Path dllfile); + /// helper function to wrap LinkTargets functions (this is more or less pimpl ...) + void forward_to_linktarget(Function f) {}; + + /// List of buildable libraries (i.e. libraries that are not expected to exist outside of \$(OUTDIR) on the system). + static const List<Library> TARGETS; + /// List of additional defines for compiling objects for libraries + static const List<String> DEFS; + /// List of additional flags for linking a library + static const List<String> TARGETTYPEFLAGS; + /// Mapping from symbolic library names to dll filenames + static const Map<Library,Path> DLLFILENAMES; + /// Mapping from symbolic library names to filenames + static const Map<Library,Path> FILENAMES; + }; +} +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/gbuild/linktarget.mk b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk new file mode 100644 index 000000000000..d1cf369d1974 --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk @@ -0,0 +1,128 @@ +#include <types.h> + +namespace gb +{ + using namespace types; + + class LinkTarget; + class Library; + class StaticLibrary; + class SdiTarget; + class Package; + + /// CObjects are never used standalone. They only exist as part of a + /// LinkTarget. + class CObject : public HasSource, public HasDependencies, public Target + { + public: + Path get_source() {}; + private: + /// 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; + + /// Platformdependant 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. + static const Command command_dep( + Path depfile, + String name, + Path sourcefile, + List<String> defs, + List<String> cxxflags, + List<String> include); + }; + + /// CxxObjects are never used standalone. They only exist as part of a + /// LinkTarget. + class CxxObject : public HasSource, public HasDependencies, public Target + { + public: + 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; + + /// Platformdependant 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. + static const Command command_dep( + Path objectfile, + String name, + Path sourcefile, + List<String> defs, + List<String> cxxflags, + List<String> include); + }; + + class LinkTarget : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target + { + public: + LinkTarget(String name) {}; + + private: + 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 + /// the execution of the header rule, the LinkTarget is used (linked + /// against) but was never defined. This might work out, if the + /// LinkTarget has been provided by other means (for example: + /// build.pl/dmake), but it should never happen in a project where + /// all LinkTarget s are controlled by gbuild. + LinkTarget& SELF; + List<CObject> COBJECTS; + List<CxxObject> CXXOBJECTS; + List<Library> LINKED_LIBS; + List<Path> AUXTARGETS; + List<Path> INCLUDE; + List<Path> INCLUDE_STL; + List<StaticLibrary> LINKED_STATIC_LIBS; + List<String> CFLAGS; + List<String> CXXFLAGS; + List<String> DEFS; + List<String> LDFLAGS; + List<String> TARGETTYPE_FLAGS; + Path DLLTARGET; + + /// Platformdependant command for linking. + static const Command command ( + Path linktargetfile, + String linktargetname, + List<String> linkflags, + List<Library> linked_libs, + List<StaticLibrary> linked_static_libs, + List<CObject> cobjects, + List<CxxObject> cxxobjects); + /// Command to collect all dependancies of this LinkTarget. + static const Command command_dep( + Path depfile, + String linktargetname, + List<CObject> cobjects, + List<CxxObject> cxxobjects); + static const List<String> DEFAULTDEFS; + static const List<String> CXXFLAGS; + static const List<String> LDFLAGS; + static const List<Path> INCLUDE; + static const List<Path> INCLUDE_STL; + }; +} +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/gbuild/static_library.mk b/solenv/doc/gbuild/solenv/gbuild/static_library.mk new file mode 100644 index 000000000000..c6b81960f74e --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/static_library.mk @@ -0,0 +1,35 @@ +#include <types.h> + +namespace gb +{ + using namespace types; + + class LinkTarget; + + class StaticLibrary : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target + { + public: + StaticLibrary(String name) {}; + + private: + /// private helper function for the constructor + void StaticLibrary_impl( + LinkTarget library_linktarget) {}; + /// helper function to wrap LinkTargets functions (this is more or less pimpl ...). + void forward_to_linktarget(Function f) {}; + + /// List of buildable static libraries (i.e. static libraries that are not expected to exist outside of \$(OUTDIR) on the system). + static const List<StaticLibrary> TARGETS; + /// List of additional defines for compiling objects for static libraries + static const List<String> DEFS; + /// List of additional flags for linking a static library + static const List<String> TARGETTYPEFLAGS; + /// Mapping from symbolic static library names to filenames + static const Map<StaticLibrary,Path> FILENAMES; + /// location to place static libraries in the \$(OUTDIR) + static const Path OUTDIRLOCATION; + /// platformdependant file extension for static libraries + static const String PLAINEXT; + }; +} +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/gbuild/types.mk b/solenv/doc/gbuild/solenv/gbuild/types.mk new file mode 100644 index 000000000000..1cddf1a7f401 --- /dev/null +++ b/solenv/doc/gbuild/solenv/gbuild/types.mk @@ -0,0 +1,141 @@ +namespace gb { + class CObject; + class CxxObject; + class Library; + class StaticLibrary; + class Package; + class SdiTarget; +}; + +namespace gb { namespace types +{ + /// A plain old string. + class String {}; + /// A partial, relative or absolute filesystem path. + class Path {}; + /// A target to be build. + class Target + { + public: + /// The absolute filesystem path representing the target. + Path get_target(); + }; + /// A target that can be linked against statically. + class StaticLinkable {}; + /// A partial or complete shell-command. + class Command {}; + /// A integer number. + class Integer {}; + /// A boolean value. + + /// There are const boolean values true and false for + /// comparisons (written as $(true) and $(false) in makefiles. + class Bool {}; + /// A language (for localisation) + + /// A language represented by its ISO 639-1:2002 code. + class Language {}; + /// A List of objects. + + /// A List of objects represented by a whitespace separated list + /// in makefiles. + template <typename T> + class List<T> {}; + + /// A Mapping from with a key of type K and a value of type V + + /// A Mapping is represented by a whitespace separated list + /// of key-value pairs. Key and value are separated by a colon (:). + template <typename K, typename V> + class Map<K,V> {}; + /// A target that can be cleaned. + class IsCleanable + { + public: + /// The (phony) absolute filesystem path to clean the target. + Path get_clean_target(); + }; + /// A target that has generated dependencies. + class HasDependencies + { + public: + /// The absolute filesystem path to the file containing the dependencies. + Path get_dep_target(); + }; + /// A target that has a source file from which it is generated. + class HasSource + { + public: + /// The absolute filesystem path to the source file. + Path get_source(); + }; + /// A target that links objects and libraries. + class IsLinking + { + public: + /// Add a CObject to be compiled and linked. + void add_cobject(const CObject& cobject); + /// Add multiple CObject s to be compiled and linked. + void add_cobjects(const List<CObject>& cobjects); + /// Add a CxxObject to be compiled and linked. + void add_cxxobject(const CxxObject& cobject); + /// Add multiple CxxObject s to be compiled and linked. + void add_cxxobjects(const List<CxxObject>& cobjects); + /// Add multiple CxxObject s to be compiled and linked (with exceptions enabled). + void add_exception_objects(const List<CxxObject>& cobject); + /// Add libraries to link against dynamically. + void add_linked_libs(const List<Library>& linked_libs); + /// Add libraries to link against statically. + void add_linked_static_libs(const 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); + /// Set auxiliary files that are produced by linking (for cleanup and copying). + void set_auxtargets(const List<Path>& auxtargets); + /// Set the location for the produced DLL (used on Windows only). + void set_dll_target(const Path& dlltarget); + /// Set additional flags for the link command. + void set_ldflags(const 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. + Path get_headers_target(); + /// The absolute filesystem path which is touched when all external headers for this target are prepared. + 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); + /// Add multiple SdiTargets that need to be delivered/generated + /// before compilation or dependency generation can start. + void add_sdi_headers(const 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 + /// just a few need to be modified. + void set_cflags(const List<String>& cflags); + /// Sets flags for C++ compilation. + /// \$\$(CXXFLAGS) contains the current flags and can be used, if + /// just a few need to be modified. + void set_cxxflags(const List<String>& cxxflags); + /// Sets defines for C/C++ compilation. + /// \$\$(DEFS) contains the current flags and can be used, if + /// just a few need to be modified. + void set_defs(const List<String>& defs); + /// Sets the include paths for C/C++ compilation. + /// \$\$(INCLUDE) contains the current paths and can be used, if + /// just a few need to be modified. + void set_include(const List<Path>& include); + /// Sets the stl include paths for C++ compilation. + /// \$\$(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); + }; +}}; +/* vim: set filetype=cpp : */ diff --git a/solenv/doc/gbuild/solenv/inc/gbuild.mk b/solenv/doc/gbuild/solenv/inc/gbuild.mk deleted file mode 100644 index aac59462bb93..000000000000 --- a/solenv/doc/gbuild/solenv/inc/gbuild.mk +++ /dev/null @@ -1,254 +0,0 @@ - - -namespace types -{ - /// A plain old string. - class String {}; - /// A partial, relative or absolute filesystem path. - class Path {}; - /// A target represented by an absolute filesystem path. - class Target {}; - /// A partial or complete shell-command. - class Command {}; - /// A library name as used on in the linking step. - class Linkname {}; - /// A integer number. - class Integer {}; - /// A boolean value. - - /// There are const boolean values true and false for - /// comparisons (written as $(true) and $(false) in makefiles. - class Bool {}; - /// A language (for localisation) - - /// A language represented by its ISO 639-1:2002 code. - class Language {}; - /// A List of objects. - - /// A List of objects represented by a whitespace separated list - /// in makefiles. - template <typename T> - class List<T> {}; -}; - -using namespace types; - -namespace gb -{ - class Library; - class OOoLibrary; - class RtLibrary; - class Executable; - class Module; - class AllLangResTarget; - class SystemLibrary {}; - - class Helper - { - public: - static Command announce(Target target); - static Command abbreviate_dirs(Command command); - }; - - class StaticLibrary - { - public: - StaticLibrary(String name); - Target get_target(); - }; - - class Objectfile - { - public: - Objectfile(String name); - Target get_target(); - Target get_dep_filename(); - Target get_cxx_source_filename(); - }; - - enum LinkTargetType { - LIB, - EXE - }; - - class LinkTarget - { - private: - friend class Library; - friend class Executable; - - LinkTarget(LinkTargetType type, String name, Target target); - Target get_target(); - Target get_headers_target(); - Target get_dep_filename(); - void set_cxxflags(String cxxflags); - void set_visibility_hidden(Bool visibility_hidden); - void set_include(String include); - void set_ldflags(String ldflags); - void set_library_path_flags(String library_path_flags); - void add_linked_libs(List<Library> linked_libraries); - void add_object(Objectfile objectfile); - void add_noexception_object(Objectfile objectfile); - void add_exception_object(Objectfile objectfile); - void add_noexception_objects(List<Objectfile> objectfiles); - void add_exception_objects(List<Objectfile> objectfiles); - - List<String> DEFS; - List<String> CXXFLAGS; - List<String> INCLUDE; - String VISIBILITY; - List<String> LDFLAGS; - List<String> LIBRARY_PATH_FLAGS; - List<Linkname> LINKED_LIBS; - List<Linkname> LINKED_SYS_LIBS; - List<Objectfile> OBJECTS; - List<String> TARGETTYPE_LINK_FLAGS; - }; - - - class Library - { - protected: - Library(String name, Target target); - public: - Target get_target(); - Target get_headers_target(); - Target get_dep_filename(); - void set_cxxflags(String cxxflags); - void set_visibility_hidden(Bool visibility_hidden); - void set_include(String include); - void set_ldflags(String ldflags); - void set_library_path_flags(String library_path_flags); - void add_linked_libs(List<Library> linked_libraries); - void add_linked_system_libs(List<SystemLibrary> linked_system_libraries); - void add_object(Objectfile objectfile); - void add_noexception_object(Objectfile objectfile); - void add_exception_object(Objectfile objectfile); - void add_noexception_objects(List<Objectfile> objectfiles); - void add_exception_objects(List<Objectfile> objectfiles); - }; - - class OOoLibrary : public Library - { - public: - OOoLibrary(String name); - Target get_target(); - Target get_headers_target(); - Target get_dep_filename(); - Linkname get_linkname(); - static List<Linkname> get_linknames(List<OOoLibrary> ooolibraries); - }; - - class RtLibrary : public Library - { - public: - RtLibrary(String name); - Target get_target(); - Target get_headers_target(); - Target get_dep_filename(); - Linkname get_linkname(); - static List<Linkname> get_linknames(List<RtLibrary> ooolibraries); - }; - - class Executable - { - public: - Executable(String name); - Target get_target(); - void set_cxxflags(List<String> cxxflags); - void set_visibility_hidden(Bool visibility_hidden); - void set_include(List<String> include); - void set_ldflags(List<String> ldflags); - void set_library_path_flags(List<String> library_path_flags); - void add_linked_libs(List<Library> linked_libraries); - void add_linked_system_libs(List<SystemLibrary> linked_system_libraries); - void add_object(Objectfile objectfile); - void add_noexception_object(Objectfile objectfile); - void add_exception_object(Objectfile objectfile); - void add_noexception_objects(List<Objectfile> objectfiles); - void add_exception_objects(List<Objectfile> objectfiles); - }; - - class SdiTarget - { - private: - List<String> INCLUDE; - public: - SdiTarget(String name); - Target get_target(); - void set_include(List<String> include); - }; - - class SrsTarget - { - private: - List<String> DEFS; - List<String> INCLUDE; - public: - SrsTarget(String name); - Target get_target(); - void set_defs(List<String> defs); - void set_include(List<String> include); - }; - - class ResTarget - { - private: - friend class AllLangResTarget; - ResTarget(String name, Language language); - public: - Target get_target(); - void add_file(SrsTarget srstarget); - void add_files(List<SrsTarget> srstargets); - }; - - class AllLangResTarget - { - public: - AllLangResTarget(String name); - void add_file(SrsTarget srstarget); - void add_files(List<SrsTarget> srstargets); - }; - - class Package - { - public: - Package(String name, Path sourcedir); - void add_file(Target destination, Path source); - Path SOURCEDIR; - }; - - class Module - { - public: - Module(String name); - Target get_target(); - void make_global_targets(); - void read_includes(List<String> includes); - }; -}; -static String GUI; -static String COM; -static Path INPATH; -static Path SRCDIR; -static Path OUTDIR; -static Path WORKDIR; -static bool FULL_DEPENDENCIES; -static List<gb::Module> ALL_MODULES; - -static Command SHELL; -static Path CXX; -static Path GCCP; -static Target SVIDLTARGET; -static Command SVIDLCOMMAND; -static Target RSCTARGET; -static Command RSCCOMMAND; - -static List<String> GLOBALDEFS; -static List<String> CFLAGSCXX; -static List<String> EXCEPTIONFLAGS; -static List<String> NOEXCEPTIONFLAGS; -static List<String> LDFLAGS; -static Integer OSL_DEBUG_LEVEL; - -/* vim: set filetype=cpp : */ diff --git a/solenv/gbuild/alllangres.mk b/solenv/gbuild/alllangres.mk index f95efb74b960..63632af9d35a 100644 --- a/solenv/gbuild/alllangres.mk +++ b/solenv/gbuild/alllangres.mk @@ -31,10 +31,10 @@ # defined by platform # gb_SrsPartTarget_RSCTARGET # gb_SrsPartTarget_RSCCOMMAND -# gb_SrsPartTarget_command_dep +# gb_SrsPartTarget__command_dep $(call gb_SrsPartTarget_get_target,%) : $(SRCDIR)/% $(gb_Helper_MISCDUMMY) | $(gb_SrsPartTarget_RSCTARGET) - $(call gb_SrsPartTarget_command_dep,$*,$<,$(INCLUDE),$(DEFS)) + $(call gb_SrsPartTarget__command_dep,$*,$<,$(INCLUDE),$(DEFS)) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $@) && \ RESPONSEFILE=`mktemp -p $(gb_Helper_MISC)` && \ @@ -72,7 +72,7 @@ $(call gb_SrsTarget_get_clean_target,%) : $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part)))) -define gb_SrsTarget_command_dep +define gb_SrsTarget__command_dep $(call gb_Helper_announce,Collecting dependencies for srs $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -80,14 +80,14 @@ $(call gb_Helper_abbreviate_dirs,\ endef $(call gb_SrsTarget_get_target,%) : - $(call gb_SrsTarget_command_dep,$(call gb_SrsTarget_get_dep_target,$*),$*,$(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part)))) + $(call gb_SrsTarget__command_dep,$(call gb_SrsTarget_get_dep_target,$*),$*,$(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part)))) $(call gb_Helper_announce,Processing srs $* ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ cat $^ > $@) $(call gb_SrsTarget_get_dep_target,%) : - $(call gb_SrsTarget_command_dep,$@,$*,$^) + $(call gb_SrsTarget__command_dep,$@,$*,$^) define gb_SrsTarget_SrsTarget $(call gb_SrsTarget_get_target,$(1)) : DEFS := $(gb_SrsTarget_DEFAULTDEFS) diff --git a/solenv/gbuild/executable.mk b/solenv/gbuild/executable.mk index adf1d51fc8d6..4c243dc6aaf2 100644 --- a/solenv/gbuild/executable.mk +++ b/solenv/gbuild/executable.mk @@ -42,11 +42,11 @@ $(call gb_Executable_get_target,%) : mkdir -p $(dir $@) && cp -pf $< $@) define gb_Executable_Executable -$(call gb_Executable_Executable__impl,$(1),Executable/$(1)$(gb_Executable_EXT)) +$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT)) endef -define gb_Executable_Executable__impl +define gb_Executable__Executable_impl $(call gb_LinkTarget_LinkTarget,$(2)) $(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_Executable_TARGETTYPEFLAGS)) $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) diff --git a/solenv/gbuild/library.mk b/solenv/gbuild/library.mk index 83ac2316641e..e9a3d1fbf756 100644 --- a/solenv/gbuild/library.mk +++ b/solenv/gbuild/library.mk @@ -54,10 +54,10 @@ ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS))) $$(info currently known libraries are: $(sort $(gb_Library_KNOWNLIBS))) $$(error Library $(1) must be registered in $(GBUILDDIR)/inc/libnames.mk) endif -$(call gb_Library_Library__impl,$(1),$(call gb_Library_get_linktargetname,$(call gb_Library_get_filename,$(1)))) +$(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(call gb_Library_get_filename,$(1)))) endef -define gb_Library_Library__impl +define gb_Library__Library_impl $(call gb_LinkTarget_LinkTarget,$(2)) $(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_Library_TARGETTYPEFLAGS)) $(call gb_LinkTarget_set_defs,$(2),\ @@ -69,7 +69,7 @@ $(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Libr endef -define gb_Library_forward_to_Linktarget +define gb_Library__forward_to_Linktarget gb_Library_$(1) = $$(call gb_LinkTarget_$(1),$(call gb_Library_get_linktargetname,$$(call gb_Library_get_filename,$$(1))),$$(2)) endef @@ -91,7 +91,7 @@ $(eval $(foreach method,\ add_package_headers \ add_sdi_headers \ ,\ - $(call gb_Library_forward_to_Linktarget,$(method))\ + $(call gb_Library__forward_to_Linktarget,$(method))\ )) # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/linktarget.mk b/solenv/gbuild/linktarget.mk index 4949d7c10764..ea064e00015c 100644 --- a/solenv/gbuild/linktarget.mk +++ b/solenv/gbuild/linktarget.mk @@ -30,35 +30,39 @@ gb_CObject_get_source = $(SRCDIR)/$(1).c # defined by platform -# gb_CObject_command -# gb_CObject_command_dep +# gb_CObject__command +# gb_CObject__command_dep $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,%) - $(call gb_CObject_command,$@,$*,$<,$(DEFS),$(CFLAGS),$(INCLUDE)) + $(call gb_CObject__command,$@,$*,$<,$(DEFS),$(CFLAGS),$(INCLUDE)) $(call gb_CObject_get_dep_target,%) : $(call gb_CObject_get_source,%) - $(call gb_CObject_command_dep,$@,$*,$<,$(DEFS),$(CFLAGS),$(INCLUDE)) + $(call gb_CObject__command_dep,$@,$*,$<,$(DEFS),$(CFLAGS),$(INCLUDE)) $(call gb_CObject_get_dep_target,%) : $(error unable to find plain C file $(call gb_CObject_get_source,$*)) +gb_CObject_CObject = + # CxxObject class gb_CxxObject_get_source = $(SRCDIR)/$(1).cxx # defined by platform -# gb_CxxObject_command -# gb_CxxObject_command_dep +# gb_CxxObject__command +# gb_CxxObject__command_dep $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,%) - $(call gb_CxxObject_command,$@,$*,$<,$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE)) + $(call gb_CxxObject__command,$@,$*,$<,$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE)) $(call gb_CxxObject_get_dep_target,%) : $(call gb_CxxObject_get_source,%) - $(call gb_CxxObject_command_dep,$@,$*,$<,$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE)) + $(call gb_CxxObject__command_dep,$@,$*,$<,$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE)) $(call gb_CxxObject_get_dep_target,%) : $(error unable to find C++ file $(call gb_CxxObject_get_source,$*)) +gb_CxxObject_CxxObject = + # LinkTarget class @@ -85,7 +89,7 @@ $(call gb_LinkTarget_get_clean_target,%) : $(DLLTARGET) \ $(AUXTARGETS)) -define gb_LinkTarget_command_dep +define gb_LinkTarget__command_dep $(call gb_Helper_announce,Collecting dependencies for link $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -95,13 +99,13 @@ $(call gb_Helper_abbreviate_dirs,\ endef $(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(call gb_LinkTarget_get_dep_target,%) - $(call gb_LinkTarget_command_dep,$(call gb_LinkTarget_get_dep_target,$*),$*,$(COBJECTS),$(CXXOBJECTS)) - $(call gb_LinkTarget_command,$@,$*,$(TARGETTYPE_FLAGS) $(LDFLAGS),$(LINKED_LIBS),$(LINKED_STATIC_LIBS),$(CXXOBJECTS),$(COBJECTS)) + $(call gb_LinkTarget__command_dep,$(call gb_LinkTarget_get_dep_target,$*),$*,$(COBJECTS),$(CXXOBJECTS)) + $(call gb_LinkTarget__command,$@,$*,$(TARGETTYPE_FLAGS) $(LDFLAGS),$(LINKED_LIBS),$(LINKED_STATIC_LIBS),$(COBJECTS),$(CXXOBJECTS)) $(call gb_LinkTarget_get_dep_target,%) : $(call gb_LinkTarget_get_headers_target,%) - $(call gb_LinkTarget_command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS)) + $(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS)) -define gb_LinkTarget_get_external_headers_check +define gb_LinkTarget__get_external_headers_check ifneq ($$(SELF),$$*) $$(info LinkTarget $$* not defined: Assuming headers to be there!) endif @@ -110,7 +114,7 @@ $$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touc endef $(call gb_LinkTarget_get_external_headers_target,%) : - $(eval $(gb_LinkTarget_get_external_headers_check)) + $(eval $(gb_LinkTarget__get_external_headers_check)) $(COMMAND) $(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_headers_target,%) @@ -169,6 +173,11 @@ $(call gb_LinkTarget_get_target,$(1)) \ $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $(2) endef +define gb_LinkTarget_set_include_stl +$(call gb_LinkTarget_get_target,$(1)) \ +$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $(2) +endef + define gb_LinkTarget_set_ldflags $(call gb_LinkTarget_get_target,$(1)) : LDFLAGS := $(2) endef diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk index c24b12eb8810..7c25aefc4285 100644 --- a/solenv/gbuild/platform/linux.mk +++ b/solenv/gbuild/platform/linux.mk @@ -117,7 +117,7 @@ gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) # CObject class -define gb_CObject_command +define gb_CObject__command $(call gb_Helper_announce,Compiling $(2) (plain C) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -132,7 +132,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(6)) endef -define gb_CObject_command_dep +define gb_CObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -140,7 +140,7 @@ endef # CxxObject class -define gb_CxxObject_command +define gb_CxxObject__command $(call gb_Helper_announce,Compiling $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -155,7 +155,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(6)) endef -define gb_CxxObject_command_dep +define gb_CxxObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -175,15 +175,15 @@ endif gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) -define gb_LinkTarget_command +define gb_LinkTarget__command $(call gb_Helper_announce,Linking $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(gb_CXX) \ $(3) \ $(patsubst lib%.so,-l%,$(foreach lib,$(4),$(call gb_Library_get_filename,$(lib)))) \ - $(foreach object,$(6),$(call gb_CxxObject_get_target,$(object))) \ - $(foreach object,$(7),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(6),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \ -Wl$(COMMA)--start-group $(foreach lib,$(5),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ -o $(1)) endef @@ -273,7 +273,7 @@ gb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc gb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) -define gb_SrsPartTarget_command_dep +define gb_SrsPartTarget__command_dep $(call gb_Helper_abbreviate_dirs,\ $(gb_GCCP) \ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \ diff --git a/solenv/inc/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 1eb3d94664f8..9004dfb5264c 100644 --- a/solenv/inc/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -125,7 +125,7 @@ gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) # CObject class -define gb_CObject_command +define gb_CObject__command $(call gb_Helper_announce,Compiling $(2) (plain C) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -141,7 +141,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(6)) endef -define gb_CObject_command_dep +define gb_CObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -149,7 +149,7 @@ endef # CxxObject class -define gb_CxxObject_command +define gb_CxxObject__command $(call gb_Helper_announce,Compiling $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ @@ -164,7 +164,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(6)) endef -define gb_CxxObject_command_dep +define gb_CxxObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -183,15 +183,15 @@ endif gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) -define gb_LinkTarget_command +define gb_LinkTarget__command $(call gb_Helper_announce,Linking $(2) ...) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(gb_CXX) \ $(3) \ $(patsubst lib%.so,-l%,$(foreach lib,$(4),$(call gb_Library_get_filename,$(lib)))) \ - $(foreach object,$(6),$(call gb_CxxObject_get_target,$(object))) \ - $(foreach object,$(7),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(6),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \ $(foreach lib,$(5),$(call gb_StaticLibrary_get_target,$(lib))) \ -o $(1)) endef @@ -250,7 +250,7 @@ gb_Library_FILENAMES := $(patsubst ucbhelper:libucbhelper%,ucbhelper:libucbhelpe gb_Library_FILENAMES := $(patsubst jvmfwk:libuno_jvmfwk%,jvmfwk:libjvmfwk%,$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst salhelper:libsalhelper%,salhelper:libuno_salhelper%,$(gb_Library_FILENAMES)) -gb_Library_Library_platform = +gb_Library__Library_platform = # StaticLibrary class @@ -273,7 +273,7 @@ gb_StaticLibrary_FILENAMES := \ gb_Executable_EXT := gb_Executable_TARGETTYPEFLAGS := -gb_Executable_Executable_platform = +gb_Executable__Executable_platform = # SdiTarget class diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 26f022410ea6..004459c77332 100644 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -181,7 +181,7 @@ endef # CObject class -define gb_CObject_command +define gb_CObject__command $(call gb_Helper_announce,Compiling $(2) (plain C) ...) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ @@ -193,7 +193,7 @@ $(call gb_Helper_abbreviate_dirs_native,\ -Fo$(1)" && E=$$($$C) || (echo $$C && echo $$E 1>&2 && false)) endef -define gb_CObject_command_dep +define gb_CObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -201,7 +201,7 @@ endef # CxxObject class -define gb_CxxObject_command +define gb_CxxObject__command $(call gb_Helper_announce,Compiling $(2) ...) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ @@ -213,7 +213,7 @@ $(call gb_Helper_abbreviate_dirs_native,\ -Fo$(1)" && E=$$($$C) || (echo $$C && echo $$E 1>&2 && false)) endef -define gb_CxxObject_command_dep +define gb_CxxObject__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -236,7 +236,7 @@ gb_LinkTarget_INCLUDE :=\ gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) -define gb_LinkTarget_command +define gb_LinkTarget__command $(call gb_Helper_announce,Linking $(2) ...) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ @@ -395,7 +395,7 @@ gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) -define gb_SrsPartTarget_command_dep +define gb_SrsPartTarget__command_dep mkdir -p $(dir $(1)) && \ echo '$(call gb_SrsPartTarget_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef diff --git a/solenv/gbuild/static_library.mk b/solenv/gbuild/static_library.mk index ad197e20a20a..27d0443ef015 100644 --- a/solenv/gbuild/static_library.mk +++ b/solenv/gbuild/static_library.mk @@ -51,11 +51,11 @@ ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS))) $$(info currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS))) $$(error Library $(1) must be registered in $(GBUILDDIR)/libnames.mk) endif -$(call gb_StaticLibrary_StaticLibrary__impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(call gb_StaticLibrary_get_filename,$(1)))) +$(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(call gb_StaticLibrary_get_filename,$(1)))) endef -define gb_StaticLibrary_StaticLibrary__impl +define gb_StaticLibrary__StaticLibrary_impl $(call gb_LinkTarget_LinkTarget,$(2)) $(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_StaticLibrary_TARGETTYPEFLAGS)) $(call gb_LinkTarget_set_defs,$(2)),\ |