1 #
   2 # Copyright (c) 1995, 2014, 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.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 #
  27 # Common variables used by all the Java makefiles.  This file should
  28 # not contain rules.
  29 #
  30 
  31 # WARNING: This file is shared with other workspaces.
  32 #          So when it includes other files, it must use JDK_TOPDIR.
  33 #
  34 
  35 # Check for strange explicit settings (change to empty or true)
  36 ifdef OPENJDK
  37   ifneq ($(OPENJDK),true)
  38     x:=$(error "OPENJDK (if defined) can only be set to true")
  39   endif
  40 endif
  41 
  42 #
  43 # On Solaris, the 'make' utility from Sun will not work with these makefiles.
  44 #    This little rule is only understood by Sun's make, and is harmless
  45 #    when seen by the GNU make tool. If using Sun's make, this causes the
  46 #    make command to fail.
  47 #
  48 SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
  49 
  50 ifndef JDK_TOPDIR
  51   ifdef BUILDDIR
  52     JDK_TOPDIR=$(BUILDDIR)/..
  53   else
  54     JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository")
  55   endif
  56 endif
  57 ifndef BUILDDIR
  58   # Hack, due to deploy repository using this file.
  59   BUILDDIR=$(JDK_TOPDIR)/make
  60 endif
  61 ifndef JDK_MAKE_SHARED_DIR
  62   JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
  63 endif
  64 
  65 include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
  66 
  67 TOPDIR=$(BUILDDIR)/..
  68 
  69 include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
  70 
  71 # Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
  72 # src/solaris so if you want to build on Linux you didn't need a src/linux
  73 # directory.  In an ideal world it would be called src/genunix but we are not
  74 # there yet.
  75 #
  76 ifndef SHARE_SRC
  77   SHARE_SRC    = $(BUILDDIR)/../src/share
  78 endif
  79 
  80 # Files that cannot be included in the OpenJDK distribution are
  81 # collected under a parent directory which contains just those files.
  82 ifndef CLOSED_SRC
  83   CLOSED_SRC  = $(BUILDDIR)/../src/closed
  84 endif
  85 
  86 # If CLOSE_SRC_INCLUDED isn't set to true, check if there's any
  87 # closed directory.
  88 ifneq ($(CLOSED_SRC_INCLUDED), true)
  89   CLOSED_SRC_INCLUDED := $(shell \
  90     if [ -d $(CLOSED_SRC) ] ; then \
  91       echo true; \
  92     else \
  93       echo false; \
  94     fi)
  95 endif
  96 
  97 # Set OPENJDK based on CLOSED_SRC_INCLUDED
  98 ifeq ($(CLOSED_SRC_INCLUDED), false)
  99   OPENJDK = true
 100 endif
 101 
 102 # Define where closed directories are
 103 ifdef OPENJDK
 104   CLOSED_SRC =
 105   CLOSED_SHARE_SRC =
 106 else
 107   ifndef CLOSED_SHARE_SRC
 108     CLOSED_SHARE_SRC    = $(CLOSED_SRC)/share
 109   endif
 110 endif
 111 
 112 #
 113 # Get platform definitions
 114 #
 115 
 116 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
 117 
 118 #
 119 # SE-Embedded support, if enabled
 120 #
 121 
 122 include $(JDK_TOPDIR)/make/common/Defs-embedded.gmk
 123 
 124 #
 125 # Cross-compilation Settings
 126 #
 127 ifdef CROSS_COMPILE_ARCH
 128   # Can't run the tools we just built
 129   USE_ONLY_BOOTDIR_TOOLS = true
 130 
 131   # When cross-compiling CC generates code for the target, but
 132   # some parts of the build generate C code that has to be compiled
 133   # and executed on the build host - HOST_CC is the 'local' compiler.
 134   # For linux the default is /usr/bin/gcc; other platforms need to
 135   # set it explicitly
 136   ifeq ($(PLATFORM), linux)
 137     ifndef HOST_CC
 138       HOST_CC = $(USRBIN_PATH)gcc
 139     endif
 140   endif
 141 else
 142   # Must set HOST_CC if not already set
 143   ifndef HOST_CC
 144     HOST_CC = $(CC)
 145   endif
 146 endif
 147 
 148 # Reset the VM name for client-only builds
 149 ifdef BUILD_CLIENT_ONLY
 150   VM_NAME = client
 151 endif
 152 
 153 #
 154 # Freetype logic is applicable to OpenJDK only
 155 #
 156 ifdef OPENJDK
 157 
 158 #if we use system lib we do not need to copy it to build tree
 159 USING_SYSTEM_FT_LIB=false
 160 
 161 ifeq ($(PLATFORM), windows)
 162   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
 163 endif
 164 ifeq ($(PLATFORM), linux)
 165   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
 166 endif
 167 ifeq ($(PLATFORM), solaris)
 168   # historically for Solaris we have slightly different devtools 
 169   # naming conventions
 170   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
 171 endif
 172 
 173 DEVTOOLS_FT_DIR_EXISTS = $(shell \
 174   if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
 175     echo true; \
 176   else \
 177     echo false; \
 178   fi)
 179 
 180   ifdef ALT_FREETYPE_LIB_PATH
 181     FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
 182     ifeq ($(PLATFORM), macosx)
 183       USING_SYSTEM_FT_LIB=true
 184     endif
 185   else
 186     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
 187       FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
 188     else
 189       ifeq ($(PLATFORM), macosx)
 190         FREETYPE_LIB_PATH = /usr/X11R6/lib
 191       else
 192         FREETYPE_LIB_PATH = /usr/lib
 193       endif
 194       USING_SYSTEM_FT_LIB=true
 195     endif
 196   endif 
 197 
 198   ifdef ALT_FREETYPE_HEADERS_PATH
 199     FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
 200   else
 201     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
 202       FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
 203     else
 204       ifeq ($(PLATFORM), macosx)
 205         FREETYPE_HEADERS_PATH = /usr/X11R6/include
 206       else
 207         FREETYPE_HEADERS_PATH = /usr/include
 208       endif
 209     endif
 210   endif
 211 endif
 212 
 213 #
 214 # zlib version
 215 #
 216 ZLIB_VERSION = 1.2.8
 217 
 218 
 219 #
 220 # Localizations for the different parts of the product beyond English
 221 #
 222 
 223 JRE_LOCALES   = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
 224 PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
 225 JDK_LOCALES  = ja zh_CN
 226 
 227 #
 228 # A list of locales we support but don't have resource files.
 229 # This is defined to optimize the search of resource bundles.
 230 #
 231 JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
 232 
 233 #
 234 # All libraries except libjava and libjvm itself link against libjvm and
 235 # libjava, the latter for its exported common utilities.  libjava only links
 236 # against libjvm.  Programs' makefiles take their own responsibility for
 237 # adding other libs.
 238 #
 239 ifdef PACKAGE
 240 # put JAVALIB first, but do not lose any platform specific values....
 241   LDLIBS_COMMON = $(JAVALIB)
 242 endif # PACKAGE
 243 
 244 #
 245 # Libraries that must appear ahead of libc.so on the link command line
 246 #
 247 ifdef PROGRAM
 248 
 249   ifeq ($(PLATFORM), solaris)
 250     LDLIBS_COMMON = -lthread -ldl
 251   endif
 252 
 253   ifeq ($(PLATFORM), linux)
 254     LDLIBS_COMMON = -ldl
 255   endif
 256 
 257   ifeq ($(PLATFORM), macosx)
 258     LDLIBS_COMMON = -pthread
 259   endif
 260 
 261 endif # PROGRAM
 262 
 263 LDLIBS_COMMON += $(EXTRA_LIBS)
 264 
 265 # for generated libraries
 266 LIBDIR              = $(OUTPUTDIR)/lib
 267 ABS_LIBDIR          = $(ABS_OUTPUTDIR)/lib
 268 # Optional place to save the windows .lib files
 269 LIBFILES_DIR        = $(OUTPUTDIR)/libfiles
 270 # for ext jre files
 271 EXTDIR              = $(LIBDIR)/ext
 272 # for generated include files
 273 INCLUDEDIR          = $(OUTPUTDIR)/include
 274 # for generated class files
 275 CLASSBINDIR         = $(OUTPUTDIR)/classes
 276 DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
 277 # for generated tool class files
 278 BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
 279 # for build tool jar files
 280 BUILDTOOLJARDIR     = $(OUTPUTDIR)/btjars
 281 ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
 282 # for generated tool class files
 283 BUILDTOOLBINDIR     = $(OUTPUTDIR)/btbins
 284 ABS_BUILDTOOLBINDIR = $(ABS_OUTPUTDIR)/btbins
 285 # for generated java source files
 286 GENSRCDIR           = $(OUTPUTDIR)/gensrc
 287 # for generated C source files (not javah)
 288 GENNATIVESRCDIR     = $(OUTPUTDIR)/gennativesrc
 289 # for imported source files
 290 IMPORTSRCDIR        = $(OUTPUTDIR)/impsrc
 291 # for imported documents
 292 IMPORTDOCDIR        = $(OUTPUTDIR)/impdoc
 293 # for generated demo
 294 DEMODIR             = $(OUTPUTDIR)/demo
 295 # for sample code
 296 SAMPLEDIR           = $(OUTPUTDIR)/sample
 297 # for generated documentation
 298 DOCSDIR             = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
 299 DOCSDIRSUFFIX       =
 300 
 301 # The MESSAGE, WARNING and ERROR files are used to store sanityck and 
 302 # warnings and errors. 
 303 ifndef ERROR_FILE
 304   ERROR_FILE   = $(OUTPUTDIR)/sanityCheckErrors.txt
 305 endif
 306 ifndef WARNING_FILE
 307   WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
 308 endif
 309 ifndef MESSAGE_FILE
 310   MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
 311 endif
 312 
 313 JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
 314 JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
 315 JDK_SERVER_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-server-image
 316 
 317 #where the demo source can be found
 318 DEMOSRCDIR          = $(SHARE_SRC)/demo
 319 
 320 #where the sample source can be found
 321 SAMPLESRCDIR          = $(SHARE_SRC)/sample
 322 
 323 # An attempt is made to generate unique enough directories for the
 324 # generated files to not have name collisisons. Most build units
 325 # defines PRODUCT (except Release.gmk), but then they may or may 
 326 # not define PACKAGE, PROGRAM, and LIBRARY. This code attempts to
 327 # generate a unique OBJDIR/CLASSHDRDIR for each build unit based
 328 # on which of those values are set within each build unit.
 329 
 330 UNIQUE_LOCATION_STRING = tmp
 331 
 332 ifneq ($(PRODUCT),)
 333   UNIQUE_LOCATION_STRING += /$(PRODUCT)
 334 endif
 335 
 336 ifneq ($(PACKAGE),)
 337   UNIQUE_LOCATION_STRING += /$(PACKAGE)
 338 endif
 339 
 340 ifneq ($(PROGRAM),)
 341   UNIQUE_LOCATION_STRING += /$(PROGRAM)
 342 endif
 343 
 344 ifneq ($(LIBRARY),)
 345   ifneq ($(LIBRARY_OUTPUT),)
 346     UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
 347   else
 348     UNIQUE_LOCATION_STRING += /$(LIBRARY)
 349   endif
 350 endif
 351 
 352 # the use of += above makes a space separated list which we need to 
 353 # remove for filespecs.
 354 #
 355 NULLSTRING :=
 356 ONESPACE := $(NULLSTRING) # space before this comment is required.
 357 UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
 358 
 359 # TEMPDIR is a unique general purpose directory
 360 # need to use 'override' because GNU Make on Linux exports the wrong
 361 # value.
 362 override TEMPDIR      = $(OUTPUTDIR)/$(UNIQUE_PATH)
 363 override ABS_TEMPDIR  = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
 364 
 365 # This must be created right away for pattern rules in Sanity.gmk to work.
 366 dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
 367 dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
 368 
 369 # OBJDIRNAME is the name of the directory where the object code is to
 370 #   be placed. It's name depends on whether the data model architecture 
 371 #   is 32-bit or not.
 372 ifneq ($(ARCH_DATA_MODEL), 32)
 373   OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
 374 else
 375   OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
 376 endif
 377 OBJDIR      = $(TEMPDIR)/$(OBJDIRNAME)
 378 
 379 # CLASSHDRDIR is where the generated C Class Header files go.
 380 CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
 381 
 382 #
 383 # CLASSDESTDIR can be used to specify the directory where generated classes
 384 # are to be placed. The default is CLASSBINDIR.
 385 #
 386 ifndef CLASSDESTDIR
 387 CLASSDESTDIR = $(CLASSBINDIR)
 388 endif
 389 
 390 INCLUDES = -I. -I$(CLASSHDRDIR) \
 391         $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
 392 OTHER_CPPFLAGS += $(INCLUDES)
 393 
 394 #
 395 # vpaths.  These are the default locations searched for source files.
 396 # GNUmakefiles of individual areas often override the default settings.
 397 # There are no longer default vpath entries for C and assembler files
 398 # so we can ensure that libraries don't get their hands on JVM files.
 399 #
 400 # We define an intermediate variable for Java files because
 401 # we use its value later to help define $SOURCEPATH
 402 
 403 ifeq ($(PLATFORM), macosx)
 404   VPATH0.java = $(subst $(ONESPACE),:,$(GENSRCDIR) $(call JavaSrcDirList,,classes))
 405 else
 406   VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
 407 endif
 408 
 409 ifdef OPENJDK
 410   VPATH.java = $(VPATH0.java)
 411 else
 412   #
 413   # If filenames are duplicated between open/closed workspaces, prefer
 414   # the closed files.
 415   #
 416   # Source ordering is important: some targets depend on closed files
 417   # replacing open ones, and thus the closed file sources must be found
 418   # before the open ones.
 419   #
 420   # Don't reorder without consulting the teams that depend on this behavior.
 421   #
 422   VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
 423 endif
 424 vpath %.java $(VPATH.java)
 425 vpath %.class $(CLASSBINDIR)
 426 vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
 427 
 428 #
 429 # VPATH.h is used elsewhere to generate include flags.  By default, 
 430 # anyone has access to the include files that the JVM area exports,
 431 # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
 432 # relatives.
 433 #
 434 ifeq ($(PLATFORM), macosx)
 435   VPATH0.h =   $(PLATFORM_SRC_MACOS)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
 436 else
 437   VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
 438 endif
 439 
 440 ifdef OPENJDK
 441   VPATH.h = $(VPATH0.h)
 442 else
 443   VPATH.h = $(CLOSED_SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(VPATH0.h)
 444 endif
 445 vpath %.h   $(VPATH.h)
 446 
 447 #
 448 # Used in two ways: helps link against libjava.so. Also if overridden
 449 # determines where your shared library is installed.
 450 #
 451 ifndef LIB_LOCATION
 452   LIB_LOCATION    =  $(LIBDIR)/$(LIBARCH)
 453 endif
 454 
 455 #
 456 # Java header and stub variables
 457 #
 458 CLASSHDRS     = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
 459 CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
 460 STUBPREAMBLE  = $(INCLUDEDIR)/StubPreamble.h
 461 
 462 #
 463 # Classpath seen by javac (different from the one seen by the VM
 464 # running javac), and useful variables.
 465 #
 466 SOURCEPATH      = $(VPATH.java)
 467 PKG             = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
 468 PKGDIR          = $(subst .,/,$(PACKAGE))
 469 
 470 #
 471 # The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
 472 #
 473 include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
 474 
 475 UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
 476 
 477 # Run MAKE $@ for a launcher:
 478 #   $(call make-launcher, name, mainclass, java-args, main-args)
 479 define make-launcher
 480 $(CD) $(BUILDDIR)/launchers && \
 481 $(MAKE) -f Makefile.launcher \
 482         PROGRAM=$(strip $1) \
 483         MAIN_CLASS=$(strip $2) \
 484         MAIN_JAVA_ARGS="$(strip $3)" \
 485         MAIN_ARGS="$(strip $4)"
 486 endef
 487 
 488 #
 489 # Convenient macros
 490 #
 491 
 492 # Prepare $@ target, remove old one and making sure directory exists
 493 define prep-target
 494 $(MKDIR) -p $(@D)
 495 $(RM) $@
 496 endef
 497 
 498 # Simple install of $< file to $@
 499 define install-file
 500 $(prep-target)
 501 $(CP) $< $@
 502 endef
 503 
 504 define chmod-file
 505 $(CHMOD) $1 $@
 506 endef
 507 
 508 define install-sym-link
 509 $(LN) -s $1 $@
 510 endef
 511 
 512 define install-manifest-file
 513 $(install-file)
 514 endef
 515 
 516 # Cleanup rule for after debug java run (hotspot.log file is left around)
 517 #   (This could be an old leftover file in a read-only area, use the @- prefix)
 518 HOTSPOT_LOG_NAME = hotspot.log
 519 define java-vm-cleanup
 520 if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
 521 endef
 522 
 523 # Current directory
 524 CURRENT_DIRECTORY := $(shell $(PWD))
 525 
 526 #
 527 # Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
 528 #    used for this file, otherwise the default settings are used.
 529 #
 530 CFLAGS_$(VARIANT)/BYFILE    = $(CFLAGS_$(VARIANT)/$(@F)) \
 531                               $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
 532 CXXFLAGS_$(VARIANT)/BYFILE  = $(CXXFLAGS_$(VARIANT)/$(@F)) \
 533                               $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
 534 
 535 #
 536 # Tool flags
 537 #
 538 # EXTRA_CFLAGS are used to define cross-compilation options
 539 #
 540 ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
 541 CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
 542 CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
 543 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 544                   $(DEFINES) $(OPTIONS:%=-D%)
 545 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
 546 LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
 547 LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
 548                   $(OTHER_LINTFLAGS)
 549 
 550 VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
 551 
 552 ifdef INSANE
 553   export INSANE
 554 endif
 555 
 556 ifdef ALT_COPYRIGHT_YEAR
 557   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
 558 else
 559   COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
 560 endif
 561 
 562 ifndef OPENJDK
 563 include $(JDK_TOPDIR)/make/closed/common/Defs.gmk
 564 endif
 565 
 566 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 567 define install-importonly-file
 568 @$(ECHO) "ASSEMBLY_IMPORT: $@"
 569 $(prep-target)
 570 $(CP) $< $@
 571 @if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
 572   if [ -x /usr/sbin/selinuxenabled ] ; then                         \
 573     /usr/sbin/selinuxenabled;                                       \
 574     if [ $$? = 0 ] ; then                                           \
 575       $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
 576       /usr/bin/chcon -t textrel_shlib_t $@;                         \
 577       if [ $$? != 0 ]; then                                         \
 578         echo "ERROR: Cannot chcon $@";                              \
 579       fi;                                                           \
 580     fi;                                                             \
 581   fi;                                                               \
 582 fi
 583 endef
 584 
 585 define install-import-file
 586 $(install-importonly-file)
 587 endef
 588 
 589 .PHONY: all build clean clobber