make/solaris/Makefile

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 4942
f36e073d56a4
parent 0
f90c822e73f8
child 7535
7ae4e26cb1e0
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # This makefile creates a build tree and lights off a build.
aoqi@0 26 # You can go back into the build tree and perform rebuilds or
aoqi@0 27 # incremental builds as desired. Be sure to reestablish
aoqi@0 28 # environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
aoqi@0 29
aoqi@0 30 # The make process now relies on java and javac. These can be
aoqi@0 31 # specified either implicitly on the PATH, by setting the
aoqi@0 32 # (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
aoqi@0 33 # JDK in which bin/java and bin/javac are present and working (e.g.,
aoqi@0 34 # /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
aoqi@0 35 # default BOOTDIR path value. Note that one of ALT_BOOTDIR
aoqi@0 36 # or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
aoqi@0 37 # from the PATH.
aoqi@0 38
aoqi@0 39 # Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
aoqi@0 40 # JDI binding on SA produces two binaries:
aoqi@0 41 # 1. sa-jdi.jar - This is built before building libjvm.so
aoqi@0 42 # Please refer to ./makefiles/sa.make
aoqi@0 43 # 2. libsaproc.so - Native library for SA - This is built after
aoqi@0 44 # libjsig.so (signal interposition library)
aoqi@0 45 # Please refer to ./makefiles/vm.make
aoqi@0 46 # If $(GAMMADIR)/agent dir is not present, SA components are not built.
aoqi@0 47
aoqi@0 48 ifeq ($(GAMMADIR),)
aoqi@0 49 include ../../make/defs.make
aoqi@0 50 else
aoqi@0 51 include $(GAMMADIR)/make/defs.make
aoqi@0 52 endif
aoqi@0 53 include $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
aoqi@0 54
aoqi@0 55 ifndef CC_INTERP
aoqi@0 56 ifndef FORCE_TIERED
aoqi@0 57 FORCE_TIERED=1
aoqi@0 58 endif
aoqi@0 59 endif
aoqi@0 60
aoqi@0 61 ifdef LP64
aoqi@0 62 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
aoqi@0 63 _JUNK_ := $(shell echo >&2 \
aoqi@0 64 $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
aoqi@0 65 @exit 1
aoqi@0 66 endif
aoqi@0 67 endif
aoqi@0 68
aoqi@0 69 # The following renders pathnames in generated Makefiles valid on
aoqi@0 70 # machines other than the machine containing the build tree.
aoqi@0 71 #
aoqi@0 72 # For example, let's say my build tree lives on /files12 on
aoqi@0 73 # exact.east.sun.com. This logic will cause GAMMADIR to begin with
aoqi@0 74 # /net/exact/files12/...
aoqi@0 75 #
aoqi@0 76 # We only do this on SunOS variants, for a couple of reasons:
aoqi@0 77 # * It is extremely rare that source trees exist on other systems
aoqi@0 78 # * It has been claimed that the Linux automounter is flakey, so
aoqi@0 79 # changing GAMMADIR in a way that exercises the automounter could
aoqi@0 80 # prove to be a source of unreliability in the build process.
aoqi@0 81 # Obviously, this Makefile is only relevant on SunOS boxes to begin
aoqi@0 82 # with, but the SunOS conditionalization will make it easier to
aoqi@0 83 # combine Makefiles in the future (assuming we ever do that).
aoqi@0 84
aoqi@0 85 ifeq ($(OSNAME),solaris)
aoqi@0 86
aoqi@0 87 # prepend current directory to relative pathnames.
aoqi@0 88 NEW_GAMMADIR := \
aoqi@0 89 $(shell echo $(GAMMADIR) | \
aoqi@0 90 sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \
aoqi@0 91 )
aoqi@0 92 unexport NEW_GAMMADIR
aoqi@0 93
aoqi@0 94 # If NEW_GAMMADIR doesn't already start with "/net/":
aoqi@0 95 ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
aoqi@0 96 # prepend /net/$(HOST)
aoqi@0 97 # remove /net/$(HOST) if name already began with /home/
aoqi@0 98 # remove /net/$(HOST) if name already began with /java/
aoqi@0 99 # remove /net/$(HOST) if name already began with /lab/
aoqi@0 100 NEW_GAMMADIR := \
aoqi@0 101 $(shell echo $(NEW_GAMMADIR) | \
aoqi@0 102 sed -e "s=^\(.*\)=/net/$(HOST)\1=" \
aoqi@0 103 -e "s=^/net/$(HOST)/home/=/home/=" \
aoqi@0 104 -e "s=^/net/$(HOST)/java/=/java/=" \
aoqi@0 105 -e "s=^/net/$(HOST)/lab/=/lab/=" \
aoqi@0 106 )
aoqi@0 107 # Don't use the new value for GAMMADIR unless a file with the new
aoqi@0 108 # name actually exists.
aoqi@0 109 ifneq ($(wildcard $(NEW_GAMMADIR)),)
aoqi@0 110 GAMMADIR := $(NEW_GAMMADIR)
aoqi@0 111 endif
aoqi@0 112 endif
aoqi@0 113
aoqi@0 114 endif
aoqi@0 115
aoqi@0 116
aoqi@0 117 # There is a (semi-) regular correspondence between make targets and actions:
aoqi@0 118 #
aoqi@0 119 # Target Tree Type Build Dir
aoqi@0 120 #
aoqi@0 121 # debug compiler2 <os>_<arch>_compiler2/debug
aoqi@0 122 # fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
aoqi@0 123 # optimized compiler2 <os>_<arch>_compiler2/optimized
aoqi@0 124 # product compiler2 <os>_<arch>_compiler2/product
aoqi@0 125 #
aoqi@0 126 # debug1 compiler1 <os>_<arch>_compiler1/debug
aoqi@0 127 # fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
aoqi@0 128 # optimized1 compiler1 <os>_<arch>_compiler1/optimized
aoqi@0 129 # product1 compiler1 <os>_<arch>_compiler1/product
aoqi@0 130 #
aoqi@0 131 # debugcore core <os>_<arch>_core/debug
aoqi@0 132 # fastdebugcore core <os>_<arch>_core/fastdebug
aoqi@0 133 # optimizedcore core <os>_<arch>_core/optimized
aoqi@0 134 # productcore core <os>_<arch>_core/product
aoqi@0 135 #
aoqi@0 136 # What you get with each target:
aoqi@0 137 #
aoqi@0 138 # debug* - debug compile with asserts enabled
aoqi@0 139 # fastdebug* - optimized compile, but with asserts enabled
aoqi@0 140 # optimized* - optimized compile, no asserts
aoqi@0 141 # product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
aoqi@0 142
aoqi@0 143 # This target list needs to be coordinated with the usage message
aoqi@0 144 # in the build.sh script:
aoqi@0 145 TARGETS = debug fastdebug optimized product
aoqi@0 146
aoqi@0 147 SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
aoqi@0 148 SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
aoqi@0 149 SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
aoqi@0 150 SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
aoqi@0 151 SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
aoqi@0 152
aoqi@0 153 TARGETS_C2 = $(TARGETS)
aoqi@0 154 TARGETS_C1 = $(addsuffix 1,$(TARGETS))
aoqi@0 155 TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
aoqi@0 156 TARGETS_CORE = $(addsuffix core,$(TARGETS))
aoqi@0 157
aoqi@0 158 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
aoqi@0 159 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
aoqi@0 160 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
aoqi@0 161 BUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
aoqi@0 162
aoqi@0 163 BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
aoqi@0 164
aoqi@0 165 #-------------------------------------------------------------------------------
aoqi@0 166
aoqi@0 167 # Could make everything by default, but that would take a while.
aoqi@0 168 all:
aoqi@0 169 @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
aoqi@0 170 @echo " $(TARGETS_C2)"
aoqi@0 171 @echo " $(TARGETS_C1)"
aoqi@0 172 @echo " $(TARGETS_CORE)"
aoqi@0 173
aoqi@0 174 checks: check_os_version check_j2se_version
aoqi@0 175
aoqi@0 176 # We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
aoqi@0 177 # Solaris 2.5.1, 2.6).
aoqi@0 178 # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
aoqi@0 179
aoqi@0 180 SUPPORTED_OS_VERSION = 5.7 5.8 5.9 5.10 5.11
aoqi@0 181 OS_VERSION := $(shell uname -r)
aoqi@0 182 EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
aoqi@0 183
aoqi@0 184 check_os_version:
aoqi@0 185 ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
aoqi@0 186 $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
aoqi@0 187 endif
aoqi@0 188
aoqi@0 189 # jvmti.make requires XSLT (J2SE 1.4.x or newer):
aoqi@0 190 XSLT_CHECK = $(RUN.JAVAP) javax.xml.transform.TransformerFactory
aoqi@0 191 # If not found then fail fast.
aoqi@0 192 check_j2se_version:
aoqi@0 193 $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
aoqi@0 194 if [ $$? -ne 0 ]; then \
aoqi@0 195 $(RUN.JAVA) -version; \
aoqi@0 196 echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
aoqi@0 197 "to bootstrap this build" 1>&2; \
aoqi@0 198 exit 1; \
aoqi@0 199 fi
aoqi@0 200
aoqi@0 201 $(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
aoqi@0 202 $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aoqi@0 203 $(BUILDTREE) VARIANT=tiered
aoqi@0 204
aoqi@0 205 $(SUBDIRS_C2): $(BUILDTREE_MAKE)
aoqi@0 206 ifeq ($(FORCE_TIERED),1)
aoqi@0 207 $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aoqi@0 208 $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
aoqi@0 209 else
aoqi@0 210 $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aoqi@0 211 $(BUILDTREE) VARIANT=compiler2
aoqi@0 212 endif
aoqi@0 213
aoqi@0 214 $(SUBDIRS_C1): $(BUILDTREE_MAKE)
aoqi@0 215 $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aoqi@0 216 $(BUILDTREE) VARIANT=compiler1
aoqi@0 217
aoqi@0 218 $(SUBDIRS_CORE): $(BUILDTREE_MAKE)
aoqi@0 219 $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aoqi@0 220 $(BUILDTREE) VARIANT=core
aoqi@0 221
aoqi@0 222 # Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
aoqi@0 223
aoqi@0 224 $(TARGETS_C2): $(SUBDIRS_C2)
aoqi@0 225 cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
aoqi@0 226 ifdef INSTALL
aoqi@0 227 cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
aoqi@0 228 endif
aoqi@0 229
aoqi@0 230 $(TARGETS_TIERED): $(SUBDIRS_TIERED)
aoqi@0 231 cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
aoqi@0 232 ifdef INSTALL
aoqi@0 233 cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
aoqi@0 234 endif
aoqi@0 235
aoqi@0 236 $(TARGETS_C1): $(SUBDIRS_C1)
aoqi@0 237 cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
aoqi@0 238 ifdef INSTALL
aoqi@0 239 cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
aoqi@0 240 endif
aoqi@0 241
aoqi@0 242 $(TARGETS_CORE): $(SUBDIRS_CORE)
aoqi@0 243 cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
aoqi@0 244 ifdef INSTALL
aoqi@0 245 cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
aoqi@0 246 endif
aoqi@0 247
aoqi@0 248 # Just build the tree, and nothing else:
aoqi@0 249 tree: $(SUBDIRS_C2)
aoqi@0 250 tree1: $(SUBDIRS_C1)
aoqi@0 251 treecore: $(SUBDIRS_CORE)
aoqi@0 252
aoqi@0 253 # Doc target. This is the same for all build options.
aoqi@0 254 # Hence create a docs directory beside ...$(ARCH)_[...]
aoqi@0 255 # We specify 'BUILD_FLAVOR=product' so that the proper
aoqi@0 256 # ENABLE_FULL_DEBUG_SYMBOLS value is used.
aoqi@0 257 docs: checks
aoqi@0 258 $(QUIETLY) mkdir -p $(SUBDIR_DOCS)
aoqi@0 259 $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
aoqi@0 260
aoqi@0 261 # Synonyms for win32-like targets.
aoqi@0 262 compiler2: debug product
aoqi@0 263
aoqi@0 264 compiler1: debug1 product1
aoqi@0 265
aoqi@0 266 core: debugcore productcore
aoqi@0 267
aoqi@0 268 warn_jvmg_deprecated:
aoqi@0 269 echo "Warning: The jvmg target has been replaced with debug"
aoqi@0 270 echo "Warning: Please update your usage"
aoqi@0 271
aoqi@0 272 jvmg: warn_jvmg_deprecated debug
aoqi@0 273
aoqi@0 274 jvmg1: warn_jvmg_deprecated debug1
aoqi@0 275
aoqi@0 276 jvmgcore: warn_jvmg_deprecated debugcore
aoqi@0 277
aoqi@0 278 clean_docs:
aoqi@0 279 rm -rf $(SUBDIR_DOCS)
aoqi@0 280
aoqi@0 281 clean_compiler1 clean_compiler2 clean_core:
aoqi@0 282 rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
aoqi@0 283
aoqi@0 284 clean: clean_compiler2 clean_compiler1 clean_core clean_docs
aoqi@0 285
aoqi@0 286 include $(GAMMADIR)/make/cscope.make
aoqi@0 287
aoqi@0 288 #-------------------------------------------------------------------------------
aoqi@0 289
aoqi@0 290 .PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE)
aoqi@0 291 .PHONY: tree tree1 treecore
aoqi@0 292 .PHONY: all compiler1 compiler2 core
aoqi@0 293 .PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs
aoqi@0 294 .PHONY: checks check_os_version check_j2se_version

mercurial