source: trunk/openjdk/jdk/make/launchers/Makefile.launcher

Last change on this file was 278, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b22 from branches/vendor/oracle.

File size: 5.3 KB
Line 
1#
2# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26#
27# Makefile for building simple launchers
28#
29
30BUILDDIR = ..
31PACKAGE = launcher
32PRODUCT = sun
33include $(BUILDDIR)/common/Defs.gmk
34
35# The PROGRAM and MAIN_CLASS must be defined
36ifndef PROGRAM
37 build: no_program
38 no_program:
39 $(ECHO) "No PROGRAM name defined"
40 exit 1
41endif
42ifndef MAIN_CLASS
43 build: no_main
44 no_main:
45 $(ECHO) "No MAIN_CLASS name defined"
46 exit 1
47endif
48
49# Some tools need the wildcard expansion option
50ifeq ($(PROGRAM),apt)
51 WILDCARDS=true
52endif
53ifeq ($(PROGRAM),javac)
54 WILDCARDS=true
55 MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools...
56endif
57ifeq ($(PROGRAM),javadoc)
58 WILDCARDS=true
59endif
60ifeq ($(PROGRAM),javap)
61 WILDCARDS=true
62endif
63ifeq ($(PROGRAM),javah)
64 WILDCARDS=true
65endif
66ifeq ($(PROGRAM),serialver)
67 WILDCARDS=true
68endif
69
70# GUI tools need X11
71ifeq ($(PROGRAM),appletviewer)
72 GUI_TOOL=true
73endif
74ifeq ($(PROGRAM),policytool)
75 GUI_TOOL=true
76endif
77
78# SA tools
79ifeq ($(PROGRAM),jstack)
80 SA_TOOL=true
81endif
82ifeq ($(PROGRAM),jsadebugd)
83 SA_TOOL=true
84endif
85ifeq ($(PROGRAM),jinfo)
86 SA_TOOL=true
87endif
88ifeq ($(PROGRAM),jmap)
89 SA_TOOL=true
90endif
91
92# special idlj launcher
93ifeq ($(PROGRAM),orbd)
94 IDLJ_TOOL=true
95endif
96ifeq ($(PROGRAM),servertool)
97 IDLJ_TOOL=true
98endif
99ifeq ($(PROGRAM),tnameserv)
100 IDLJ_TOOL=true
101endif
102
103# idlj itself only
104ifeq ($(PROGRAM),idlj)
105 ifndef STANDALONE_CORBA_WS
106 FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
107 $(SHARE_SRC)/native/bin/utility.c
108 endif
109endif
110
111# rmic only
112ifeq ($(PROGRAM),rmic)
113 ifdef STANDALONE_CORBA_WS
114 FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \
115 $(SHARE_SRC)/native/bin/utility.c
116 endif
117 WILDCARDS=true
118endif
119
120# IDLJ_TOOL only uses different source files
121ifeq ($(IDLJ_TOOL),true)
122 ifdef STANDALONE_CORBA_WS
123 FILES_c = $(SHARE_SRC)/native/bin/idlj.c \
124 $(SHARE_SRC)/native/bin/utility.c
125 endif
126endif
127
128# jdb only
129ifeq ($(PROGRAM),jdb)
130 # Override the default APP_CLASSPATH to pick up sa-jdi.jar also.
131 # Default is defined in src/[solaris,windows]/bin/java_md.h
132 # PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c
133 # SA is currently not available on windows (for any ARCH), or linux-ia64:
134 ifneq ($(ARCH), ia64)
135 JDB_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
136 OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)'
137 endif
138endif
139
140# jconsole only
141ifeq ($(PROGRAM),jconsole)
142 JCONSOLE_CLASSPATH = { "/lib/jconsole.jar", "/lib/tools.jar", "/classes" }
143 OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)'
144 ifeq ($(PLATFORM), windows)
145 OTHER_CPPFLAGS += -DJAVAW
146 LDLIBS_COMMON += user32.lib
147 MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer
148 endif
149 ifeq ($(PLATFORM), os2)
150 OTHER_CPPFLAGS += -DJAVAW
151 MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer
152 endif
153endif
154
155# GUI tools
156ifeq ($(GUI_TOOL),true)
157 ifneq ($(filter-out windows os2, $(PLATFORM)),)
158 # Anything with a GUI needs X11 to be linked in.
159 OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11
160 endif
161endif
162
163# SA tools need special app classpath
164ifeq ($(SA_TOOL),true)
165 SA_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
166 OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)'
167endif
168
169# Wildcards
170ifeq ($(WILDCARDS),true)
171 OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
172endif
173
174# Always tell native code what the main class is
175OTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"'
176
177# Construct initializer for initial arguments to java
178ALL_ARGS = -J-ms8m $(MAIN_JAVA_ARGS) $(MAIN_CLASS) $(MAIN_ARGS)
179JAVA_ARGS = { $(ALL_ARGS:%="%",) }
180
181# Always report launcher info
182build: launcher_info
183
184# Print info macro
185define printLauncherSetting
186if [ "$2" != "" ] ; then $(PRINTF) "%-16s %s\n" "$1:" "$2"; fi
187endef
188
189# Report basic information about this launcher
190launcher_info:
191 @$(ECHO) "========================================================="
192 @$(call printLauncherSetting,LAUNCHER,$(PROGRAM))
193 @$(call printLauncherSetting,MAIN_CLASS,$(MAIN_CLASS))
194 @$(call printLauncherSetting,MAIN_JAVA_ARGS,$(MAIN_JAVA_ARGS))
195 @$(call printLauncherSetting,MAIN_ARGS,$(MAIN_ARGS))
196 @$(call printLauncherSetting,ALL_ARGS,$(ALL_ARGS))
197 @$(ECHO) "========================================================="
198
199#
200# Rules for building a program
201#
202include $(BUILDDIR)/common/Program.gmk
203
Note: See TracBrowser for help on using the repository browser.