duke@435: # duke@435: # Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # duke@435: # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@435: # CA 95054 USA or visit www.sun.com if you need additional information or duke@435: # have any questions. duke@435: # duke@435: # duke@435: duke@435: # Rules to build gamma launcher, used by vm.make duke@435: duke@435: # gamma[_g]: launcher duke@435: LAUNCHER = gamma$(G_SUFFIX) duke@435: duke@435: LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher duke@435: LAUNCHERFLAGS = $(ARCHFLAG) \ duke@435: -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ duke@435: -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ duke@435: -DARCH=\"$(LIBARCH)\" \ duke@435: -DGAMMA \ duke@435: -DLAUNCHER_TYPE=\"gamma\" \ duke@435: -DLINK_INTO_$(LINK_INTO) duke@435: duke@435: ifeq ($(LINK_INTO),AOUT) duke@435: LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) duke@435: LAUNCHER_MAPFILE = mapfile_reorder duke@435: LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) duke@435: LIBS_LAUNCHER += $(LIBS) duke@435: else duke@435: LAUNCHER.o = launcher.o duke@435: LFLAGS_LAUNCHER += -L `pwd` duke@435: LIBS_LAUNCHER += -l$(JVM) $(LIBS) duke@435: endif duke@435: duke@435: LINK_LAUNCHER = $(LINK.CC) duke@435: duke@435: LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CC/PRE_HOOK) duke@435: LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK) duke@435: duke@435: ifeq ("${Platform_compiler}", "sparcWorks") duke@435: # Enable the following LAUNCHERFLAGS addition if you need to compare the duke@435: # built ELF objects. duke@435: # duke@435: # The -g option makes static data global and the "-W0,-noglobal" duke@435: # option tells the compiler to not globalize static data using a unique duke@435: # globalization prefix. Instead force the use of a static globalization duke@435: # prefix based on the source filepath so the objects from two identical duke@435: # compilations are the same. duke@435: # duke@435: # Note: The blog says to use "-W0,-xglobalstatic", but that doesn't duke@435: # seem to work. I got "-W0,-noglobal" from Kelly and that works. duke@435: #LAUNCHERFLAGS += -W0,-noglobal duke@435: endif # Platform_compiler == sparcWorks duke@435: duke@435: launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c duke@435: $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS) duke@435: duke@435: launcher.c: duke@435: @echo Generating $@ duke@435: $(QUIETLY) { \ duke@435: echo '#define debug launcher_debug'; \ duke@435: echo '#include "java.c"'; \ duke@435: echo '#include "java_md.c"'; \ duke@435: } > $@ duke@435: duke@435: $(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) duke@435: $(QUIETLY) \ duke@435: case "$(CFLAGS_BROWSE)" in \ duke@435: -sbfast|-xsbfast) \ duke@435: ;; \ duke@435: *) \ duke@435: echo Linking launcher...; \ duke@435: $(LINK_LAUNCHER/PRE_HOOK) \ duke@435: $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ duke@435: $(LINK_LAUNCHER/POST_HOOK) \ duke@435: ;; \ duke@435: esac