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