1#
2# Copyright (c) 2000, 2013, 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.
8#
9# This code is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12# version 2 for more details (a copy is included in the LICENSE file that
13# accompanied this code).
14#
15# You should have received a copy of the GNU General Public License version
16# 2 along with this work; if not, write to the Free Software Foundation,
17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18#
19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20# or visit www.oracle.com if you need additional information or have any
21# questions.
22#
23#
24
25# This guards against adding broken .java files to the directory
26# hierarchy, but may be a pain to keep in sync
27
28# Generated using the build-pkglist script
29ifeq "x$(GAMMADIR)" "x"
30include ../../make/defs.make
31else
32include $(GAMMADIR)/make/defs.make
33endif
34
35ifeq "x$(HOTSPOT_BUILD_VERSION)" "x"
36SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)
37else
38SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
39endif
40
41PKGLIST = \
42sun.jvm.hotspot \
43sun.jvm.hotspot.asm \
44sun.jvm.hotspot.asm.sparc \
45sun.jvm.hotspot.c1 \
46sun.jvm.hotspot.ci \
47sun.jvm.hotspot.code \
48sun.jvm.hotspot.compiler \
49sun.jvm.hotspot.debugger \
50sun.jvm.hotspot.debugger.amd64 \
51sun.jvm.hotspot.debugger.bsd \
52sun.jvm.hotspot.debugger.bsd.aarch64 \
53sun.jvm.hotspot.debugger.bsd.amd64 \
54sun.jvm.hotspot.debugger.bsd.ppc64 \
55sun.jvm.hotspot.debugger.bsd.x86 \
56sun.jvm.hotspot.debugger.cdbg \
57sun.jvm.hotspot.debugger.cdbg.basic \
58sun.jvm.hotspot.debugger.cdbg.basic.amd64 \
59sun.jvm.hotspot.debugger.cdbg.basic.x86 \
60sun.jvm.hotspot.debugger.dummy \
61sun.jvm.hotspot.debugger.linux \
62sun.jvm.hotspot.debugger.linux.amd64 \
63sun.jvm.hotspot.debugger.linux.aarch64 \
64sun.jvm.hotspot.debugger.linux.x86 \
65sun.jvm.hotspot.debugger.posix \
66sun.jvm.hotspot.debugger.posix.elf \
67sun.jvm.hotspot.debugger.ppc64 \
68sun.jvm.hotspot.debugger.proc \
69sun.jvm.hotspot.debugger.proc.aarch64 \
70sun.jvm.hotspot.debugger.proc.amd64 \
71sun.jvm.hotspot.debugger.proc.aarch64 \
72sun.jvm.hotspot.debugger.proc.ppc64 \
73sun.jvm.hotspot.debugger.proc.sparc \
74sun.jvm.hotspot.debugger.proc.x86 \
75sun.jvm.hotspot.debugger.remote \
76sun.jvm.hotspot.debugger.remote.amd64 \
77sun.jvm.hotspot.debugger.remote.ppc64 \
78sun.jvm.hotspot.debugger.remote.sparc \
79sun.jvm.hotspot.debugger.remote.x86 \
80sun.jvm.hotspot.debugger.sparc \
81sun.jvm.hotspot.debugger.win32.coff \
82sun.jvm.hotspot.debugger.windbg \
83sun.jvm.hotspot.debugger.windbg.amd64 \
84sun.jvm.hotspot.debugger.windbg.x86 \
85sun.jvm.hotspot.debugger.x86 \
86sun.jvm.hotspot.gc_implementation \
87sun.jvm.hotspot.gc_implementation.g1 \
88sun.jvm.hotspot.gc_implementation.parallelScavenge \
89sun.jvm.hotspot.gc_implementation.shared \
90sun.jvm.hotspot.gc_interface \
91sun.jvm.hotspot.interpreter \
92sun.jvm.hotspot.jdi \
93sun.jvm.hotspot.memory \
94sun.jvm.hotspot.opto \
95sun.jvm.hotspot.oops \
96sun.jvm.hotspot.prims \
97sun.jvm.hotspot.runtime \
98sun.jvm.hotspot.runtime.amd64 \
99sun.jvm.hotspot.runtime.aarch64 \
100sun.jvm.hotspot.runtime.bsd \
101sun.jvm.hotspot.runtime.bsd_amd64 \
102sun.jvm.hotspot.runtime.bsd_ppc64 \
103sun.jvm.hotspot.runtime.bsd_x86 \
104sun.jvm.hotspot.runtime.linux \
105sun.jvm.hotspot.runtime.linux_amd64 \
106sun.jvm.hotspot.runtime.linux_aarch64 \
107sun.jvm.hotspot.runtime.linux_sparc \
108sun.jvm.hotspot.runtime.linux_x86 \
109sun.jvm.hotspot.runtime.posix \
110sun.jvm.hotspot.runtime.ppc64 \
111sun.jvm.hotspot.runtime.solaris_amd64 \
112sun.jvm.hotspot.runtime.solaris_sparc \
113sun.jvm.hotspot.runtime.solaris_x86 \
114sun.jvm.hotspot.runtime.sparc \
115sun.jvm.hotspot.runtime.win32_amd64 \
116sun.jvm.hotspot.runtime.win32_x86 \
117sun.jvm.hotspot.runtime.x86 \
118sun.jvm.hotspot.tools \
119sun.jvm.hotspot.tools.jcore \
120sun.jvm.hotspot.tools.soql \
121sun.jvm.hotspot.types \
122sun.jvm.hotspot.types.basic \
123sun.jvm.hotspot.ui \
124sun.jvm.hotspot.ui.action \
125sun.jvm.hotspot.ui.classbrowser \
126sun.jvm.hotspot.ui.resources \
127sun.jvm.hotspot.ui.table \
128sun.jvm.hotspot.ui.tree \
129sun.jvm.hotspot.ui.treetable \
130sun.jvm.hotspot.utilities \
131sun.jvm.hotspot.utilities.memo \
132sun.jvm.hotspot.utilities.soql \
133com.sun.java.swing.action \
134com.sun.java.swing.ui
135#END PKGLIST
136
137# Generated using the build-filelist script
138FILELIST = \
139sun/jvm/hotspot/*.java \
140sun/jvm/hotspot/asm/*.java \
141sun/jvm/hotspot/asm/sparc/*.java \
142sun/jvm/hotspot/c1/*.java \
143sun/jvm/hotspot/ci/*.java \
144sun/jvm/hotspot/code/*.java \
145sun/jvm/hotspot/compiler/*.java \
146sun/jvm/hotspot/debugger/*.java \
147sun/jvm/hotspot/debugger/amd64/*.java \
148sun/jvm/hotspot/debugger/bsd/*.java \
149sun/jvm/hotspot/debugger/bsd/aarch64/*.java \
150sun/jvm/hotspot/debugger/bsd/amd64/*.java \
151sun/jvm/hotspot/debugger/bsd/ppc64/*.java \
152sun/jvm/hotspot/debugger/bsd/x86/*.java \
153sun/jvm/hotspot/debugger/cdbg/*.java \
154sun/jvm/hotspot/debugger/cdbg/basic/*.java \
155sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \
156sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \
157sun/jvm/hotspot/debugger/dummy/*.java \
158sun/jvm/hotspot/debugger/linux/*.java \
159sun/jvm/hotspot/debugger/linux/x86/*.java \
160sun/jvm/hotspot/debugger/linux/aarch64/*.java \
161sun/jvm/hotspot/debugger/posix/*.java \
162sun/jvm/hotspot/debugger/posix/elf/*.java \
163sun/jvm/hotspot/debugger/ppc64/*.java \
164sun/jvm/hotspot/debugger/proc/*.java \
165sun/jvm/hotspot/debugger/proc/amd64/*.java \
166sun/jvm/hotspot/debugger/proc/ppc64/*.java \
167sun/jvm/hotspot/debugger/proc/sparc/*.java \
168sun/jvm/hotspot/debugger/proc/x86/*.java \
169sun/jvm/hotspot/debugger/proc/aarch64/*.java \
170sun/jvm/hotspot/debugger/remote/*.java \
171sun/jvm/hotspot/debugger/remote/amd64/*.java \
172sun/jvm/hotspot/debugger/remote/ppc64/*.java \
173sun/jvm/hotspot/debugger/remote/sparc/*.java \
174sun/jvm/hotspot/debugger/remote/x86/*.java \
175sun/jvm/hotspot/debugger/sparc/*.java \
176sun/jvm/hotspot/debugger/win32/coff/*.java \
177sun/jvm/hotspot/debugger/windbg/*.java \
178sun/jvm/hotspot/debugger/windbg/x86/*.java \
179sun/jvm/hotspot/debugger/x86/*.java \
180sun/jvm/hotspot/gc_implementation/g1/*.java \
181sun/jvm/hotspot/gc_implementation/parallelScavenge/*.java \
182sun/jvm/hotspot/gc_implementation/shared/*.java \
183sun/jvm/hotspot/interpreter/*.java \
184sun/jvm/hotspot/jdi/*.java \
185sun/jvm/hotspot/memory/*.java \
186sun/jvm/hotspot/oops/*.java \
187sun/jvm/hotspot/opto/*.java \
188sun/jvm/hotspot/prims/*.java \
189sun/jvm/hotspot/runtime/*.java \
190sun/jvm/hotspot/runtime/amd64/*.java \
191sun/jvm/hotspot/runtime/aarch64/*.java \
192sun/jvm/hotspot/runtime/bsd/*.java \
193sun/jvm/hotspot/runtime/bsd_amd64/*.java \
194sun/jvm/hotspot/runtime/bsd_ppc64/*.java \
195sun/jvm/hotspot/runtime/bsd_x86/*.java \
196sun/jvm/hotspot/runtime/linux/*.java \
197sun/jvm/hotspot/runtime/linux_amd64/*.java \
198sun/jvm/hotspot/runtime/linux_aarch64/*.java \
199sun/jvm/hotspot/runtime/linux_sparc/*.java \
200sun/jvm/hotspot/runtime/linux_x86/*.java \
201sun/jvm/hotspot/runtime/posix/*.java \
202sun/jvm/hotspot/runtime/ppc64/*.java \
203sun/jvm/hotspot/runtime/solaris_amd64/*.java \
204sun/jvm/hotspot/runtime/solaris_sparc/*.java \
205sun/jvm/hotspot/runtime/solaris_x86/*.java \
206sun/jvm/hotspot/runtime/sparc/*.java \
207sun/jvm/hotspot/runtime/win32_amd64/*.java \
208sun/jvm/hotspot/runtime/win32_x86/*.java \
209sun/jvm/hotspot/runtime/x86/*.java \
210sun/jvm/hotspot/tools/*.java \
211sun/jvm/hotspot/tools/jcore/*.java \
212sun/jvm/hotspot/tools/soql/*.java \
213sun/jvm/hotspot/types/*.java \
214sun/jvm/hotspot/types/basic/*.java \
215sun/jvm/hotspot/ui/*.java \
216sun/jvm/hotspot/ui/action/*.java \
217sun/jvm/hotspot/ui/classbrowser/*.java \
218sun/jvm/hotspot/ui/table/*.java \
219sun/jvm/hotspot/ui/tree/*.java \
220sun/jvm/hotspot/ui/treetable/*.java \
221sun/jvm/hotspot/utilities/*.java \
222sun/jvm/hotspot/utilities/memo/*.java \
223sun/jvm/hotspot/utilities/soql/*.java \
224com/sun/java/swing/action/*.java \
225com/sun/java/swing/ui/*.java
226#END FILELIST
227
228ifneq "x$(ALT_BOOTDIR)" "x"
229  BOOTDIR := $(ALT_BOOTDIR)
230endif
231
232ifeq "x$(BOOTDIR)" "x"
233  JDK_HOME := $(shell dirname $(shell which java))/..
234else
235  JDK_HOME := $(BOOTDIR)
236endif
237
238isUnix := $(shell test -r c:/; echo $$?)
239
240ifeq "$(isUnix)" "1"
241    CPS := :
242else
243    CPS := ";"
244endif
245
246SRC_DIR    = ../src/share/classes
247BUILD_DIR  = ../build
248OUTPUT_DIR = $(BUILD_DIR)/classes
249DOC_DIR    = $(BUILD_DIR)/doc
250
251# gnumake 3.78.1 does not accept the *s,
252# so use the shell to expand them
253ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
254ALLFILES := $(shell /bin/ls $(ALLFILES))
255
256# tools.jar is used by the sa-jdi binding
257CLASSPATH = $(JDK_HOME)/lib/tools.jar
258
259CLASSPATH := $(subst \,/,$(CLASSPATH))
260
261# FIXME: autogenerate call to rmic
262
263SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
264
265SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
266JAVAC = $(JDK_HOME)/bin/javac
267JAVA = $(JDK_HOME)/bin/java
268JAVADOC = $(JDK_HOME)/bin/javadoc
269RMIC = $(JDK_HOME)/bin/rmic
270
271# Tagging it on because there's no reason not to run it
272all: filelist
273	@mkdir -p $(OUTPUT_DIR)
274	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
275	$(JAVAC) -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
276	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
277	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
278	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
279	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
280	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
281	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
282	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
283
284allprof: filelist
285	@mkdir -p $(OUTPUT_DIR)
286	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
287	$(JAVAC) -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
288	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
289	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
290	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
291	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
292	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
293	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
294	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
295
296.PHONY: filelist
297filelist: $(ALLFILES)
298	@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
299          echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
300          echo ""; \
301          exit 1; \
302        fi
303	@rm -f $@
304	@echo $(ALLFILES) > $@
305
306.PHONY: natives
307natives:
308	cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) all
309
310.PHONY: sa-jdi.jar
311sa-jdi.jar:
312	echo "sa-jdi.jar is built by a hotspot build."
313
314docs:
315	@$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
316
317sizes: $(ALLFILES)
318	wc -l $(ALLFILES)
319
320cscope: $(ALLFILES)
321	rm -f java.files
322	echo $(ALLFILES) > java.files
323	cscope -b -i java.files -f java.out
324	rm -f java.files
325
326.PHONY: sa.jar
327sa.jar:
328	rm -f $(BUILD_DIR)/sa.jar
329	cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *
330
331clean::
332	rm -rf filelist
333	cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) clean
334	rm -rf $(BUILD_DIR)/*
335