make/linux/makefiles/vm.make

Thu, 12 Oct 2017 21:27:07 +0800

author
aoqi
date
Thu, 12 Oct 2017 21:27:07 +0800
changeset 7535
7ae4e26cb1e0
parent 7059
f933a15469d4
parent 6876
710a3c8b516e
child 7994
04ff2f6cd0eb
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 1999, 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@1 25 #
aoqi@1 26 # This file has been modified by Loongson Technology in 2015. These
aoqi@1 27 # modifications are Copyright (c) 2015 Loongson Technology, and are made
aoqi@1 28 # available on the same license terms set forth above.
aoqi@1 29 #
aoqi@1 30
aoqi@0 31 # Rules to build JVM and related libraries, included from vm.make in the build
aoqi@0 32 # directory.
aoqi@0 33
aoqi@0 34 # Common build rules.
aoqi@0 35 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
aoqi@0 36 include $(MAKEFILES_DIR)/rules.make
aoqi@0 37 include $(GAMMADIR)/make/altsrc.make
aoqi@0 38
aoqi@0 39 default: build
aoqi@0 40
aoqi@0 41 #----------------------------------------------------------------------
aoqi@0 42 # Defs
aoqi@0 43
aoqi@0 44 GENERATED = ../generated
aoqi@0 45 DEP_DIR = $(GENERATED)/dependencies
aoqi@0 46
aoqi@0 47 # reads the generated files defining the set of .o's and the .o .h dependencies
aoqi@0 48 -include $(DEP_DIR)/*.d
aoqi@0 49
aoqi@0 50 # read machine-specific adjustments (%%% should do this via buildtree.make?)
aoqi@0 51 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
aoqi@0 52 include $(MAKEFILES_DIR)/zeroshark.make
aoqi@0 53 else
aoqi@0 54 include $(MAKEFILES_DIR)/$(BUILDARCH).make
aoqi@0 55 -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
aoqi@0 56 endif
aoqi@0 57
aoqi@0 58 # set VPATH so make knows where to look for source files
aoqi@0 59 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
aoqi@0 60 # The adfiles directory contains ad_<arch>.[ch]pp.
aoqi@0 61 # The jvmtifiles directory contains jvmti*.[ch]pp
aoqi@0 62 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
aoqi@0 63 VPATH += $(Src_Dirs_V:%=%:)
aoqi@0 64
aoqi@0 65 # set INCLUDES for C preprocessor.
aoqi@0 66 Src_Dirs_I += $(GENERATED)
aoqi@0 67 # The order is important for the precompiled headers to work.
aoqi@0 68 INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
aoqi@0 69
aoqi@0 70 # SYMFLAG is used by {jsig,saproc}.make
aoqi@0 71 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
aoqi@0 72 # always build with debug info when we can create .debuginfo files
aoqi@0 73 SYMFLAG = -g
aoqi@0 74 else
aoqi@0 75 ifeq (${VERSION}, debug)
aoqi@0 76 SYMFLAG = -g
aoqi@0 77 else
aoqi@0 78 SYMFLAG =
aoqi@0 79 endif
aoqi@0 80 endif
aoqi@0 81
aoqi@0 82 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
aoqi@0 83 # in $(GAMMADIR)/make/defs.make
aoqi@0 84 ifeq ($(HOTSPOT_BUILD_VERSION),)
aoqi@0 85 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
aoqi@0 86 else
aoqi@0 87 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
aoqi@0 88 endif
aoqi@0 89
aoqi@0 90 # The following variables are defined in the generated flags.make file.
aoqi@0 91 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
aoqi@0 92 JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
aoqi@0 93 HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
aoqi@0 94 BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
aoqi@0 95 BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
aoqi@0 96 VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
aoqi@0 97
aoqi@0 98 CXXFLAGS = \
aoqi@0 99 ${SYSDEFS} \
aoqi@0 100 ${INCLUDES} \
aoqi@0 101 ${BUILD_VERSION} \
aoqi@0 102 ${BUILD_TARGET} \
aoqi@0 103 ${BUILD_USER} \
aoqi@0 104 ${HS_LIB_ARCH} \
aoqi@0 105 ${VM_DISTRO}
aoqi@0 106
aoqi@1 107 ifeq ($(MIPS_ABI),n32)
aoqi@1 108 CXXFLAGS += -DN32
aoqi@1 109 else
aoqi@1 110 ifeq ($(MIPS_ABI),n64)
aoqi@1 111 CXXFLAGS += -DN64
aoqi@1 112 endif
aoqi@1 113 endif
aoqi@0 114 # This is VERY important! The version define must only be supplied to vm_version.o
aoqi@0 115 # If not, ccache will not re-use the cache at all, since the version string might contain
aoqi@0 116 # a time and date.
aoqi@0 117 CXXFLAGS/vm_version.o += ${JRE_VERSION}
aoqi@0 118
aoqi@0 119 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
aoqi@0 120
aoqi@0 121 # File specific flags
aoqi@0 122 CXXFLAGS += $(CXXFLAGS/BYFILE)
aoqi@0 123
aoqi@0 124 # Large File Support
aoqi@0 125 ifneq ($(LP64), 1)
aoqi@0 126 CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64
aoqi@0 127 endif # ifneq ($(LP64), 1)
aoqi@0 128
aoqi@0 129 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
aoqi@0 130 CFLAGS += $(CFLAGS_WARN/BYFILE)
aoqi@0 131
aoqi@0 132 # Do not use C++ exception handling
aoqi@0 133 CFLAGS += $(CFLAGS/NOEX)
aoqi@0 134
aoqi@0 135 # Extra flags from gnumake's invocation or environment
aoqi@0 136 CFLAGS += $(EXTRA_CFLAGS)
aoqi@0 137 LFLAGS += $(EXTRA_CFLAGS)
aoqi@0 138
aoqi@0 139 # Don't set excutable bit on stack segment
aoqi@0 140 # the same could be done by separate execstack command
aoqi@0 141 LFLAGS += -Xlinker -z -Xlinker noexecstack
aoqi@0 142
aoqi@0 143 LIBS += -lm -ldl -lpthread
aoqi@0 144
aoqi@0 145 # By default, link the *.o into the library, not the executable.
aoqi@0 146 LINK_INTO$(LINK_INTO) = LIBJVM
aoqi@0 147
aoqi@0 148 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
aoqi@0 149
aoqi@0 150 #----------------------------------------------------------------------
aoqi@0 151 # jvm_db & dtrace
aoqi@0 152 include $(MAKEFILES_DIR)/dtrace.make
aoqi@0 153
aoqi@0 154 #----------------------------------------------------------------------
aoqi@0 155 # JVM
aoqi@0 156
aoqi@0 157 JVM = jvm
aoqi@0 158 LIBJVM = lib$(JVM).so
aoqi@0 159
aoqi@0 160 LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
aoqi@0 161 LIBJVM_DIZ = lib$(JVM).diz
aoqi@0 162
aoqi@0 163 SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
aoqi@0 164
aoqi@0 165 SOURCE_PATHS=\
aoqi@0 166 $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
aoqi@0 167 \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
aoqi@0 168 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
aoqi@0 169 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
aoqi@0 170 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
aoqi@0 171 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
aoqi@0 172
aoqi@0 173 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
aoqi@0 174 CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
aoqi@0 175
aoqi@0 176 ifneq ($(INCLUDE_TRACE), false)
aoqi@0 177 CORE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
aoqi@0 178 find $(HS_ALT_SRC)/share/vm/jfr -type d; \
aoqi@0 179 fi)
aoqi@0 180 endif
aoqi@0 181
aoqi@0 182 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
aoqi@0 183 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
aoqi@0 184
aoqi@0 185 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
aoqi@0 186 COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
aoqi@0 187 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
aoqi@0 188 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
aoqi@0 189 COMPILER2_PATHS += $(GENERATED)/adfiles
aoqi@0 190
aoqi@0 191 SHARK_PATHS := $(GAMMADIR)/src/share/vm/shark
aoqi@0 192
aoqi@0 193 # Include dirs per type.
aoqi@0 194 Src_Dirs/CORE := $(CORE_PATHS)
aoqi@0 195 Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
aoqi@0 196 Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
aoqi@0 197 Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
aoqi@0 198 Src_Dirs/ZERO := $(CORE_PATHS)
aoqi@0 199 Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS)
aoqi@0 200 Src_Dirs := $(Src_Dirs/$(TYPE))
aoqi@0 201
aoqi@0 202 COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*
aoqi@0 203 COMPILER1_SPECIFIC_FILES := c1_\*
aoqi@0 204 SHARK_SPECIFIC_FILES := shark
aoqi@0 205 ZERO_SPECIFIC_FILES := zero
aoqi@0 206
aoqi@0 207 # Always exclude these.
aoqi@0 208 Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
aoqi@0 209
aoqi@0 210 # Exclude per type.
aoqi@0 211 Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
aoqi@0 212 Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
aoqi@0 213 Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
aoqi@0 214 Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
aoqi@0 215 Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
aoqi@0 216 Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
aoqi@0 217
aoqi@0 218 Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE))
aoqi@0 219
aoqi@0 220 # Special handling of arch model.
aoqi@0 221 ifeq ($(Platform_arch_model), x86_32)
aoqi@0 222 Src_Files_EXCLUDE += \*x86_64\*
aoqi@0 223 endif
aoqi@0 224 ifeq ($(Platform_arch_model), x86_64)
aoqi@0 225 Src_Files_EXCLUDE += \*x86_32\*
aoqi@0 226 endif
aoqi@1 227 ifeq ($(Platform_arch_model), mips_32)
aoqi@1 228 Src_Files_EXCLUDE += \*mips_64\*
aoqi@1 229 endif
aoqi@1 230 ifeq ($(Platform_arch_model), mips_64)
aoqi@1 231 Src_Files_EXCLUDE += \*mips_32\*
aoqi@1 232 endif
aoqi@0 233
aoqi@0 234 # Alternate vm.make
aoqi@0 235 # This has to be included here to allow changes to the source
aoqi@0 236 # directories and excluded files before they are expanded
aoqi@0 237 # by the definition of Src_Files.
aoqi@0 238 -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
aoqi@0 239
aoqi@0 240 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
aoqi@0 241 define findsrc
aoqi@0 242 $(notdir $(shell find $(1)/. ! -name . -prune \
aoqi@0 243 -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
aoqi@0 244 -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
aoqi@0 245 endef
aoqi@0 246
aoqi@0 247 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
aoqi@0 248
aoqi@0 249 Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
aoqi@0 250
aoqi@0 251 JVM_OBJ_FILES = $(Obj_Files)
aoqi@0 252
aoqi@0 253 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
aoqi@0 254
jwilhelm@7059 255 mapfile : $(MAPFILE) vm.def mapfile_ext
aoqi@0 256 rm -f $@
aoqi@0 257 awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
jwilhelm@7059 258 { system ("cat mapfile_ext"); system ("cat vm.def"); } \
aoqi@0 259 else \
aoqi@0 260 { print $$0 } \
aoqi@0 261 }' > $@ < $(MAPFILE)
aoqi@0 262
aoqi@0 263 mapfile_reorder : mapfile $(REORDERFILE)
aoqi@0 264 rm -f $@
aoqi@0 265 cat $^ > $@
aoqi@0 266
aoqi@0 267 vm.def: $(Res_Files) $(Obj_Files)
aoqi@0 268 sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
aoqi@0 269
jwilhelm@7059 270 mapfile_ext:
jwilhelm@7059 271 rm -f $@
jwilhelm@7059 272 touch $@
jwilhelm@7059 273 if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \
jwilhelm@7059 274 cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \
jwilhelm@7059 275 fi
jwilhelm@7059 276
aoqi@0 277 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
aoqi@0 278 STATIC_CXX = false
aoqi@0 279 else
aoqi@0 280 ifeq ($(ZERO_LIBARCH), ppc64)
aoqi@0 281 STATIC_CXX = false
aoqi@0 282 else
aoqi@0 283 STATIC_CXX = true
aoqi@0 284 endif
aoqi@0 285 endif
aoqi@0 286
aoqi@0 287 ifeq ($(LINK_INTO),AOUT)
aoqi@0 288 LIBJVM.o =
aoqi@0 289 LIBJVM_MAPFILE =
aoqi@0 290 LIBS_VM = $(LIBS)
aoqi@0 291 else
aoqi@0 292 LIBJVM.o = $(JVM_OBJ_FILES)
aoqi@0 293 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
aoqi@0 294 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
aoqi@0 295 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
aoqi@0 296
aoqi@0 297 # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
aoqi@0 298 # get around library dependency and compatibility issues. Must use gcc not
aoqi@0 299 # g++ to link.
aoqi@0 300 ifeq ($(STATIC_CXX), true)
aoqi@0 301 LFLAGS_VM += $(STATIC_LIBGCC)
aoqi@0 302 LIBS_VM += $(STATIC_STDCXX)
aoqi@0 303 else
aoqi@0 304 LIBS_VM += -lstdc++
aoqi@0 305 endif
aoqi@0 306
aoqi@0 307 LIBS_VM += $(LIBS)
aoqi@0 308 endif
aoqi@0 309 ifeq ($(JVM_VARIANT_ZERO), true)
aoqi@0 310 LIBS_VM += $(LIBFFI_LIBS)
aoqi@0 311 endif
aoqi@0 312 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
aoqi@0 313 LIBS_VM += $(LIBFFI_LIBS) $(LLVM_LIBS)
aoqi@0 314 LFLAGS_VM += $(LLVM_LDFLAGS)
aoqi@0 315 endif
aoqi@0 316
aoqi@0 317 LINK_VM = $(LINK_LIB.CC)
aoqi@0 318
aoqi@0 319 # rule for building precompiled header
aoqi@0 320 $(PRECOMPILED_HEADER):
aoqi@0 321 $(QUIETLY) echo Generating precompiled header $@
aoqi@0 322 $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
aoqi@0 323 $(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
aoqi@0 324
aoqi@0 325 # making the library:
aoqi@0 326
aoqi@0 327 ifneq ($(JVM_BASE_ADDR),)
aoqi@0 328 # By default shared library is linked at base address == 0. Modify the
aoqi@0 329 # linker script if JVM prefers a different base location. It can also be
aoqi@0 330 # implemented with 'prelink -r'. But 'prelink' is not (yet) available on
aoqi@0 331 # our build platform (AS-2.1).
aoqi@0 332 LD_SCRIPT = libjvm.so.lds
aoqi@0 333 $(LD_SCRIPT): $(LIBJVM_MAPFILE)
aoqi@0 334 $(QUIETLY) { \
aoqi@0 335 rm -rf $@; \
aoqi@0 336 $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1 | \
aoqi@0 337 sed -e '/^======/,/^======/!d' \
aoqi@0 338 -e '/^======/d' \
aoqi@0 339 -e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/' \
aoqi@0 340 > $@; \
aoqi@0 341 }
aoqi@0 342 LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
aoqi@0 343 endif
aoqi@0 344
aoqi@0 345 # With more recent Redhat releases (or the cutting edge version Fedora), if
aoqi@0 346 # SELinux is configured to be enabled, the runtime linker will fail to apply
aoqi@0 347 # the text relocation to libjvm.so considering that it is built as a non-PIC
aoqi@0 348 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See
aoqi@0 349 # details in bug 6538311.
aoqi@0 350 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
aoqi@0 351 $(QUIETLY) { \
aoqi@0 352 echo Linking vm...; \
aoqi@0 353 $(LINK_LIB.CXX/PRE_HOOK) \
aoqi@0 354 $(LINK_VM) $(LD_SCRIPT_FLAG) \
aoqi@0 355 $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
aoqi@0 356 $(LINK_LIB.CXX/POST_HOOK) \
aoqi@0 357 rm -f $@.1; ln -s $@ $@.1; \
aoqi@0 358 if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \
aoqi@0 359 if [ -x /usr/sbin/selinuxenabled ] ; then \
aoqi@0 360 /usr/sbin/selinuxenabled; \
aoqi@0 361 if [ $$? = 0 ] ; then \
aoqi@0 362 /usr/bin/chcon -t textrel_shlib_t $@; \
aoqi@0 363 if [ $$? != 0 ]; then \
aoqi@0 364 echo "ERROR: Cannot chcon $@"; \
aoqi@0 365 fi \
aoqi@0 366 fi \
aoqi@0 367 fi \
aoqi@0 368 fi \
aoqi@0 369 }
aoqi@0 370
aoqi@0 371 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
aoqi@0 372 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
aoqi@0 373 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
aoqi@0 374 ifeq ($(STRIP_POLICY),all_strip)
aoqi@0 375 $(QUIETLY) $(STRIP) $@
aoqi@0 376 else
aoqi@0 377 ifeq ($(STRIP_POLICY),min_strip)
aoqi@0 378 $(QUIETLY) $(STRIP) -g $@
aoqi@0 379 # implied else here is no stripping at all
aoqi@0 380 endif
aoqi@0 381 endif
aoqi@0 382 ifeq ($(ZIP_DEBUGINFO_FILES),1)
aoqi@0 383 $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
aoqi@0 384 $(RM) $(LIBJVM_DEBUGINFO)
aoqi@0 385 endif
aoqi@0 386 endif
aoqi@0 387
aoqi@0 388 DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR)
aoqi@0 389 DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM)
aoqi@0 390 DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
aoqi@0 391 DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
aoqi@0 392
aoqi@0 393 install_jvm: $(LIBJVM)
aoqi@0 394 @echo "Copying $(LIBJVM) to $(DEST_JVM)"
aoqi@0 395 $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \
aoqi@0 396 cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
aoqi@0 397 $(QUIETLY) test -f $(LIBJVM_DIZ) && \
aoqi@0 398 cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ)
aoqi@0 399 $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
aoqi@0 400
aoqi@0 401 #----------------------------------------------------------------------
aoqi@0 402 # Other files
aoqi@0 403
aoqi@0 404 # Signal interposition library
aoqi@0 405 include $(MAKEFILES_DIR)/jsig.make
aoqi@0 406
aoqi@0 407 # Serviceability agent
aoqi@0 408 include $(MAKEFILES_DIR)/saproc.make
aoqi@0 409
aoqi@0 410 #----------------------------------------------------------------------
aoqi@0 411
aoqi@0 412 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck
aoqi@0 413
aoqi@0 414 install: install_jvm install_jsig install_saproc
aoqi@0 415
aoqi@0 416 .PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make

mercurial