1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/bsd/makefiles/launcher.make Sun Sep 25 16:03:29 2011 -0700 1.3 @@ -0,0 +1,93 @@ 1.4 +# 1.5 +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 +# or visit www.oracle.com if you need additional information or have any 1.24 +# questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# Rules to build gamma launcher, used by vm.make 1.29 + 1.30 + 1.31 +LAUNCHER_SCRIPT = hotspot 1.32 +LAUNCHER = gamma 1.33 + 1.34 +LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher 1.35 +LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher 1.36 +LAUNCHERFLAGS := $(ARCHFLAG) \ 1.37 + -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ 1.38 + -I$(LAUNCHERDIR_SHARE) \ 1.39 + -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ 1.40 + -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ 1.41 + -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ 1.42 + -DARCH=\"$(LIBARCH)\" \ 1.43 + -DGAMMA \ 1.44 + -DLAUNCHER_TYPE=\"gamma\" \ 1.45 + -DLINK_INTO_$(LINK_INTO) \ 1.46 + $(TARGET_DEFINES) 1.47 + 1.48 +ifeq ($(LINK_INTO),AOUT) 1.49 + LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) 1.50 + LAUNCHER_MAPFILE = mapfile_reorder 1.51 + LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) 1.52 + LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) 1.53 + LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) 1.54 +else 1.55 + LAUNCHER.o = launcher.o 1.56 + LFLAGS_LAUNCHER += -L`pwd` 1.57 + LIBS_LAUNCHER += -l$(JVM) $(LIBS) 1.58 +endif 1.59 + 1.60 +LINK_LAUNCHER = $(LINK.c) 1.61 + 1.62 +LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CC/PRE_HOOK) 1.63 +LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK) 1.64 + 1.65 +LAUNCHER_OUT = launcher 1.66 + 1.67 +SUFFIXES += .d 1.68 + 1.69 +SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") 1.70 +SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") 1.71 + 1.72 +OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) 1.73 + 1.74 +DEPFILES := $(patsubst %.o,%.d,$(OBJS)) 1.75 +-include $(DEPFILES) 1.76 + 1.77 +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c 1.78 + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } 1.79 + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) 1.80 + 1.81 +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c 1.82 + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } 1.83 + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) 1.84 + 1.85 +$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) 1.86 + $(QUIETLY) echo Linking launcher... 1.87 + $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) 1.88 + $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) 1.89 + $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) 1.90 + 1.91 +$(LAUNCHER): $(LAUNCHER_SCRIPT) 1.92 + 1.93 +$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script 1.94 + $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ 1.95 + $(QUIETLY) chmod +x $@ 1.96 +