agent/make/Makefile

Tue, 03 May 2011 20:56:35 -0700

author
never
date
Tue, 03 May 2011 20:56:35 -0700
changeset 2872
eae35325e5e1
parent 1907
c18cbe5936b8
child 3138
f6f3bb0ee072
permissions
-rw-r--r--

7041603: standalone SA doesn't build after 7010849
Reviewed-by: dcubed

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

mercurial