Makefile 10.9 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
19 20 21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34
#  
#

# This guards against adding broken .java files to the directory
# hierarchy, but may be a pain to keep in sync

# Generated using the build-pkglist script
ifeq "x$(GAMMADIR)" "x"
include ../../make/defs.make
else
include $(GAMMADIR)/make/defs.make
endif

35 36 37 38 39 40
ifeq "x$(HOTSPOT_BUILD_VERSION)" "x"
SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)
else
SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
endif

D
duke 已提交
41 42 43 44 45 46 47
PKGLIST = \
sun.jvm.hotspot \
sun.jvm.hotspot.asm \
sun.jvm.hotspot.asm.sparc \
sun.jvm.hotspot.bugspot \
sun.jvm.hotspot.bugspot.tree \
sun.jvm.hotspot.c1 \
N
never 已提交
48
sun.jvm.hotspot.ci \
D
duke 已提交
49 50 51 52
sun.jvm.hotspot.code \
sun.jvm.hotspot.compiler \
sun.jvm.hotspot.debugger \
sun.jvm.hotspot.debugger.amd64 \
N
never 已提交
53 54 55
sun.jvm.hotspot.debugger.bsd \
sun.jvm.hotspot.debugger.bsd.amd64 \
sun.jvm.hotspot.debugger.bsd.x86 \
D
duke 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
sun.jvm.hotspot.debugger.cdbg \
sun.jvm.hotspot.debugger.cdbg.basic \
sun.jvm.hotspot.debugger.cdbg.basic.amd64 \
sun.jvm.hotspot.debugger.cdbg.basic.x86 \
sun.jvm.hotspot.debugger.dummy \
sun.jvm.hotspot.debugger.ia64 \
sun.jvm.hotspot.debugger.linux \
sun.jvm.hotspot.debugger.linux.amd64 \
sun.jvm.hotspot.debugger.linux.ia64 \
sun.jvm.hotspot.debugger.linux.x86 \
sun.jvm.hotspot.debugger.posix \
sun.jvm.hotspot.debugger.posix.elf \
sun.jvm.hotspot.debugger.proc \
sun.jvm.hotspot.debugger.proc.amd64 \
sun.jvm.hotspot.debugger.proc.sparc \
sun.jvm.hotspot.debugger.proc.x86 \
sun.jvm.hotspot.debugger.remote \
sun.jvm.hotspot.debugger.remote.amd64 \
sun.jvm.hotspot.debugger.remote.sparc \
sun.jvm.hotspot.debugger.remote.x86 \
sun.jvm.hotspot.debugger.sparc \
sun.jvm.hotspot.debugger.win32.coff \
sun.jvm.hotspot.debugger.windbg \
sun.jvm.hotspot.debugger.windbg.amd64 \
sun.jvm.hotspot.debugger.windbg.ia64 \
sun.jvm.hotspot.debugger.windbg.x86 \
sun.jvm.hotspot.debugger.x86 \
sun.jvm.hotspot.gc_implementation \
T
tonyp 已提交
84
sun.jvm.hotspot.gc_implementation.g1 \
D
duke 已提交
85 86 87 88 89 90 91
sun.jvm.hotspot.gc_implementation.parallelScavenge \
sun.jvm.hotspot.gc_implementation.shared \
sun.jvm.hotspot.gc_interface \
sun.jvm.hotspot.interpreter \
sun.jvm.hotspot.jdi \
sun.jvm.hotspot.livejvm \
sun.jvm.hotspot.memory \
N
never 已提交
92
sun.jvm.hotspot.opto \
D
duke 已提交
93
sun.jvm.hotspot.oops \
N
never 已提交
94
sun.jvm.hotspot.prims \
D
duke 已提交
95 96
sun.jvm.hotspot.runtime \
sun.jvm.hotspot.runtime.amd64 \
N
never 已提交
97 98 99
sun.jvm.hotspot.runtime.bsd \
sun.jvm.hotspot.runtime.bsd_amd64 \
sun.jvm.hotspot.runtime.bsd_x86 \
D
duke 已提交
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
sun.jvm.hotspot.runtime.ia64 \
sun.jvm.hotspot.runtime.linux \
sun.jvm.hotspot.runtime.linux_amd64 \
sun.jvm.hotspot.runtime.linux_ia64 \
sun.jvm.hotspot.runtime.linux_sparc \
sun.jvm.hotspot.runtime.linux_x86 \
sun.jvm.hotspot.runtime.posix \
sun.jvm.hotspot.runtime.solaris_amd64 \
sun.jvm.hotspot.runtime.solaris_sparc \
sun.jvm.hotspot.runtime.solaris_x86 \
sun.jvm.hotspot.runtime.sparc \
sun.jvm.hotspot.runtime.win32_amd64 \
sun.jvm.hotspot.runtime.win32_ia64 \
sun.jvm.hotspot.runtime.win32_x86 \
sun.jvm.hotspot.runtime.x86 \
sun.jvm.hotspot.tools \
sun.jvm.hotspot.tools.jcore \
sun.jvm.hotspot.tools.soql \
sun.jvm.hotspot.types \
sun.jvm.hotspot.types.basic \
sun.jvm.hotspot.ui \
sun.jvm.hotspot.ui.action \
sun.jvm.hotspot.ui.classbrowser \
sun.jvm.hotspot.ui.resources \
sun.jvm.hotspot.ui.table \
sun.jvm.hotspot.ui.tree \
sun.jvm.hotspot.ui.treetable \
sun.jvm.hotspot.utilities \
sun.jvm.hotspot.utilities.memo \
129 130 131
sun.jvm.hotspot.utilities.soql \
com.sun.java.swing.action \
com.sun.java.swing.ui
D
duke 已提交
132 133 134 135 136 137 138 139 140 141
#END PKGLIST

