agent/make/Makefile

changeset 435
a61af66fc99e
child 587
c70a245cad3a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/agent/make/Makefile	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,312 @@
     1.4 +#
     1.5 +# Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.
    1.11 +#
    1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 +# version 2 for more details (a copy is included in the LICENSE file that
    1.16 +# accompanied this code).
    1.17 +#
    1.18 +# You should have received a copy of the GNU General Public License version
    1.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 +#
    1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or
    1.24 +# have any questions.
    1.25 +#  
    1.26 +#
    1.27 +
    1.28 +# This guards against adding broken .java files to the directory
    1.29 +# hierarchy, but may be a pain to keep in sync
    1.30 +
    1.31 +# Generated using the build-pkglist script
    1.32 +ifeq "x$(GAMMADIR)" "x"
    1.33 +include ../../make/defs.make
    1.34 +else
    1.35 +include $(GAMMADIR)/make/defs.make
    1.36 +endif
    1.37 +
    1.38 +PKGLIST = \
    1.39 +sun.jvm.hotspot \
    1.40 +sun.jvm.hotspot.asm \
    1.41 +sun.jvm.hotspot.asm.amd64 \
    1.42 +sun.jvm.hotspot.asm.ia64 \
    1.43 +sun.jvm.hotspot.asm.sparc \
    1.44 +sun.jvm.hotspot.asm.x86 \
    1.45 +sun.jvm.hotspot.bugspot \
    1.46 +sun.jvm.hotspot.bugspot.tree \
    1.47 +sun.jvm.hotspot.c1 \
    1.48 +sun.jvm.hotspot.code \
    1.49 +sun.jvm.hotspot.compiler \
    1.50 +sun.jvm.hotspot.debugger \
    1.51 +sun.jvm.hotspot.debugger.amd64 \
    1.52 +sun.jvm.hotspot.debugger.cdbg \
    1.53 +sun.jvm.hotspot.debugger.cdbg.basic \
    1.54 +sun.jvm.hotspot.debugger.cdbg.basic.amd64 \
    1.55 +sun.jvm.hotspot.debugger.cdbg.basic.x86 \
    1.56 +sun.jvm.hotspot.debugger.dbx \
    1.57 +sun.jvm.hotspot.debugger.dbx.sparc \
    1.58 +sun.jvm.hotspot.debugger.dbx.x86 \
    1.59 +sun.jvm.hotspot.debugger.dummy \
    1.60 +sun.jvm.hotspot.debugger.ia64 \
    1.61 +sun.jvm.hotspot.debugger.linux \
    1.62 +sun.jvm.hotspot.debugger.linux.amd64 \
    1.63 +sun.jvm.hotspot.debugger.linux.ia64 \
    1.64 +sun.jvm.hotspot.debugger.linux.x86 \
    1.65 +sun.jvm.hotspot.debugger.posix \
    1.66 +sun.jvm.hotspot.debugger.posix.elf \
    1.67 +sun.jvm.hotspot.debugger.proc \
    1.68 +sun.jvm.hotspot.debugger.proc.amd64 \
    1.69 +sun.jvm.hotspot.debugger.proc.sparc \
    1.70 +sun.jvm.hotspot.debugger.proc.x86 \
    1.71 +sun.jvm.hotspot.debugger.remote \
    1.72 +sun.jvm.hotspot.debugger.remote.amd64 \
    1.73 +sun.jvm.hotspot.debugger.remote.sparc \
    1.74 +sun.jvm.hotspot.debugger.remote.x86 \
    1.75 +sun.jvm.hotspot.debugger.sparc \
    1.76 +sun.jvm.hotspot.debugger.win32 \
    1.77 +sun.jvm.hotspot.debugger.win32.coff \
    1.78 +sun.jvm.hotspot.debugger.windbg \
    1.79 +sun.jvm.hotspot.debugger.windbg.amd64 \
    1.80 +sun.jvm.hotspot.debugger.windbg.ia64 \
    1.81 +sun.jvm.hotspot.debugger.windbg.x86 \
    1.82 +sun.jvm.hotspot.debugger.x86 \
    1.83 +sun.jvm.hotspot.gc_implementation \
    1.84 +sun.jvm.hotspot.gc_implementation.parallelScavenge \
    1.85 +sun.jvm.hotspot.gc_implementation.shared \
    1.86 +sun.jvm.hotspot.gc_interface \
    1.87 +sun.jvm.hotspot.interpreter \
    1.88 +sun.jvm.hotspot.jdi \
    1.89 +sun.jvm.hotspot.livejvm \
    1.90 +sun.jvm.hotspot.memory \
    1.91 +sun.jvm.hotspot.oops \
    1.92 +sun.jvm.hotspot.runtime \
    1.93 +sun.jvm.hotspot.runtime.amd64 \
    1.94 +sun.jvm.hotspot.runtime.ia64 \
    1.95 +sun.jvm.hotspot.runtime.linux \
    1.96 +sun.jvm.hotspot.runtime.linux_amd64 \
    1.97 +sun.jvm.hotspot.runtime.linux_ia64 \
    1.98 +sun.jvm.hotspot.runtime.linux_sparc \
    1.99 +sun.jvm.hotspot.runtime.linux_x86 \
   1.100 +sun.jvm.hotspot.runtime.posix \
   1.101 +sun.jvm.hotspot.runtime.solaris_amd64 \
   1.102 +sun.jvm.hotspot.runtime.solaris_sparc \
   1.103 +sun.jvm.hotspot.runtime.solaris_x86 \
   1.104 +sun.jvm.hotspot.runtime.sparc \
   1.105 +sun.jvm.hotspot.runtime.win32_amd64 \
   1.106 +sun.jvm.hotspot.runtime.win32_ia64 \
   1.107 +sun.jvm.hotspot.runtime.win32_x86 \
   1.108 +sun.jvm.hotspot.runtime.x86 \
   1.109 +sun.jvm.hotspot.tools \
   1.110 +sun.jvm.hotspot.tools.jcore \
   1.111 +sun.jvm.hotspot.tools.soql \
   1.112 +sun.jvm.hotspot.types \
   1.113 +sun.jvm.hotspot.types.basic \
   1.114 +sun.jvm.hotspot.ui \
   1.115 +sun.jvm.hotspot.ui.action \
   1.116 +sun.jvm.hotspot.ui.classbrowser \
   1.117 +sun.jvm.hotspot.ui.resources \
   1.118 +sun.jvm.hotspot.ui.table \
   1.119 +sun.jvm.hotspot.ui.tree \
   1.120 +sun.jvm.hotspot.ui.treetable \
   1.121 +sun.jvm.hotspot.utilities \
   1.122 +sun.jvm.hotspot.utilities.memo \
   1.123 +sun.jvm.hotspot.utilities.soql
   1.124 +#END PKGLIST
   1.125 +
   1.126 +# Generated using the build-filelist script
   1.127 +FILELIST = \
   1.128 +sun/jvm/hotspot/*.java \
   1.129 +sun/jvm/hotspot/asm/*.java \
   1.130 +sun/jvm/hotspot/asm/amd64/*.java \
   1.131 +sun/jvm/hotspot/asm/ia64/*.java \
   1.132 +sun/jvm/hotspot/asm/sparc/*.java \
   1.133 +sun/jvm/hotspot/asm/x86/*.java \
   1.134 +sun/jvm/hotspot/bugspot/*.java \
   1.135 +sun/jvm/hotspot/bugspot/tree/*.java \
   1.136 +sun/jvm/hotspot/c1/*.java \
   1.137 +sun/jvm/hotspot/code/*.java \
   1.138 +sun/jvm/hotspot/compiler/*.java \
   1.139 +sun/jvm/hotspot/debugger/*.java \
   1.140 +sun/jvm/hotspot/debugger/amd64/*.java \
   1.141 +sun/jvm/hotspot/debugger/cdbg/*.java \
   1.142 +sun/jvm/hotspot/debugger/cdbg/basic/*.java \
   1.143 +sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \
   1.144 +sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \
   1.145 +sun/jvm/hotspot/debugger/dbx/*.java \
   1.146 +sun/jvm/hotspot/debugger/dbx/sparc/*.java \
   1.147 +sun/jvm/hotspot/debugger/dbx/x86/*.java \
   1.148 +sun/jvm/hotspot/debugger/dummy/*.java \
   1.149 +sun/jvm/hotspot/debugger/ia64/*.java \
   1.150 +sun/jvm/hotspot/debugger/linux/*.java \
   1.151 +sun/jvm/hotspot/debugger/linux/x86/*.java \
   1.152 +sun/jvm/hotspot/debugger/posix/*.java \
   1.153 +sun/jvm/hotspot/debugger/posix/elf/*.java \
   1.154 +sun/jvm/hotspot/debugger/proc/*.java \
   1.155 +sun/jvm/hotspot/debugger/proc/amd64/*.java \
   1.156 +sun/jvm/hotspot/debugger/proc/sparc/*.java \
   1.157 +sun/jvm/hotspot/debugger/proc/x86/*.java \
   1.158 +sun/jvm/hotspot/debugger/remote/*.java \
   1.159 +sun/jvm/hotspot/debugger/remote/amd64/*.java \
   1.160 +sun/jvm/hotspot/debugger/remote/sparc/*.java \
   1.161 +sun/jvm/hotspot/debugger/remote/x86/*.java \
   1.162 +sun/jvm/hotspot/debugger/sparc/*.java \
   1.163 +sun/jvm/hotspot/debugger/win32/*.java \
   1.164 +sun/jvm/hotspot/debugger/win32/coff/*.java \
   1.165 +sun/jvm/hotspot/debugger/windbg/*.java \
   1.166 +sun/jvm/hotspot/debugger/windbg/ia64/*.java \
   1.167 +sun/jvm/hotspot/debugger/windbg/x86/*.java \
   1.168 +sun/jvm/hotspot/debugger/x86/*.java \
   1.169 +sun/jvm/hotspot/interpreter/*.java \
   1.170 +sun/jvm/hotspot/jdi/*.java \
   1.171 +sun/jvm/hotspot/livejvm/*.java \
   1.172 +sun/jvm/hotspot/memory/*.java \
   1.173 +sun/jvm/hotspot/oops/*.java \
   1.174 +sun/jvm/hotspot/runtime/*.java \
   1.175 +sun/jvm/hotspot/runtime/amd64/*.java \
   1.176 +sun/jvm/hotspot/runtime/ia64/*.java \
   1.177 +sun/jvm/hotspot/runtime/linux/*.java \
   1.178 +sun/jvm/hotspot/runtime/linux_amd64/*.java \
   1.179 +sun/jvm/hotspot/runtime/linux_ia64/*.java \
   1.180 +sun/jvm/hotspot/runtime/linux_sparc/*.java \
   1.181 +sun/jvm/hotspot/runtime/linux_x86/*.java \
   1.182 +sun/jvm/hotspot/runtime/posix/*.java \
   1.183 +sun/jvm/hotspot/runtime/solaris_amd64/*.java \
   1.184 +sun/jvm/hotspot/runtime/solaris_sparc/*.java \
   1.185 +sun/jvm/hotspot/runtime/solaris_x86/*.java \
   1.186 +sun/jvm/hotspot/runtime/sparc/*.java \
   1.187 +sun/jvm/hotspot/runtime/win32_amd64/*.java \
   1.188 +sun/jvm/hotspot/runtime/win32_ia64/*.java \
   1.189 +sun/jvm/hotspot/runtime/win32_x86/*.java \
   1.190 +sun/jvm/hotspot/runtime/x86/*.java \
   1.191 +sun/jvm/hotspot/tools/*.java \
   1.192 +sun/jvm/hotspot/tools/jcore/*.java \
   1.193 +sun/jvm/hotspot/tools/soql/*.java \
   1.194 +sun/jvm/hotspot/types/*.java \
   1.195 +sun/jvm/hotspot/types/basic/*.java \
   1.196 +sun/jvm/hotspot/ui/*.java \
   1.197 +sun/jvm/hotspot/ui/action/*.java \
   1.198 +sun/jvm/hotspot/ui/classbrowser/*.java \
   1.199 +sun/jvm/hotspot/ui/table/*.java \
   1.200 +sun/jvm/hotspot/ui/tree/*.java \
   1.201 +sun/jvm/hotspot/ui/treetable/*.java \
   1.202 +sun/jvm/hotspot/utilities/*.java \
   1.203 +sun/jvm/hotspot/utilities/memo/*.java \
   1.204 +sun/jvm/hotspot/utilities/soql/*.java 
   1.205 +#END FILELIST
   1.206 +
   1.207 +ifneq "x$(ALT_BOOTDIR)" "x"
   1.208 +  BOOTDIR := $(ALT_BOOTDIR)
   1.209 +endif
   1.210 +
   1.211 +ifeq "x$(BOOTDIR)" "x"
   1.212 +  JDK_HOME := $(shell dirname $(shell which java))/..
   1.213 +else
   1.214 +  JDK_HOME := $(BOOTDIR)
   1.215 +endif
   1.216 +
   1.217 +isUnix := $(shell test -r c:/; echo $$?)
   1.218 +
   1.219 +ifeq "$(isUnix)" "1"
   1.220 +    CPS := :
   1.221 +else
   1.222 +    CPS := ";"
   1.223 +endif
   1.224 +
   1.225 +SRC_DIR    = ../src/share/classes
   1.226 +LIB_DIR    = ../src/share/lib
   1.227 +CLOSED_LIB_DIR    = ../closed/src/share/lib
   1.228 +BUILD_DIR  = ../build
   1.229 +OUTPUT_DIR = $(BUILD_DIR)/classes
   1.230 +DOC_DIR    = $(BUILD_DIR)/doc
   1.231 +
   1.232 +# gnumake 3.78.1 does not accept the *s, 
   1.233 +# so use the shell to expand them
   1.234 +ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
   1.235 +ALLFILES := $(shell /bin/ls $(ALLFILES))
   1.236 +
   1.237 +
   1.238 +# tools.jar is needed by the JDI - SA binding
   1.239 +CLASSPATH = $(LIB_DIR)/maf-1_0.jar$(CPS)$(JDK_HOME)/lib/tools.jar
   1.240 +CLASSPATH := $(subst \,/,$(CLASSPATH))
   1.241 +
   1.242 +# FIXME: autogenerate call to rmic
   1.243 +
   1.244 +SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
   1.245 +
   1.246 +SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
   1.247 +
   1.248 +# Tagging it on because there's no reason not to run it
   1.249 +all: filelist
   1.250 +	@mkdir -p $(OUTPUT_DIR)
   1.251 +	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
   1.252 +	@javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
   1.253 +	@rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
   1.254 +	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
   1.255 +	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
   1.256 +
   1.257 +allprof: filelist
   1.258 +	@mkdir -p $(OUTPUT_DIR)
   1.259 +	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
   1.260 +	@javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
   1.261 +	@rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
   1.262 +	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
   1.263 +	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
   1.264 +
   1.265 +filelist: $(ALLFILES)
   1.266 +	@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
   1.267 +          echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
   1.268 +          echo ""; \
   1.269 +          exit 1; \
   1.270 +        fi
   1.271 +	@rm -f $@
   1.272 +	@echo $(ALLFILES) > $@
   1.273 +
   1.274 +.PHONY: natives
   1.275 +natives:
   1.276 +	cd ../src/os/`java -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) all
   1.277 +
   1.278 +.PHONY: sa-jdi.jar
   1.279 +sa-jdi.jar:
   1.280 +	if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
   1.281 +          echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA.";\
   1.282 +          exit 1; \
   1.283 +        fi
   1.284 +	rm -f $(BUILD_DIR)/sa-jdi.jar
   1.285 +	rm -f $(OUTPUT_DIR)/jdi_class_files
   1.286 +	javac -source 1.4 ClosureFinder.java -d $(OUTPUT_DIR)
   1.287 +	cd $(OUTPUT_DIR) ; find sun/jvm/hotspot/jdi -name "*.class" > jdi_class_files
   1.288 +	cd $(OUTPUT_DIR) ; jar cvf ../sa-jdi.jar `java ClosureFinder jdi_class_files .`
   1.289 +	cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
   1.290 +	cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(OUTPUT_DIR) sa.properties
   1.291 +	rm -f $(OUTPUT_DIR)/ClosureFinder.class
   1.292 +	rm -f $(OUTPUT_DIR)/jdi_class_files
   1.293 +
   1.294 +docs:
   1.295 +	@javadoc -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
   1.296 +
   1.297 +sizes: $(ALLFILES)
   1.298 +	wc -l $(ALLFILES)
   1.299 +
   1.300 +cscope: $(ALLFILES)
   1.301 +	echo $(ALLFILES) > java.files
   1.302 +	cscope -b -i java.files -f java.out 
   1.303 +
   1.304 +.PHONY: sa.jar
   1.305 +sa.jar:
   1.306 +	rm -f $(BUILD_DIR)/sa.jar
   1.307 +	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
   1.308 +	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
   1.309 +	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
   1.310 +	cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *
   1.311 +
   1.312 +clean::
   1.313 +	rm -rf filelist
   1.314 +	cd ../src/os/`java -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) clean
   1.315 +	rm -rf $(BUILD_DIR)/*

mercurial