0N/A#
2362N/A# Copyright (c) 2004, 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 building simple launchers
0N/A#
0N/A
4956N/APROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS=1
4956N/A
0N/ABUILDDIR = ..
0N/APACKAGE = launcher
0N/APRODUCT = sun
0N/Ainclude $(BUILDDIR)/common/Defs.gmk
0N/A
0N/A# The PROGRAM and MAIN_CLASS must be defined
0N/Aifndef PROGRAM
0N/A build: no_program
0N/A no_program:
0N/A $(ECHO) "No PROGRAM name defined"
0N/A exit 1
0N/Aendif
0N/Aifndef MAIN_CLASS
0N/A build: no_main
0N/A no_main:
0N/A $(ECHO) "No MAIN_CLASS name defined"
0N/A exit 1
0N/Aendif
0N/A
0N/A# Some tools need the wildcard expansion option
0N/Aifeq ($(PROGRAM),apt)
0N/A WILDCARDS=true
0N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
0N/Aendif
0N/Aifeq ($(PROGRAM),javac)
0N/A WILDCARDS=true
0N/A MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools...
0N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
0N/Aendif
0N/Aifeq ($(PROGRAM),javadoc)
0N/A WILDCARDS=true
0N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
0N/Aendif
0N/Aifeq ($(PROGRAM),javap)
0N/A WILDCARDS=true
0N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
0N/Aendif
0N/Aifeq ($(PROGRAM),javah)
0N/A WILDCARDS=true
0N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
0N/Aendif
0N/Aifeq ($(PROGRAM),serialver)
0N/A WILDCARDS=true
0N/Aendif
0N/A
0N/A# GUI tools need X11
0N/Aifeq ($(PROGRAM),appletviewer)
0N/A GUI_TOOL=true
0N/Aendif
0N/Aifeq ($(PROGRAM),policytool)
0N/A GUI_TOOL=true
0N/Aendif
0N/A
0N/A# SA tools
0N/Aifeq ($(PROGRAM),jstack)
0N/A SA_TOOL=true
4988N/A INFO_PLIST_FILE=Info-privileged.plist
0N/Aendif
0N/Aifeq ($(PROGRAM),jsadebugd)
0N/A SA_TOOL=true
4632N/A INFO_PLIST_FILE=Info-privileged.plist
0N/Aendif
0N/Aifeq ($(PROGRAM),jinfo)
0N/A SA_TOOL=true
4632N/A INFO_PLIST_FILE=Info-privileged.plist
0N/Aendif
0N/Aifeq ($(PROGRAM),jmap)
0N/A SA_TOOL=true
4632N/A INFO_PLIST_FILE=Info-privileged.plist
0N/Aendif
0N/A
0N/A# special idlj launcher
0N/Aifeq ($(PROGRAM),orbd)
0N/A IDLJ_TOOL=true
0N/Aendif
0N/Aifeq ($(PROGRAM),servertool)
0N/A IDLJ_TOOL=true
0N/Aendif
0N/Aifeq ($(PROGRAM),tnameserv)
0N/A IDLJ_TOOL=true
0N/Aendif
0N/A
0N/A# idlj itself only
0N/Aifeq ($(PROGRAM),idlj)
0N/A ifndef STANDALONE_CORBA_WS
0N/A FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
0N/A $(SHARE_SRC)/native/bin/utility.c
0N/A endif
0N/Aendif
0N/A
0N/A# rmic only
0N/Aifeq ($(PROGRAM),rmic)
0N/A ifdef STANDALONE_CORBA_WS
0N/A FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
0N/A $(SHARE_SRC)/native/bin/utility.c
0N/A endif
0N/A WILDCARDS=true
0N/Aendif
0N/A
0N/A# IDLJ_TOOL only uses different source files
0N/Aifeq ($(IDLJ_TOOL),true)
0N/A ifdef STANDALONE_CORBA_WS
0N/A FILES_c = $(SHARE_SRC)/native/bin/idlj.c \
0N/A $(SHARE_SRC)/native/bin/utility.c
0N/A endif
0N/Aendif
0N/A
0N/A# jdb only
0N/Aifeq ($(PROGRAM),jdb)
0N/A # Override the default APP_CLASSPATH to pick up sa-jdi.jar also.
0N/A # Default is defined in src/[solaris,windows]/bin/java_md.h
0N/A # PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c
0N/A # SA is currently not available on windows (for any ARCH), or linux-ia64:
0N/A ifneq ($(ARCH), ia64)
1777N/A JDB_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
1777N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)'
0N/A endif
0N/Aendif
0N/A
0N/A# jconsole only
0N/Aifeq ($(PROGRAM),jconsole)
1777N/A JCONSOLE_CLASSPATH = { "/lib/jconsole.jar", "/lib/tools.jar", "/classes" }
1777N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)'
0N/A ifeq ($(PLATFORM), windows)
0N/A OTHER_CPPFLAGS += -DJAVAW
0N/A LDLIBS_COMMON += user32.lib
0N/A MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer
0N/A endif
0N/Aendif
0N/A
0N/A# GUI tools
0N/Aifeq ($(GUI_TOOL),true)
0N/A ifneq ($(PLATFORM), windows)
4825N/A ifneq ($(PLATFORM), macosx)
4825N/A # Anything with a GUI needs X11 to be linked in.
4825N/A OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11
4825N/A endif
0N/A endif
0N/Aendif
0N/A
0N/A# SA tools need special app classpath
0N/Aifeq ($(SA_TOOL),true)
1777N/A SA_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
1777N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)'
0N/Aendif
0N/A
0N/A# Wildcards
0N/Aifeq ($(WILDCARDS),true)
0N/A OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
0N/Aendif
0N/A
0N/A# Always tell native code what the main class is
1777N/AOTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"'
0N/A
0N/A# Construct initializer for initial arguments to java
0N/AALL_ARGS = -J-ms8m $(MAIN_JAVA_ARGS) $(MAIN_CLASS) $(MAIN_ARGS)
1777N/AJAVA_ARGS = { $(ALL_ARGS:%="%",) }
0N/A
0N/A# Always report launcher info
0N/Abuild: launcher_info
0N/A
0N/A# Print info macro
0N/Adefine printLauncherSetting
0N/Aif [ "$2" != "" ] ; then $(PRINTF) "%-16s %s\n" "$1:" "$2"; fi
0N/Aendef
0N/A
0N/A# Report basic information about this launcher
0N/Alauncher_info:
0N/A @$(ECHO) "========================================================="
0N/A @$(call printLauncherSetting,LAUNCHER,$(PROGRAM))
0N/A @$(call printLauncherSetting,MAIN_CLASS,$(MAIN_CLASS))
0N/A @$(call printLauncherSetting,MAIN_JAVA_ARGS,$(MAIN_JAVA_ARGS))
0N/A @$(call printLauncherSetting,MAIN_ARGS,$(MAIN_ARGS))
0N/A @$(call printLauncherSetting,ALL_ARGS,$(ALL_ARGS))
0N/A @$(ECHO) "========================================================="
0N/A
0N/A#
0N/A# Rules for building a program
0N/A#
0N/Ainclude $(BUILDDIR)/common/Program.gmk
0N/A