# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license notice: # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed # with this work for additional information regarding copyright # ownership. The ASF licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . #
# Library class
# defined globally in TargetLocations.mk # gb_Library_DLLDIR := $(WORKDIR)/LinkTarget/Library # defined by platform # gb_Library_DEFS # gb_Library_ILIBFILENAMES # gb_Library_FILENAMES # gb_Library_Library_platform
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
.PHONY : $(WORKDIR)/Clean/Library/%
$(WORKDIR)/Clean/Library/% :
$(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_Library_get_exports_target,$*) \
$(AUXTARGETS))
# Note: there may be targets in 3 different directories: the library itself, # the exports target (and other misc. MSVC files) (always in # $(WORKDIR)/LinkTarget), and the import library, which may be in SDK; # the first 2 are always created by gb_LinkTarget_LinkTarget # Also: the directory dependencies must be on the headers_target because # MSVC will write a PDB file when compiling objects. # # call gb_Library__Library_impl,library,linktarget define gb_Library__Library_impl
$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1),$(call gb_Library_get_layer,$(1)))
$(call gb_LinkTarget_set_targettype,$(2),Library)
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
$(call gb_LinkTarget_add_defs,$(2),\
$(gb_Library_DEFS) \
)
$(call gb_Library_get_exports_target,$(1)) : $(call gb_Library_get_target,$(1))
$(call gb_LinkTarget_get_headers_target,$(2)) : \
| $(dir $(call gb_Library_get_ilib_target,$(1))).dir
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_Library_Library_platform,$(1),$(2),$(call gb_Library_get_ilib_target,$(1)))
# we actually (ab)use ILIBTARGET here to store the unversioned symlink - # it serves a similar purpose to an MSVC import library, as input for linker # call gb_Library__add_soversion_link,library,linkname define gb_Library__add_soversion_link
$(call gb_LinkTarget_set_ilibtarget,$(call gb_Library_get_linktarget,$(1)),$(2))
# for libraries that maintain stable ABI: set SOVERSION and version script # $(call gb_Library_set_soversion_script,versionscript) define gb_Library_set_soversion_script
$(if $(2),,$(call gb_Output_error,gb_Library_set_soversion_script: no script))
$(if $(3),$(call gb_Output_error,gb_Library_set_soversion_script: too many arguments))
$(call gb_Library__set_soversion_script_platform,$(1),$(2)) endef
# The dependency from workdir component target to outdir library should ensure # that gb_CppunitTest_use_component can transitively depend on the library. # But the component target also must be delivered; use the target # gb_Library_get_exports_target for that purpose, since it is already # the "final" target of the Library... # # call gb_Library_set_componentfile,library,componentfile,rdb define gb_Library_set_componentfile
$(call gb_ComponentTarget_ComponentTarget,$(2),\
$(call gb_Library__get_componentprefix,$(gb_Library__get_name)),\
$(call gb_Library_get_runtime_filename,$(gb_Library__get_name)),$(3))
$(call gb_Library_get_exports_target,$(gb_Library__get_name)) :| \
$(call gb_ComponentTarget_get_target,$(2))
$(call gb_ComponentTarget_get_target,$(2)) :| \
$(call gb_Library_get_target,$(gb_Library__get_name))
$(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \
$(call gb_ComponentTarget_get_clean_target,$(2))
$(if $(call gb_Library__get_component,$(1)),$(error Can't have multiple component files per library))
$(eval $(call gb_Library__get_component_var,$(1)) = $(2))
endef
# The implid is appended to the component file, separated by a dot. # # call gb_Library_add_componentimpl,library,implid define gb_Library_add_componentimpl
$(if $(call gb_Library__get_component,$(1)),, \
$(error Set gb_Library_set_componentfile before using gb_Library_add_componentimpl))
$(call gb_ComponentTarget_add_componentimpl,$(call gb_Library__get_component,$(1)),$(2))
# The \d gets turned into a dollar sign by a $(subst) call in # gb_ComponentTarget__command in ComponentTarget.mk. As far as I # understand, there is nothing magic to it, it is not some # Make/awk/sed/whatever syntax.
# forward the call to the gb_LinkTarget implementation # (note: because the function name is in $(1), the other args are shifted by 1) define gb_Library__forward_to_Linktarget
$(call gb_LinkTarget_$(subst gb_Library_,,$(1)),$(call gb_Library_get_linktarget,$(2)),$(3),$(4),Library_$(2))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.