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