author | michaelm |
Tue, 06 Mar 2012 20:34:38 +0000 | |
changeset 12047 | 320a714614e9 |
parent 11826 | 8b378b0ae8fa |
child 12280 | 7e17a63793ca |
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 |
||
30 |
BUILDDIR = .. |
|
31 |
PACKAGE = launcher |
|
32 |
PRODUCT = sun |
|
33 |
include $(BUILDDIR)/common/Defs.gmk |
|
34 |
||
35 |
# The PROGRAM and MAIN_CLASS must be defined |
|
36 |
ifndef PROGRAM |
|
37 |
build: no_program |
|
38 |
no_program: |
|
39 |
$(ECHO) "No PROGRAM name defined" |
|
40 |
exit 1 |
|
41 |
endif |
|
42 |
ifndef MAIN_CLASS |
|
43 |
build: no_main |
|
44 |
no_main: |
|
45 |
$(ECHO) "No MAIN_CLASS name defined" |
|
46 |
exit 1 |
|
47 |
endif |
|
48 |
||
49 |
# Some tools need the wildcard expansion option |
|
50 |
ifeq ($(PROGRAM),javac) |
|
51 |
WILDCARDS=true |
|
52 |
MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools... |
|
53 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
54 |
endif |
|
55 |
ifeq ($(PROGRAM),javadoc) |
|
56 |
WILDCARDS=true |
|
57 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
58 |
endif |
|
59 |
ifeq ($(PROGRAM),javap) |
|
60 |
WILDCARDS=true |
|
61 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
62 |
endif |
|
63 |
ifeq ($(PROGRAM),javah) |
|
64 |
WILDCARDS=true |
|
65 |
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true |
|
66 |
endif |
|
67 |
ifeq ($(PROGRAM),serialver) |
|
68 |
WILDCARDS=true |
|
69 |
endif |
|
70 |
||
71 |
# GUI tools need X11 |
|
72 |
ifeq ($(PROGRAM),appletviewer) |
|
73 |
GUI_TOOL=true |
|
74 |
endif |
|
75 |
ifeq ($(PROGRAM),policytool) |
|
76 |
GUI_TOOL=true |
|
77 |
endif |
|
78 |
||
79 |
# SA tools |
|
80 |
ifeq ($(PROGRAM),jstack) |
|
81 |
SA_TOOL=true |
|
82 |
endif |
|
83 |
ifeq ($(PROGRAM),jsadebugd) |
|
84 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
85 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 86 |
endif |
87 |
ifeq ($(PROGRAM),jinfo) |
|
88 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
89 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 90 |
endif |
91 |
ifeq ($(PROGRAM),jmap) |
|
92 |
SA_TOOL=true |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11826
diff
changeset
|
93 |
INFO_PLIST_FILE=Info-privileged.plist |
2 | 94 |
endif |
95 |
||
96 |
# special idlj launcher |
|
97 |
ifeq ($(PROGRAM),orbd) |
|
98 |
IDLJ_TOOL=true |
|
99 |
endif |
|
100 |
ifeq ($(PROGRAM),servertool) |
|
101 |
IDLJ_TOOL=true |
|
102 |
endif |
|
103 |
ifeq ($(PROGRAM),tnameserv) |
|
104 |
IDLJ_TOOL=true |
|
105 |
endif |
|
106 |
||
107 |
# idlj itself only |
|
108 |
ifeq ($(PROGRAM),idlj) |
|
109 |
ifndef STANDALONE_CORBA_WS |
|
110 |
FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \ |
|
111 |
$(SHARE_SRC)/native/bin/utility.c |
|
112 |
endif |
|
113 |
endif |
|
114 |
||
115 |
# rmic only |
|
116 |
ifeq ($(PROGRAM),rmic) |
|
117 |
ifdef STANDALONE_CORBA_WS |
|
118 |
FILES_c = $(SHARE_SRC)/native/bin/$(PROGRAM).c \ |
|
119 |
$(SHARE_SRC)/native/bin/utility.c |
|
120 |
endif |
|
121 |
WILDCARDS=true |
|
122 |
endif |
|
123 |
||
124 |
# IDLJ_TOOL only uses different source files |
|
125 |
ifeq ($(IDLJ_TOOL),true) |
|
126 |
ifdef STANDALONE_CORBA_WS |
|
127 |
FILES_c = $(SHARE_SRC)/native/bin/idlj.c \ |
|
128 |
$(SHARE_SRC)/native/bin/utility.c |
|
129 |
endif |
|
130 |
endif |
|
131 |
||
132 |
# jdb only |
|
133 |
ifeq ($(PROGRAM),jdb) |
|
134 |
# Override the default APP_CLASSPATH to pick up sa-jdi.jar also. |
|
135 |
# Default is defined in src/[solaris,windows]/bin/java_md.h |
|
136 |
# PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c |
|
137 |
# SA is currently not available on windows (for any ARCH), or linux-ia64: |
|
138 |
ifneq ($(ARCH), ia64) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
139 |
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
|
140 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)' |
2 | 141 |
endif |
142 |
endif |
|
143 |
||
144 |
# jconsole only |
|
145 |
ifeq ($(PROGRAM),jconsole) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
146 |
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
|
147 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)' |
2 | 148 |
ifeq ($(PLATFORM), windows) |
149 |
OTHER_CPPFLAGS += -DJAVAW |
|
150 |
LDLIBS_COMMON += user32.lib |
|
151 |
MAIN_JAVA_ARGS += -J-Djconsole.showOutputViewer |
|
152 |
endif |
|
153 |
endif |
|
154 |
||
155 |
# GUI tools |
|
156 |
ifeq ($(GUI_TOOL),true) |
|
157 |
ifneq ($(PLATFORM), windows) |
|
158 |
# Anything with a GUI needs X11 to be linked in. |
|
159 |
OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 |
|
160 |
endif |
|
161 |
endif |
|
162 |
||
163 |
# SA tools need special app classpath |
|
164 |
ifeq ($(SA_TOOL),true) |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
2
diff
changeset
|
165 |
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
|
166 |
OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)' |
2 | 167 |
endif |
168 |
||
169 |
# Wildcards |
|
170 |
ifeq ($(WILDCARDS),true) |
|
171 |
OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS |
|
172 |
endif |
|
173 |
||
174 |
# 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
|
175 |
OTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"' |
2 | 176 |
|
177 |
# Construct initializer for initial arguments to java |
|
178 |
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
|
179 |
JAVA_ARGS = { $(ALL_ARGS:%="%",) } |
2 | 180 |
|
181 |
# Always report launcher info |
|
182 |
build: launcher_info |
|
183 |
||
184 |
# Print info macro |
|
185 |
define printLauncherSetting |
|
186 |
if [ "$2" != "" ] ; then $(PRINTF) "%-16s %s\n" "$1:" "$2"; fi |
|
187 |
endef |
|
188 |
||
189 |
# Report basic information about this launcher |
|
190 |
launcher_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 |
# |
|
202 |
include $(BUILDDIR)/common/Program.gmk |
|
203 |