duke@435: # stefank@2314: # Copyright (c) 2005, 2010, Oracle and/or its affiliates. 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: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. duke@435: # duke@435: # duke@435: duke@435: # Rules to build gamma launcher, used by vm.make duke@435: phh@1558: sla@2327: LAUNCHER_SCRIPT = hotspot phh@1558: LAUNCHER = gamma duke@435: sla@2327: LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher sla@2327: LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher sla@2327: LAUNCHERFLAGS := $(ARCHFLAG) \ duke@435: -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ sla@2327: -I$(LAUNCHERDIR_SHARE) \ duke@435: -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ sla@2327: -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ sla@2327: -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ duke@435: -DARCH=\"$(LIBARCH)\" \ duke@435: -DGAMMA \ duke@435: -DLAUNCHER_TYPE=\"gamma\" \ sla@2327: -DLINK_INTO_$(LINK_INTO) \ sla@2327: $(TARGET_DEFINES) 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: LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) duke@435: LIBS_LAUNCHER += $(STATIC_STDCXX) $(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.c) 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: sla@2327: LAUNCHER_OUT = launcher duke@435: sla@2327: SUFFIXES += .d duke@435: sla@2327: SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") sla@2327: SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") sla@2327: sla@2327: OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) sla@2327: sla@2327: DEPFILES := $(patsubst %.o,%.d,$(OBJS)) sla@2327: -include $(DEPFILES) sla@2327: sla@2327: $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c sla@2327: $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } sla@2327: $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) sla@2327: sla@2327: $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c sla@2327: $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } sla@2327: $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) sla@2327: sla@2327: $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) sla@2327: $(QUIETLY) echo Linking launcher... sla@2327: $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) sla@2327: $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) sla@2327: $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) sla@2327: sla@2327: $(LAUNCHER): $(LAUNCHER_SCRIPT) sla@2327: sla@2327: $(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script sla@2327: $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ sla@2327: $(QUIETLY) chmod +x $@ sla@2327: