author | jmelvin |
Mon, 16 Apr 2012 18:09:53 -0400 | |
changeset 12538 | 211d6e82fe51 |
parent 11369 | d1de4020afbd |
child 13678 | 5c8001201f98 |
permissions | -rw-r--r-- |
2 | 1 |
# |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
8589
diff
changeset
|
2 |
# Copyright (c) 2004, 2011, 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 |
# JDK Demo building jar file. |
|
27 |
||
28 |
# Some names are defined with LIBRARY inside the Defs.gmk file |
|
29 |
LIBRARY=$(DEMONAME) |
|
30 |
OBJDIR=$(TEMPDIR)/$(DEMONAME) |
|
31 |
||
32 |
# Input: |
|
33 |
# DEMONAME - name of the demo |
|
34 |
# DEMO_ROOT - path to root of all demo files |
|
35 |
# DEMO_DESTDIR - path to final demo destination directory |
|
36 |
# |
|
37 |
# Optional Input: |
|
38 |
# DEMO_SRCDIR - path to source if different from DEMO_ROOT |
|
39 |
# DEMO_PSRCDIR - path to additional platform specific source |
|
40 |
# DEMO_PKGDIR - sub directory of sources we want |
|
41 |
# DEMO_TOPFILES - names of top-level files relative to DEMO_ROOT |
|
42 |
# DEMO_MAINCLASS - name of the main class for the jar manifest |
|
43 |
# DEMO_NATIVECLASS - name of the class with native methods |
|
44 |
# DEMO_DESCRIPTOR - name of service file for jar (relative to DEMO_SRCDIR) |
|
45 |
# DEMO_EXTRA_SRCDIR - path to directory that holds extra sources to add |
|
46 |
# DEMO_EXTRA_FILES - extra sources relative to DEMO_EXTRA_SRCDIR |
|
47 |
# DEMO_OBJECTS - extra native object files needed |
|
48 |
# DEMO_MANIFEST_ATTR - extra line to add to the jar manifest file |
|
49 |
||
50 |
# Assume the source directory is the root directory if not set |
|
51 |
ifndef DEMO_SRCDIR |
|
52 |
DEMO_SRCDIR = $(DEMO_ROOT) |
|
53 |
endif |
|
54 |
ifndef DEMO_PKGDIR |
|
55 |
DEMO_PKGDIR = . |
|
56 |
endif |
|
57 |
||
58 |
# Some demos have special needs |
|
59 |
ifneq ($(DEMONAME),agent_util) |
|
60 |
DEMO_NEEDS_AGENT_UTIL = $(findstring agent_util,$(DEMO_OBJECTS)) |
|
61 |
endif |
|
62 |
ifneq ($(DEMONAME),java_crw_demo) |
|
63 |
DEMO_NEEDS_JAVA_CRW_DEMO = $(findstring java_crw_demo,$(DEMO_OBJECTS)) |
|
64 |
endif |
|
65 |
ifeq ($(DEMONAME),hprof) |
|
66 |
DEMO_NEEDS_NPT = true |
|
67 |
endif |
|
68 |
||
69 |
# Place to hold the build area (kind of a temp area) |
|
70 |
DEMO_BUILD_AREA = $(DEMOCLASSDIR)/$(PRODUCT)/$(DEMONAME) |
|
71 |
||
72 |
# Destination "src" directory |
|
73 |
DEMO_BUILD_SRCDIR = $(DEMO_BUILD_AREA)/src |
|
7962 | 74 |
|
75 |
ifndef DEMO_SKIP_SRCZIP |
|
76 |
DEMO_BUILD_SRCZIP = $(DEMO_BUILD_AREA)/src.zip |
|
77 |
DEMO_SOURCE_ZIP = $(DEMO_DESTDIR)/src.zip |
|
78 |
endif |
|
2 | 79 |
|
80 |
# Place to hold the jar image we are creating |
|
81 |
DEMO_JAR_IMAGE = $(DEMO_BUILD_AREA)/jar_image |
|
82 |
||
83 |
# The jar manifest file we will create and use |
|
84 |
DEMO_MANIFEST = $(DEMO_BUILD_AREA)/manifest.mf |
|
85 |
||
86 |
# The list of source files or options we will supply to javac |
|
87 |
DEMO_JAVAC_INPUT = $(DEMO_BUILD_AREA)/javac_input.txt |
|
88 |
||
89 |
# Any name of javah file |
|
90 |
DEMO_JAVAH_FILE = $(DEMO_NATIVECLASS:%=$(DEMO_BUILD_SRCDIR)/%.h) |
|
91 |
||
92 |
# Get complete list of files for this demo |
|
93 |
ifdef DEMO_PSRCDIR |
|
94 |
DEMO_ALL_FILES2 := $(shell ( $(CD) $(DEMO_PSRCDIR) \ |
|
95 |
&& $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \ |
|
96 |
| $(SED) 's@^\./@@' ) |
|
97 |
DEMO_ALL_FILES += $(DEMO_ALL_FILES2) |
|
98 |
endif |
|
99 |
ifdef DEMO_EXTRA_SRCDIR |
|
100 |
DEMO_ALL_FILES += $(DEMO_EXTRA_FILES) |
|
101 |
endif |
|
102 |
DEMO_ALL_FILES1 := $(shell ( $(CD) $(DEMO_SRCDIR) \ |
|
103 |
&& $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \ |
|
104 |
| $(SED) 's@^\./@@' ) |
|
105 |
DEMO_ALL_FILES += $(DEMO_ALL_FILES1) |
|
106 |
||
107 |
# Just the java sources |
|
108 |
DEMO_JAVA_SOURCES = $(filter %.java,$(DEMO_ALL_FILES)) |
|
109 |
||
110 |
# Just the C and C++ sources |
|
111 |
DEMO_C_SRC_FILES = $(filter %.c,$(DEMO_ALL_FILES)) |
|
112 |
DEMO_CPP_SRC_FILES = $(filter %.cpp,$(DEMO_ALL_FILES)) |
|
113 |
||
114 |
# All the native source files |
|
115 |
DEMO_ALL_NATIVE_SOURCES = $(DEMO_C_SRC_FILES) |
|
116 |
DEMO_ALL_NATIVE_SOURCES += $(DEMO_CPP_SRC_FILES) |
|
117 |
DEMO_ALL_NATIVE_SOURCES += $(filter %.h,$(DEMO_ALL_FILES)) |
|
118 |
DEMO_ALL_NATIVE_SOURCES += $(filter %.hpp,$(DEMO_ALL_FILES)) |
|
119 |
||
120 |
# If we have java sources, then define the jar file we will create |
|
8589
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
121 |
ifndef DEMO_JAR_NAME |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
122 |
DEMO_JAR_NAME = $(DEMONAME).jar |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
123 |
endif |
2 | 124 |
ifneq ($(strip $(DEMO_JAVA_SOURCES)),) |
8589
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
125 |
DEMO_JAR = $(DEMO_DESTDIR)/$(DEMO_JAR_NAME) |
2 | 126 |
endif |
127 |
||
128 |
# If we have native sources, define the native library we will create |
|
129 |
ifneq ($(strip $(DEMO_ALL_NATIVE_SOURCES)),) |
|
130 |
# Path to native library we will create |
|
131 |
DEMO_LIBRARY = \ |
|
132 |
$(DEMO_DESTDIR)/lib$(ISA_DIR)/$(LIB_PREFIX)$(DEMONAME).$(LIBRARY_SUFFIX) |
|
133 |
# C and C++ compiler flags we need to add to standard flags |
|
134 |
DEMO_CPPFLAGS += -I$(DEMO_BUILD_SRCDIR) |
|
135 |
# If the npt library is used we need to find the npt.h file |
|
136 |
ifneq ($(DEMO_NEEDS_NPT),) |
|
137 |
# The npt library is delivered as part of the JRE |
|
138 |
DEMO_CPPFLAGS += -I$(SHARE_SRC)/npt -I$(PLATFORM_SRC)/npt |
|
139 |
endif |
|
140 |
# Is the shared agent_util code needed |
|
141 |
ifneq ($(DEMO_NEEDS_AGENT_UTIL),) |
|
142 |
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.c |
|
143 |
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.h |
|
144 |
endif |
|
145 |
# Is the shared java_crw_demo code needed |
|
146 |
ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),) |
|
147 |
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.c |
|
148 |
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.h |
|
149 |
endif |
|
150 |
# All the native object files we need to build the library |
|
151 |
DEMO_OBJECTS += $(DEMO_C_SRC_FILES:%.c=%.$(OBJECT_SUFFIX)) \ |
|
152 |
$(DEMO_CPP_SRC_FILES:%.cpp=%.$(OBJECT_SUFFIX)) |
|
153 |
# Linking is special depending on whether we had C++ code or on windows |
|
154 |
DEMO_NEEDS_CPP = $(strip $(DEMO_CPP_SRC_FILES)) |
|
155 |
CPPFLAGS += $(DEMO_CPPFLAGS) |
|
156 |
ifeq ($(PLATFORM),windows) |
|
157 |
# Note: This is a link with cl.exe, not link.exe, options differ quite |
|
158 |
# bit between them. |
|
159 |
LINK.demo = $(LINK.c) |
|
160 |
LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION)) |
|
10841
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
161 |
DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
162 |
LDLIBS.demo += $(DEMO_VERSION_INFO) |
2 | 163 |
else |
164 |
ifneq ($(DEMO_NEEDS_CPP),) |
|
165 |
LINK.demo = $(LINK.cpp) |
|
166 |
LDLIBS.demo = $(LIBCXX) |
|
167 |
ifeq ($(PLATFORM),solaris) |
|
168 |
LDLIBS.demo += -lc |
|
169 |
endif |
|
170 |
else |
|
171 |
LINK.demo = $(LINK.c) |
|
172 |
LDLIBS.demo = $(LDLIBS) |
|
173 |
endif |
|
174 |
endif |
|
175 |
endif |
|
176 |
||
177 |
# Files that are considered resources (need to be in the jar file) |
|
178 |
DEMO_RESOURCES += $(filter-out %.java,$(DEMO_ALL_FILES)) |
|
179 |
||
180 |
# All destination files (top level readme files and all sources) |
|
181 |
# Note: We exclude the topfiles from the src tree. |
|
182 |
DEMO_DEST_TOPFILES = $(DEMO_TOPFILES:%=$(DEMO_DESTDIR)/%) |
|
183 |
DEMO_FILTERED_SOURCES = $(filter-out $(DEMO_TOPFILES),$(DEMO_ALL_FILES)) |
|
184 |
DEMO_FULL_SOURCES += $(DEMO_FILTERED_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) |
|
185 |
||
186 |
# Default rule |
|
187 |
all: build demo_info |
|
188 |
||
189 |
# Used to populate the destination directories |
|
190 |
$(DEMO_DESTDIR)/%: $(DEMO_ROOT)/% |
|
191 |
$(install-file) |
|
192 |
ifneq ($(DEMO_SRCDIR),$(DEMO_ROOT)) |
|
193 |
$(DEMO_DESTDIR)/%: $(DEMO_SRCDIR)/% |
|
194 |
$(install-file) |
|
195 |
endif |
|
196 |
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/% |
|
197 |
$(install-file) |
|
198 |
ifdef DEMO_PSRCDIR |
|
199 |
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_PSRCDIR)/% |
|
200 |
$(install-file) |
|
201 |
endif |
|
202 |
ifdef DEMO_EXTRA_SRCDIR |
|
203 |
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_EXTRA_SRCDIR)/% |
|
204 |
$(install-file) |
|
205 |
endif |
|
206 |
ifneq ($(DEMO_NEEDS_AGENT_UTIL),) |
|
207 |
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../agent_util/% |
|
208 |
$(install-file) |
|
209 |
endif |
|
210 |
ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),) |
|
211 |
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../java_crw_demo/% |
|
212 |
$(install-file) |
|
213 |
endif |
|
214 |
||
215 |
# Jar manifest file |
|
9351 | 216 |
MAINMANIFEST = $(JDK_TOPDIR)/make/tools/manifest.mf |
217 |
$(DEMO_MANIFEST): $(MAINMANIFEST) |
|
2 | 218 |
@$(prep-target) |
9351 | 219 |
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ |
220 |
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \ |
|
221 |
$(MAINMANIFEST) >> $@ |
|
222 |
$(ECHO) "Main-Class: $(DEMO_MAINCLASS)" >> $@ |
|
2 | 223 |
ifdef DEMO_MANIFEST_ATTR |
224 |
$(ECHO) "$(DEMO_MANIFEST_ATTR)" >> $@ |
|
225 |
endif |
|
226 |
||
227 |
# Populating the jar image directory |
|
228 |
$(DEMO_JAR_IMAGE)/%: $(DEMO_SRCDIR)/% |
|
229 |
$(install-file) |
|
230 |
ifdef DEMO_PSRCDIR |
|
231 |
$(DEMO_JAR_IMAGE)/%: $(DEMO_PSRCDIR)/% |
|
232 |
$(install-file) |
|
233 |
endif |
|
234 |
ifdef DEMO_EXTRA_SRCDIR |
|
235 |
$(DEMO_JAR_IMAGE)/%: $(DEMO_EXTRA_SRCDIR)/% |
|
236 |
$(install-file) |
|
237 |
endif |
|
238 |
ifdef DEMO_DESCRIPTOR |
|
239 |
$(DEMO_JAR_IMAGE)/META-INF/services/$(DEMO_DESCRIPTOR): \ |
|
240 |
$(DEMO_SRCDIR)/$(DEMO_DESCRIPTOR) |
|
241 |
$(install-file) |
|
242 |
endif |
|
243 |
||
244 |
# If we are creating a jar file (we have java code) |
|
245 |
ifdef DEMO_JAR |
|
246 |
||
247 |
# Input file for javac |
|
248 |
$(DEMO_JAVAC_INPUT): $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) |
|
249 |
@$(prep-target) |
|
250 |
@for i in $(DEMO_JAVA_SOURCES) ; do \ |
|
251 |
$(ECHO) "$(DEMO_BUILD_SRCDIR)/$$i" >> $@ ; \ |
|
252 |
done |
|
253 |
||
254 |
# Jar file creation |
|
255 |
$(DEMO_JAR): \ |
|
256 |
$(DEMO_JAVAC_INPUT) \ |
|
257 |
$(DEMO_MANIFEST) \ |
|
258 |
$(DEMO_DESCRIPTOR:%=$(DEMO_JAR_IMAGE)/META-INF/services/%) \ |
|
259 |
$(DEMO_RESOURCES:%=$(DEMO_JAR_IMAGE)/%) |
|
260 |
@$(prep-target) |
|
261 |
$(MKDIR) -p $(DEMO_JAR_IMAGE) |
|
262 |
$(JAVAC_CMD) -d $(DEMO_JAR_IMAGE) -sourcepath $(DEMO_BUILD_SRCDIR) \ |
|
263 |
@$(DEMO_JAVAC_INPUT) |
|
8589
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
264 |
ifeq ($(DEMO_INCL_SRC),true) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
265 |
$(CP) $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) $(DEMO_JAR_IMAGE) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
266 |
endif |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
267 |
ifeq ($(DEMO_ONLY_SRC),true) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
268 |
$(RM) -r $(DEMO_JAR_IMAGE) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
269 |
$(MKDIR) -p $(DEMO_JAR_IMAGE) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
270 |
$(CP) -r $(DEMO_BUILD_SRCDIR)/* $(DEMO_JAR_IMAGE) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
271 |
ifneq ($(DEMO_TOPFILES),) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
272 |
$(CP) $(DEMO_ROOT)/$(DEMO_TOPFILES) $(DEMO_JAR_IMAGE) |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
273 |
endif |
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
274 |
endif |
2 | 275 |
$(BOOT_JAR_CMD) -cfm $@ $(DEMO_MANIFEST) \ |
276 |
-C $(DEMO_JAR_IMAGE) . \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
277 |
$(BOOT_JAR_JFLAGS) |
2 | 278 |
@$(java-vm-cleanup) |
279 |
||
280 |
endif |
|
281 |
||
7962 | 282 |
ifndef DEMO_SKIP_SRCZIP |
283 |
# Create a src.zip file |
|
284 |
$(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES) |
|
2 | 285 |
@$(prep-target) |
286 |
$(CD) $(DEMO_BUILD_AREA)/src && $(ZIPEXE) -q -r ../$(@F) . |
|
287 |
||
7962 | 288 |
# Install the destination src.zip file and create the src tree |
289 |
$(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP) |
|
2 | 290 |
$(install-file) |
7962 | 291 |
endif |
2 | 292 |
|
10841
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
293 |
ifeq ($(PLATFORM),windows) |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
294 |
# JDK name required here |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
295 |
RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \ |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
296 |
/D "JDK_INTERNAL_NAME=$(LIBRARY)" \ |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
297 |
/D "JDK_FTYPE=0x2L" |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
298 |
endif |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
299 |
|
2 | 300 |
# Native library building |
301 |
ifdef DEMO_LIBRARY |
|
302 |
||
303 |
# Full paths to object files |
|
304 |
DEMO_FULL_OBJECTS = $(DEMO_OBJECTS:%=$(OBJDIR)/%) |
|
305 |
VPATH= |
|
306 |
||
307 |
# Native compile rules |
|
308 |
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.c |
|
309 |
@$(prep-target) |
|
310 |
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $< |
|
311 |
ifneq ($(DEMO_NEEDS_CPP),) |
|
312 |
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.cpp |
|
313 |
@$(prep-target) |
|
314 |
$(COMPILE.cpp) $(CC_OBJECT_OUTPUT_FLAG)$@ $< |
|
315 |
endif |
|
316 |
||
317 |
# Actual creation of the native shared library (C++ and C are different) |
|
318 |
$(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS) |
|
319 |
@$(prep-target) |
|
10841
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
320 |
ifeq ($(PLATFORM),windows) |
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
321 |
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE) |
11369
d1de4020afbd
7128320: Fix freetype sanity check to make it more generic
ohair
parents:
10841
diff
changeset
|
322 |
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -Fe$@ \ |
d1de4020afbd
7128320: Fix freetype sanity check to make it more generic
ohair
parents:
10841
diff
changeset
|
323 |
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo) |
d1de4020afbd
7128320: Fix freetype sanity check to make it more generic
ohair
parents:
10841
diff
changeset
|
324 |
else |
d1de4020afbd
7128320: Fix freetype sanity check to make it more generic
ohair
parents:
10841
diff
changeset
|
325 |
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -o $@ \ |
d1de4020afbd
7128320: Fix freetype sanity check to make it more generic
ohair
parents:
10841
diff
changeset
|
326 |
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo) |
10841
32925b032690
6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents:
9351
diff
changeset
|
327 |
endif |
8008
753c38f4af83
6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents:
7668
diff
changeset
|
328 |
@$(call binary_file_verification,$@) |
2 | 329 |
|
330 |
# Generation of any javah include file, make sure objects are dependent on it |
|
331 |
ifdef DEMO_NATIVECLASS |
|
332 |
$(DEMO_JAVAH_FILE): $(DEMO_JAR) |
|
333 |
@$(prep-target) |
|
334 |
$(JAVAH_CMD) -d $(DEMO_BUILD_SRCDIR) -classpath $(DEMO_JAR) \ |
|
335 |
$(DEMO_NATIVECLASS) |
|
336 |
@$(java-vm-cleanup) |
|
337 |
$(DEMO_FULL_OBJECTS): $(DEMO_JAVAH_FILE) |
|
338 |
endif |
|
339 |
||
340 |
endif |
|
341 |
||
342 |
# Build involves populating the destination "src" tree, building the jar and |
|
343 |
# native library, and creating a source bundle |
|
344 |
||
345 |
sources: $(DEMO_FULL_SOURCES) |
|
346 |
@$(ECHO) "Created $@" |
|
347 |
||
348 |
objects: |
|
349 |
@$(ECHO) "Created $@" |
|
350 |
||
351 |
# Why the nested make here? It only works this way, don't know why. |
|
352 |
bundles: $(DEMO_BUILD_SRCZIP) |
|
353 |
$(RM) -r $(DEMO_DESTDIR) |
|
354 |
$(MKDIR) -p $(DEMO_DESTDIR) |
|
355 |
$(MAKE) $(DEMO_LIBRARY) $(DEMO_JAR) $(DEMO_SOURCE_ZIP) $(DEMO_DEST_TOPFILES) |
|
356 |
# Applets are special, no jar file, no src.zip, everything expanded. |
|
357 |
ifdef DEMO_IS_APPLET |
|
358 |
@$(ECHO) "Expanding jar file into demos area at $(DEMO_DESTDIR)" |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
359 |
( $(CD) $(DEMO_DESTDIR) && \ |
8589
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
360 |
$(BOOT_JAR_CMD) -xfv $(DEMO_JAR_NAME) \ |
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
361 |
$(BOOT_JAR_JFLAGS) && \ |
8589
84bd24764797
6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents:
8583
diff
changeset
|
362 |
$(RM) -r META-INF $(DEMO_JAR_NAME) && \ |
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
2
diff
changeset
|
363 |
$(java-vm-cleanup) ) |
2 | 364 |
@( $(CD) $(DEMO_DESTDIR) && $(java-vm-cleanup) ) |
365 |
@$(ECHO) "Expanding source into demos area at $(DEMO_DESTDIR)" |
|
366 |
( $(CD) $(DEMO_DESTDIR) && $(UNZIP) -o src.zip && $(RM) src.zip ) |
|
367 |
endif |
|
368 |
||
369 |
build: sources bundles |
|
370 |
||
371 |
# Printing out a demo information line |
|
372 |
define printDemoSetting |
|
373 |
if [ "$2" != "" ] ; then $(PRINTF) "%-20s %s\n" "$1:" "$2"; fi |
|
374 |
endef |
|
375 |
||
376 |
# Print out the demo information |
|
377 |
demo_info: |
|
378 |
@$(ECHO) "=========================================================" |
|
379 |
@$(call printDemoSetting,DEMONAME,$(DEMONAME)) |
|
380 |
@$(call printDemoSetting,DEMO_ROOT,$(DEMO_ROOT)) |
|
381 |
@$(call printDemoSetting,DEMO_SRCDIR,$(DEMO_SRCDIR)) |
|
382 |
@$(call printDemoSetting,DEMO_DESTDIR,$(DEMO_DESTDIR)) |
|
383 |
@$(call printDemoSetting,DEMO_JAR,$(DEMO_JAR)) |
|
384 |
@$(call printDemoSetting,DEMO_MANIFEST_ATTR,$(DEMO_MANIFEST_ATTR)) |
|
385 |
@$(call printDemoSetting,DEMO_PSRCDIR,$(DEMO_PSRCDIR)) |
|
386 |
@$(call printDemoSetting,DEMO_EXTRA_SRCDIR,$(DEMO_EXTRA_SRCDIR)) |
|
387 |
@$(call printDemoSetting,DEMO_EXTRA_FILES,$(DEMO_EXTRA_FILES)) |
|
388 |
@$(call printDemoSetting,DEMO_TOPFILES,$(DEMO_TOPFILES)) |
|
389 |
@$(call printDemoSetting,DEMO_MAINCLASS,$(DEMO_MAINCLASS)) |
|
390 |
@$(call printDemoSetting,DEMO_DESCRIPTOR,$(DEMO_DESCRIPTOR)) |
|
391 |
@$(call printDemoSetting,DEMO_NATIVECLASS,$(DEMO_NATIVECLASS)) |
|
392 |
@$(call printDemoSetting,DEMO_LIBRARY,$(DEMO_LIBRARY)) |
|
393 |
@$(call printDemoSetting,DEMO_OBJECTS,$(DEMO_OBJECTS)) |
|
394 |
@$(call printDemoSetting,DEMO_SOURCE_ZIP,$(DEMO_SOURCE_ZIP)) |
|
395 |
@$(ECHO) "=========================================================" |
|
396 |
||
397 |
# Clean rule |
|
398 |
clean clobber: |
|
399 |
$(RM) -r $(DEMO_BUILD_AREA) |
|
400 |
$(RM) -r $(DEMO_DESTDIR) |
|
401 |
||
7962 | 402 |
# This should not be needed, but some versions of GNU make have a bug that |
2 | 403 |
# sometimes deleted these files for some strange and unknown reason |
404 |
# (GNU make version 3.78.1 has the problem, GNU make version 3.80 doesn't?) |
|
405 |
.PRECIOUS: $(DEMO_FULL_SOURCES) $(DEMO_BUILD_SRCZIP) $(DEMO_SOURCE_ZIP) |
|
406 |
||
407 |
# List phony targets |
|
408 |
.PHONY: all build clean clobber demo_info \ |
|
409 |
sources bundles |
|
410 |