Makefile.launcher revision 2362
3N/A#
3N/A# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
3N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3N/A#
3N/A# This code is free software; you can redistribute it and/or modify it
3N/A# under the terms of the GNU General Public License version 2 only, as
3N/A# published by the Free Software Foundation. Oracle designates this
3N/A# particular file as subject to the "Classpath" exception as provided
3N/A# by Oracle in the LICENSE file that accompanied this code.
3N/A#
3N/A# This code is distributed in the hope that it will be useful, but WITHOUT
3N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3N/A# version 2 for more details (a copy is included in the LICENSE file that
3N/A# accompanied this code).
3N/A#
3N/A# You should have received a copy of the GNU General Public License version
3N/A# 2 along with this work; if not, write to the Free Software Foundation,
873N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3N/A#
3N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3N/A# or visit www.oracle.com if you need additional information or have any
3N/A# questions.
3N/A#
765N/A
3N/A#
1182N/A# Makefile for building simple launchers
3N/A#
1182N/A
1121N/ABUILDDIR = ..
1121N/APACKAGE = launcher
1121N/APRODUCT = sun
1121N/Ainclude $(BUILDDIR)/common/Defs.gmk
1558N/A
3N/A# The PROGRAM and MAIN_CLASS must be defined
157N/Aifndef PROGRAM
3N/A build: no_program
3N/A no_program:
1121N/A $(ECHO) "No PROGRAM name defined"
128N/A exit 1
3N/Aendif
157N/Aifndef MAIN_CLASS
1689N/A build: no_main
1689N/A no_main:
3N/A $(ECHO) "No MAIN_CLASS name defined"
3N/A exit 1
1689N/Aendif
3N/A
1183N/A# Some tools need the wildcard expansion option
1182N/Aifeq ($(PROGRAM),apt)
1182N/A WILDCARDS=true
1182N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
1182N/Aendif
1182N/Aifeq ($(PROGRAM),javac)
1182N/A WILDCARDS=true
1191N/A MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools...
1182N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
1182N/Aendif
1182N/Aifeq ($(PROGRAM),javadoc)
1182N/A WILDCARDS=true
1182N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
1182N/Aendif
1182N/Aifeq ($(PROGRAM),javap)
1182N/A WILDCARDS=true
1182N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
1182N/Aendif
1182N/Aifeq ($(PROGRAM),javah)
1182N/A WILDCARDS=true
1183N/A NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
1182N/Aendif
1182N/Aifeq ($(PROGRAM),serialver)
3N/A WILDCARDS=true
3N/Aendif
3N/A
3N/A# GUI tools need X11
3N/Aifeq ($(PROGRAM),appletviewer)
3N/A GUI_TOOL=true
157N/Aendif
1177N/Aifeq ($(PROGRAM),policytool)
3N/A GUI_TOOL=true
3N/Aendif
1121N/A
1121N/A# SA tools
3N/Aifeq ($(PROGRAM),jstack)
3N/A SA_TOOL=true
3N/Aendif
128N/Aifeq ($(PROGRAM),jsadebugd)
3N/A SA_TOOL=true
1183N/Aendif
3N/Aifeq ($(PROGRAM),jinfo)
3N/A SA_TOOL=true
3N/Aendif
3N/Aifeq ($(PROGRAM),jmap)
3N/A SA_TOOL=true
3N/Aendif
3N/A
3N/A# special idlj launcher
3N/Aifeq ($(PROGRAM),orbd)
3N/A IDLJ_TOOL=true
3N/Aendif
3N/Aifeq ($(PROGRAM),servertool)
3N/A IDLJ_TOOL=true
3N/Aendif
3N/Aifeq ($(PROGRAM),tnameserv)
3N/A IDLJ_TOOL=true
3N/Aendif
3N/A
3N/A# idlj itself only
3N/Aifeq ($(PROGRAM),idlj)
3N/A ifndef STANDALONE_CORBA_WS
3N/A FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
3N/A $(SHARE_SRC)/native/bin/utility.c
3N/A endif
3N/Aendif
3N/A
3N/A# rmic only
3N/Aifeq ($(PROGRAM),rmic)
3N/A ifdef STANDALONE_CORBA_WS
3N/A FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
3N/A $(SHARE_SRC)/native/bin/utility.c
3N/A endif
3N/A WILDCARDS=true
3N/Aendif
3N/A
3N/A# IDLJ_TOOL only uses different source files
3N/Aifeq ($(IDLJ_TOOL),true)
3N/A ifdef STANDALONE_CORBA_WS
3N/A FILES_c = $(SHARE_SRC)/native/bin/idlj.c \
3N/A $(SHARE_SRC)/native/bin/utility.c
3N/A endif
3N/Aendif
3N/A
3N/A# jdb only
3N/Aifeq ($(PROGRAM),jdb)
896N/A # Override the default APP_CLASSPATH to pick up sa-jdi.jar also.
896N/A # Default is defined in src/[solaris,windows]/bin/java_md.h
896N/A # PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c
896N/A # SA is currently not available on windows (for any ARCH), or linux-ia64:
896N/A ifneq ($(ARCH), ia64)
3N/A JDB_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
3N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)'
3N/A endif
3N/Aendif
3N/A
3N/A# jconsole only
3N/Aifeq ($(PROGRAM),jconsole)
3N/A JCONSOLE_CLASSPATH = { "/lib/jconsole.jar", "/lib/tools.jar", "/classes" }
3N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)'
3N/A ifeq ($(PLATFORM), windows)
896N/A OTHER_CPPFLAGS += -DJAVAW
3N/A LDLIBS_COMMON += user32.lib
3N/A MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer
3N/A endif
3N/Aendif
3N/A
3N/A# GUI tools
3N/Aifeq ($(GUI_TOOL),true)
3N/A ifneq ($(PLATFORM), windows)
3N/A # Anything with a GUI needs X11 to be linked in.
3N/A OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11
3N/A endif
3N/Aendif
3N/A
3N/A# SA tools need special app classpath
3N/Aifeq ($(SA_TOOL),true)
3N/A SA_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
765N/A OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)'
765N/Aendif
115N/A
1183N/A# Wildcards
157N/Aifeq ($(WILDCARDS),true)
338N/A OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
3N/Aendif
115N/A
3N/A# Always tell native code what the main class is
3N/AOTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"'
3N/A
3N/A# Construct initializer for initial arguments to java
1689N/AALL_ARGS = -J-ms8m $(MAIN_JAVA_ARGS) $(MAIN_CLASS) $(MAIN_ARGS)
1689N/AJAVA_ARGS = { $(ALL_ARGS:%="%",) }
338N/A
1689N/A# Always report launcher info
1689N/Abuild: launcher_info
3N/A
3N/A# Print info macro
115N/Adefine printLauncherSetting
115N/Aif [ "$2" != "" ] ; then $(PRINTF) "%-16s %s\n" "$1:" "$2"; fi
3N/Aendef
3N/A
3N/A# Report basic information about this launcher
157N/Alauncher_info:
157N/A @$(ECHO) "========================================================="
157N/A @$(call printLauncherSetting,LAUNCHER,$(PROGRAM))
3N/A @$(call printLauncherSetting,MAIN_CLASS,$(MAIN_CLASS))
338N/A @$(call printLauncherSetting,MAIN_JAVA_ARGS,$(MAIN_JAVA_ARGS))
157N/A @$(call printLauncherSetting,MAIN_ARGS,$(MAIN_ARGS))
157N/A @$(call printLauncherSetting,ALL_ARGS,$(ALL_ARGS))
157N/A @$(ECHO) "========================================================="
157N/A
157N/A#
157N/A# Rules for building a program
157N/A#
157N/Ainclude $(BUILDDIR)/common/Program.gmk
157N/A
157N/A