xref: /aoo41x/main/solenv/gbuild/templates/Library.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2011 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# MODULE is the name of the module the makefile is located in
29
30# declare a library
31# LIB is the name of the library as it is found in Repository.mk
32$(eval $(call gb_Library_Library,LIB))
33
34# declare packages that will be delivered before compilation of LIB
35# learn more about TYPE in the Package.mk template
36$(eval $(call gb_Library_add_package_headers,LIB,MODULE_TYPE))
37
38# for platforms supporting PCH: declare the location of the pch file
39# this is the name of the cxx file (without extension)
40$(eval $(call gb_Library_add_precompiled_header,LIB,$(SRCDIR)/MODULE/PCH_FILE))
41
42# in case UNO services are exported: declare location of component file
43$(eval $(call gb_Library_set_componentfile,LIB,MODULE/COMPONENT_FILE))
44
45# add any additional include paths for this library here
46$(eval $(call gb_Library_set_include,LIB,\
47	$$(INCLUDE) \
48))
49
50# add any additional definitions to be set for compilation here
51# (e.g. -DLIB_DLLIMPLEMENTATION)
52$(eval $(call gb_Library_set_defs,LIB,\
53	$$(DEFS) \
54))
55
56# add libraries to be linked to LIB; again these names need to be given as
57# specified in Repository.mk
58$(eval $(call gb_Library_add_linked_libs,LIB,\
59    $(gb_STDLIBS) \
60))
61
62# add all source files that shall be compiled with exceptions enabled
63# the name is relative to $(SRCROOT) and must not contain an extension
64$(eval $(call gb_Library_add_exception_objects,LIB,\
65))
66
67# in case sdi files need to be processed: declare "root" (main) sdi target and sdi header target
68# "ROOT_SDI_FILE" is the file that is handed over to svidl (all other sdi files are included in the root file)
69$(eval $(call gb_Library_add_sdi_headers,LIB,MODULE/sdi/ROOT_SDI_FILE))
70$(eval $(call gb_SdiTarget_SdiTarget,MODULE/sdi/ROOT_SDI_FILE,MODULE/sdi/LIB))
71
72# add any additional include paths for sdi processing here
73$(eval $(call gb_SdiTarget_set_include,MODULE/sdi/ROOT_SDI_FILE,\
74	$$(INCLUDE) \
75))
76
77# this is an example how files can be added that require special compiler settings, e.g. building without optimizing
78ifeq ($(OS),WNT)
79$(eval $(call gb_Library_add_cxxobjects,LIB,\
80    MODULE/source/foo/bar \
81    , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
82))
83
84endif
85
86# vim: set noet sw=4 ts=4:
87