# Generated using the build-filelist script
FILELIST = \
sun/jvm/hotspot/*.java \
sun/jvm/hotspot/asm/*.java \
sun/jvm/hotspot/asm/sparc/*.java \
sun/jvm/hotspot/bugspot/*.java \
sun/jvm/hotspot/bugspot/tree/*.java \
sun/jvm/hotspot/c1/*.java \
N
never 已提交
142
sun/jvm/hotspot/ci/*.java \
D
duke 已提交
143 144 145 146
sun/jvm/hotspot/code/*.java \
sun/jvm/hotspot/compiler/*.java \
sun/jvm/hotspot/debugger/*.java \
sun/jvm/hotspot/debugger/amd64/*.java \
N
never 已提交
147 148 149
sun/jvm/hotspot/debugger/bsd/*.java \
sun/jvm/hotspot/debugger/bsd/amd64/*.java \
sun/jvm/hotspot/debugger/bsd/x86/*.java \
D
duke 已提交
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
sun/jvm/hotspot/debugger/cdbg/*.java \
sun/jvm/hotspot/debugger/cdbg/basic/*.java \
sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \
sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \
sun/jvm/hotspot/debugger/dummy/*.java \
sun/jvm/hotspot/debugger/ia64/*.java \
sun/jvm/hotspot/debugger/linux/*.java \
sun/jvm/hotspot/debugger/linux/x86/*.java \
sun/jvm/hotspot/debugger/posix/*.java \
sun/jvm/hotspot/debugger/posix/elf/*.java \
sun/jvm/hotspot/debugger/proc/*.java \
sun/jvm/hotspot/debugger/proc/amd64/*.java \
sun/jvm/hotspot/debugger/proc/sparc/*.java \
sun/jvm/hotspot/debugger/proc/x86/*.java \
sun/jvm/hotspot/debugger/remote/*.java \
sun/jvm/hotspot/debugger/remote/amd64/*.java \
sun/jvm/hotspot/debugger/remote/sparc/*.java \
sun/jvm/hotspot/debugger/remote/x86/*.java \
sun/jvm/hotspot/debugger/sparc/*.java \
sun/jvm/hotspot/debugger/win32/coff/*.java \
sun/jvm/hotspot/debugger/windbg/*.java \
sun/jvm/hotspot/debugger/windbg/ia64/*.java \
sun/jvm/hotspot/debugger/windbg/x86/*.java \
sun/jvm/hotspot/debugger/x86/*.java \
T
tonyp 已提交
174 175 176
sun/jvm/hotspot/gc_implementation/g1/*.java \
sun/jvm/hotspot/gc_implementation/parallelScavenge/*.java \
sun/jvm/hotspot/gc_implementation/shared/*.java \
D
duke 已提交
177 178 179 180 181
sun/jvm/hotspot/interpreter/*.java \
sun/jvm/hotspot/jdi/*.java \
sun/jvm/hotspot/livejvm/*.java \
sun/jvm/hotspot/memory/*.java \
sun/jvm/hotspot/oops/*.java \
N
never 已提交
182 183
sun/jvm/hotspot/opto/*.java \
sun/jvm/hotspot/prims/*.java \
D
duke 已提交
184 185
sun/jvm/hotspot/runtime/*.java \
sun/jvm/hotspot/runtime/amd64/*.java \
N
never 已提交
186 187 188
sun/jvm/hotspot/runtime/bsd/*.java \
sun/jvm/hotspot/runtime/bsd_amd64/*.java \
sun/jvm/hotspot/runtime/bsd_x86/*.java \
D
duke 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
sun/jvm/hotspot/runtime/ia64/*.java \
sun/jvm/hotspot/runtime/linux/*.java \
sun/jvm/hotspot/runtime/linux_amd64/*.java \
sun/jvm/hotspot/runtime/linux_ia64/*.java \
sun/jvm/hotspot/runtime/linux_sparc/*.java \
sun/jvm/hotspot/runtime/linux_x86/*.java \
sun/jvm/hotspot/runtime/posix/*.java \
sun/jvm/hotspot/runtime/solaris_amd64/*.java \
sun/jvm/hotspot/runtime/solaris_sparc/*.java \
sun/jvm/hotspot/runtime/solaris_x86/*.java \
sun/jvm/hotspot/runtime/sparc/*.java \
sun/jvm/hotspot/runtime/win32_amd64/*.java \
sun/jvm/hotspot/runtime/win32_ia64/*.java \
sun/jvm/hotspot/runtime/win32_x86/*.java \
sun/jvm/hotspot/runtime/x86/*.java \
sun/jvm/hotspot/tools/*.java \
sun/jvm/hotspot/tools/jcore/*.java \
sun/jvm/hotspot/tools/soql/*.java \
sun/jvm/hotspot/types/*.java \
sun/jvm/hotspot/types/basic/*.java \
sun/jvm/hotspot/ui/*.java \
sun/jvm/hotspot/ui/action/*.java \
sun/jvm/hotspot/ui/classbrowser/*.java \
sun/jvm/hotspot/ui/table/*.java \
sun/jvm/hotspot/ui/tree/*.java \
sun/jvm/hotspot/ui/treetable/*.java \
sun/jvm/hotspot/utilities/*.java \
sun/jvm/hotspot/utilities/memo/*.java \
217 218 219
sun/jvm/hotspot/utilities/soql/*.java \
com/sun/java/swing/action/*.java \
com/sun/java/swing/ui/*.java 
D
duke 已提交
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
#END FILELIST

ifneq "x$(ALT_BOOTDIR)" "x"
  BOOTDIR := $(ALT_BOOTDIR)
endif

ifeq "x$(BOOTDIR)" "x"
  JDK_HOME := $(shell dirname $(shell which java))/..
else
  JDK_HOME := $(BOOTDIR)
endif

isUnix := $(shell test -r c:/; echo $$?)

ifeq "$(isUnix)" "1"
    CPS := :
else
    CPS := ";"
endif

SRC_DIR    = ../src/share/classes
BUILD_DIR  = ../build
OUTPUT_DIR = $(BUILD_DIR)/classes
DOC_DIR    = $(BUILD_DIR)/doc

# gnumake 3.78.1 does not accept the *s, 
# so use the shell to expand them
ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
ALLFILES := $(shell /bin/ls $(ALLFILES))

250 251
# tools.jar is used by the sa-jdi binding
CLASSPATH = $(JDK_HOME)/lib/tools.jar
D
duke 已提交
252 253 254 255 256 257 258 259

CLASSPATH := $(subst \,/,$(CLASSPATH))

# FIXME: autogenerate call to rmic

SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"

SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
260 261 262
JAVAC = $(JDK_HOME)/bin/javac
JAVADOC = $(JDK_HOME)/bin/javadoc
RMIC = $(JDK_HOME)/bin/rmic
D
duke 已提交
263 264 265 266 267

# Tagging it on because there's no reason not to run it
all: filelist
	@mkdir -p $(OUTPUT_DIR)
	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
268
	$(JAVAC) -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
269
	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
D
duke 已提交
270 271
	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
272 273 274 275
	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
D
duke 已提交
276 277 278 279

allprof: filelist
	@mkdir -p $(OUTPUT_DIR)
	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
280
	$(JAVAC) -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
281
	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
D
duke 已提交
282 283
	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
284 285 286 287
	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
D
duke 已提交
288

289
.PHONY: filelist
D
duke 已提交
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
filelist: $(ALLFILES)
	@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
          echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
          echo ""; \
          exit 1; \
        fi
	@rm -f $@
	@echo $(ALLFILES) > $@

.PHONY: natives
natives:
	cd ../src/os/`java -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) all

.PHONY: sa-jdi.jar
sa-jdi.jar:
305
	echo "sa-jdi.jar is built by a hotspot build."
D
duke 已提交
306 307

docs:
308
	@$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
D
duke 已提交
309 310 311 312 313

sizes: $(ALLFILES)
	wc -l $(ALLFILES)

cscope: $(ALLFILES)
314
	rm -f java.files
D
duke 已提交
315 316
	echo $(ALLFILES) > java.files
	cscope -b -i java.files -f java.out 
317
	rm -f java.files
D
duke 已提交
318 319 320 321 322 323 324 325 326 327

.PHONY: sa.jar
sa.jar:
	rm -f $(BUILD_DIR)/sa.jar
	cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *

clean::
	rm -rf filelist
	cd ../src/os/`java -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) clean
	rm -rf $(BUILD_DIR)/*