0N/A#
2362N/A# Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
2362N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
2362N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Makefile for linking with mapfiles.
0N/A#
0N/A# NOTE: Not using a mapfile will expose all your extern functions and
0N/A# extern data symbols as part of your interface, so unless your
0N/A# extern names are safe from being mistaken as names from other
0N/A# libraries, you better use a mapfile, or use a unique naming
0N/A# convention on all your extern symbols.
0N/A#
0N/A# The mapfile will establish versioning by defining the exported interface.
0N/A#
0N/A# The mapfile can also force certain .o files or elf sections into the
0N/A# the different segments of the resulting library/program image.
0N/A#
0N/A# The macro FILES_m can contain any number of mapfiles.
0N/A#
0N/A
0N/A# Always make sure 'all' is the default rule
0N/Amapfile_default_rule: all
0N/A
0N/Aifeq ($(PLATFORM), solaris)
0N/A
0N/Aifeq ($(VARIANT), OPT)
0N/A # OPT build MUST have a mapfile?
0N/A ifndef FILES_m
0N/A FILES_m = mapfile-vers
0N/A endif
0N/A
0N/A # If we are re-ordering functions in this solaris library, we need to make
3983N/A # sure that -xF is added to the compile lines. This option is critical and
3983N/A # enables the functions to be reordered.
0N/A ifdef FILES_reorder
0N/A CFLAGS_OPT += -xF
0N/A CXXFLAGS_OPT += -xF
0N/A endif
0N/A
0N/AINIT += $(TEMPDIR)/mapfile-vers
0N/A
0N/A$(TEMPDIR)/mapfile-vers : $(FILES_m) $(FILES_reorder)
0N/A $(prep-target)
0N/A $(CAT) $(FILES_m) > $@
0N/A ifdef FILES_reorder
0N/A $(SED) -e 's=OUTPUTDIR=$(OUTPUTDIR)=' $(FILES_reorder) >> $@
0N/A endif
0N/Aendif # VARIANT
0N/A
0N/Aifndef LDNOMAP
0N/A LDMAPFLAGS_OPT = -M$(TEMPDIR)/mapfile-vers
0N/A LDMAPFLAGS_DBG = $(FILES_m:%=-M%)
0N/Aendif
0N/A
0N/Aendif # PLATFORM
0N/A
0N/Aifeq ($(PLATFORM), linux)
0N/A
0N/Aifeq ($(VARIANT), OPT)
0N/A # OPT build MUST have a mapfile?
0N/A ifndef FILES_m
0N/A FILES_m = mapfile-vers
0N/A endif
0N/Aendif # VARIANT
0N/A
0N/Aifndef LDNOMAP
0N/A LDMAPFLAGS_OPT = $(FILES_m:%=-Xlinker -version-script=%)
0N/A LDMAPFLAGS_DBG = $(FILES_m:%=-Xlinker -version-script=%)
0N/Aendif
0N/A
0N/Aendif # PLATFORM
0N/A
0N/ALDFLAGS_OPT += $(LDMAPFLAGS_OPT)
0N/ALDFLAGS_DBG += $(LDMAPFLAGS_DBG)
0N/A