author | jiangli |
Thu, 26 Jul 2012 17:24:31 -0400 | |
changeset 13311 | 71effe5a1069 |
parent 12548 | 386de6da1ff0 |
child 14994 | a544909d1d1c |
permissions | -rw-r--r-- |
2 | 1 |
# |
11826 | 2 |
# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
# |
|
5506 | 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. |
|
2 | 24 |
# |
25 |
||
26 |
# |
|
27 |
# Makefile for building simple launchers |
|
28 |
# |
|
29 |
||
12427 | 30 |
PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS=1 |
31 |
||
2 | 32 |
BUILDDIR = .. |
33 |
PACKAGE = launcher |
|
34 |
PRODUCT = sun |
|
35 |
include $(BUILDDIR)/common/Defs.gmk |
|
36 |
||
37 |
# The PROGRAM and MAIN_CLASS must be defined |
|
38 |
ifndef PROGRAM |
|
39 |
build: no_program |
|
40 |
no_program: |
|
41 |
$(ECHO) "No PROGRAM name defined" |
|
42 |
exit 1 |
|
43 |
endif |
|
44 |
ifndef MAIN_CLASS |
|
45 |
build: no_main |
|
46 |
no_main: |
|
47 |
$(ECHO) "No MAIN_CLASS name defined" |
|
48 |
exit 1 |
|
49 |
endif |
|
50 |
||
51 |
# Some tools need the wildcard expansion option |
|
52 |
ifeq ($(PROGRAM),javac) |
|
53 |
WILDCARDS=true |
|
54 |
MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools... |
|
55 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
56 |
endif |
|
57 |
ifeq ($(PROGRAM),javadoc) |
|
58 |
WILDCARDS=true |
|
59 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
60 |
endif |
|
61 |
ifeq ($(PROGRAM),javap) |
|
62 |
WILDCARDS=true |
|
63 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
64 |
endif |
|
65 |
ifeq ($(PROGRAM),javah) |
|
66 |
WILDCARDS=true |
|
67 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
68 |
endif |
|
69 |
ifeq ($(PROGRAM),serialver) |
|
70 |
WILDCARDS=true |
|
71 |
endif |
|
72 |
||
73 |
# GUI tools need X11 |
|
74 |
ifeq ($(PROGRAM),appletviewer) |
|
75 |
GUI_TOOL=true |
|
76 |
endif |
|
77 |
ifeq ($(PROGRAM),policytool) |
|
78 |
GUI_TOOL=true |
|
79 |
endif |
|
80 |
||
81 |
# SA tools |
|
82 |
ifeq ($(PROGRAM),jstack) |
|
83 |
SA_TOOL=true |
|
12548
386de6da1ff0
7163524: Add SecTaskAccess attribute to jstack [macosx]
sla
parents:
12427
diff
changeset
|
84 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 85 |
endif |
86 |
ifeq ($(PROGRAM),jsadebugd) |
|
87 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
88 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 89 |
endif |
90 |
ifeq ($(PROGRAM),jinfo) |
|
91 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
92 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 93 |
endif |
94 |
ifeq ($(PROGRAM),jmap) |
|
95 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
96 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 97 |
endif |
98 |
||
99 |
# special idlj launcher |
|
100 |
ifeq ($(PROGRAM),orbd) |
|
101 |
IDLJ_TOOL=true |
|
102 |
endif |
|
103 |
ifeq ($(PROGRAM),servertool) |
|
104 |
IDLJ_TOOL=true |
|
105 |
endif |
|
106 |
ifeq ($(PROGRAM),tnameserv) |
|
107 |
IDLJ_TOOL=true |
|
108 |
endif |
|
109 |
||
110 |
# idlj itself only |
|
111 |
ifeq ($(PROGRAM),idlj) |
|
112 |
ifndef STANDALONE_CORBA_WS |
|
113 |
FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \ |
|
114 |
$(SHARE_SRC)/native/bin/utility.c |
|
115 |
endif |
|
116 |
endif |
|
117 |
||
118 |
# rmic only |
|
119 |
ifeq ($(PROGRAM),rmic) |
|
120 |
ifdef STANDALONE_CORBA_WS |
|
121 |
FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \ |
|
122 |
$(SHARE_SRC)/native/bin/utility.c |
|
123 |
endif |
|
124 |
WILDCARDS=true |
|
125 |
endif |
|
126 |
||
127 |
# IDLJ_TOOL only uses different source files |
|
128 |
ifeq ($(IDLJ_TOOL),true) |
|
129 |
ifdef STANDALONE_CORBA_WS |
|
130 |
FILES_c = $(SHARE_SRC)/native/bin/idlj.c \ |
|
131 |
$(SHARE_SRC)/native/bin/utility.c |
|
132 |
endif |
|
133 |
endif |
|
134 |
||
135 |
# jdb only |
|
136 |
ifeq ($(PROGRAM),jdb) |
|
137 |
# Override the default APP_CLASSPATH to pick up sa-jdi.jar also. |
|
138 |
# Default is defined in src/[solaris,windows]/bin/java_md.h |
|
139 |
# PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c |
|
140 |
# SA is currently not available on windows (for any ARCH), or linux-ia64: |
|
141 |
ifneq ($(ARCH), ia64) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
142 |
JDB_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" } |
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
143 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)' |
2 | 144 |
endif |
145 |
endif |
|
146 |
||
147 |
# jconsole only |
|
148 |
ifeq ($(PROGRAM),jconsole) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
149 |
JCONSOLE_CLASSPATH = { "/lib/jconsole.jar", "/lib/tools.jar", "/classes" } |
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
150 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)' |
2 | 151 |
ifeq ($(PLATFORM), windows) |
152 |
OTHER_CPPFLAGS += -DJAVAW |
|
153 |
LDLIBS_COMMON += user32.lib |
|
154 |
MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer |
|
155 |
endif |
|
156 |
endif |
|
157 |
||
158 |
# GUI tools |
|
159 |
ifeq ($(GUI_TOOL),true) |
|
160 |
ifneq ($(PLATFORM), windows) |
|
12280
7e17a63793ca
7150516: [macosx] appletviewer shouldn't link against libX11 on the Mac
anthony
parents:
12047
diff
changeset
|
161 |
ifneq ($(PLATFORM), macosx) |
7e17a63793ca
7150516: [macosx] appletviewer shouldn't link against libX11 on the Mac
anthony
parents:
12047
diff
changeset
|
162 |
# Anything with a GUI needs X11 to be linked in. |
7e17a63793ca
7150516: [macosx] appletviewer shouldn't link against libX11 on the Mac
anthony
parents:
12047
diff
changeset
|
163 |
OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 |
7e17a63793ca
7150516: [macosx] appletviewer shouldn't link against libX11 on the Mac
anthony
parents:
12047
diff
changeset
|
164 |
endif |
2 | 165 |
endif |
166 |
endif |
|
167 |
||
168 |
# SA tools need special app classpath |
|
169 |
ifeq ($(SA_TOOL),true) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
170 |
SA_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" } |
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
171 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)' |
2 | 172 |
endif |
173 |
||
174 |
# Wildcards |
|
175 |
ifeq ($(WILDCARDS),true) |
|
176 |
OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS |
|
177 |
endif |
|
178 |
||
179 |
# Always tell native code what the main class is |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
180 |
OTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"' |
2 | 181 |
|
182 |
# Construct initializer for initial arguments to java |
|
183 |
ALL_ARGS = -J-ms8m $(MAIN_JAVA_ARGS) $(MAIN_CLASS) $(MAIN_ARGS) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
184 |
JAVA_ARGS = { $(ALL_ARGS:%="%",) } |
2 | 185 |
|
186 |
# Always report launcher info |
|
187 |
build: launcher_info |
|
188 |
||
189 |
# Print info macro |
|
190 |
define printLauncherSetting |
|
191 |
if [ "$2" != "" ] ; then $(PRINTF) "%-16s %s\n" "$1:" "$2"; fi |
|
192 |
endef |
|
193 |
||
194 |
# Report basic information about this launcher |
|
195 |
launcher_info: |
|
196 |
@$(ECHO) "=========================================================" |
|
197 |
@$(call printLauncherSetting,LAUNCHER,$(PROGRAM)) |
|
198 |
@$(call printLauncherSetting,MAIN_CLASS,$(MAIN_CLASS)) |
|
199 |
@$(call printLauncherSetting,MAIN_JAVA_ARGS,$(MAIN_JAVA_ARGS)) |
|
200 |
@$(call printLauncherSetting,MAIN_ARGS,$(MAIN_ARGS)) |
|
201 |
@$(call printLauncherSetting,ALL_ARGS,$(ALL_ARGS)) |
|
202 |
@$(ECHO) "=========================================================" |
|
203 |
||
204 |
# |
|
205 |
# Rules for building a program |
|
206 |
# |
|
207 |
include $(BUILDDIR)/common/Program.gmk |
|
208 |