1 #
   2 # Copyright (c) 1995, 2012, 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 # We allow for potential specialization of build files. This has to be
 113 # done on a file-by-file, case-by-case basis. Here we define the basic control
 114 # over where custom files are being used. Later we will include the custom
 115 # Defs.gmk if necessary. Other files can follow a similar pattern as needed.
 116 #
 117 # For non-OpenJDK builds the default location is the make/closed repository.
 118 # For OpenJDK builds a real value has to be supplied externally.
 119 
 120 ifneq ($(OPENJDK),true)
 121   CUSTOM_MAKE_DIR_REL=closed
 122 else
 123   CUSTOM_MAKE_DIR_REL=NO_SUCH_PATH
 124 endif
 125 CUSTOM_MAKE_DIR=$(BUILDDIR)/$(CUSTOM_MAKE_DIR_REL)
 126 
 127 # Use this variable to guard inclusion of the custom files
 128 HAS_CUSTOM_MAKE := $(shell if [ -d $(CUSTOM_MAKE_DIR) ]; then echo 1; else echo 0; fi)
 129 
 130 #
 131 # Get platform definitions
 132 #
 133 
 134 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
 135 
 136 #
 137 # Cross-compilation Settings
 138 #
 139 ifdef CROSS_COMPILE_ARCH
 140   # Can't run the tools we just built
 141   USE_ONLY_BOOTDIR_TOOLS = true
 142 
 143   # When cross-compiling CC generates code for the target, but
 144   # some parts of the build generate C code that has to be compiled
 145   # and executed on the build host - HOST_CC is the 'local' compiler.
 146   # For linux the default is /usr/bin/gcc; other platforms need to
 147   # set it explicitly
 148   ifeq ($(PLATFORM), linux)
 149     ifndef HOST_CC
 150       HOST_CC = $(USRBIN_PATH)gcc
 151     endif
 152   endif
 153 else
 154   # Must set HOST_CC if not already set
 155   ifndef HOST_CC
 156     HOST_CC = $(CC)
 157   endif
 158 endif
 159 
 160 # Reset the VM name for client-only builds
 161 ifdef BUILD_CLIENT_ONLY
 162   VM_NAME = client
 163 endif
 164 
 165 #
 166 # Freetype logic is applicable to OpenJDK only
 167 #
 168 ifdef OPENJDK
 169 
 170 #if we use system lib we do not need to copy it to build tree
 171 USING_SYSTEM_FT_LIB=false
 172 
 173 ifeq ($(PLATFORM), windows)
 174   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
 175 endif
 176 ifeq ($(PLATFORM), linux)
 177   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
 178 endif
 179 ifeq ($(PLATFORM), solaris)
 180   # historically for Solaris we have slightly different devtools 
 181   # naming conventions
 182   DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
 183 endif
 184 
 185 DEVTOOLS_FT_DIR_EXISTS = $(shell \
 186   if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
 187     echo true; \
 188   else \
 189     echo false; \
 190   fi)
 191 
 192   ifdef ALT_FREETYPE_LIB_PATH
 193     FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
 194   else
 195     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
 196       FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
 197     else
 198       FREETYPE_LIB_PATH = /usr/lib
 199       USING_SYSTEM_FT_LIB=true
 200     endif
 201   endif 
 202 
 203   ifdef ALT_FREETYPE_HEADERS_PATH
 204     FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
 205   else
 206     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
 207       FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
 208     else
 209       FREETYPE_HEADERS_PATH = /usr/include
 210     endif
 211   endif
 212 endif
 213 
 214 #
 215 # zlib version
 216 #
 217 ZLIB_VERSION = 1.2.5
 218 
 219 
 220 #
 221 # Localizations for the different parts of the product beyond English
 222 #
 223 
 224 JRE_LOCALES   = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
 225 PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
 226 JDK_LOCALES  = ja zh_CN
 227 
 228 #
 229 # A list of locales we support but don't have resource files.
 230 # This is defined to optimize the search of resource bundles.
 231 #
 232 JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
 233 
 234 #
 235 # For now, most libraries except libjava and libjvm itself link against libjvm
 236 # and libjava, the latter for its exported common utilities. libjava only
 237 # links against libjvm. Programs' makefiles take their own responsibility for
 238 # adding other libs.
 239 #
 240 # The makefiles for these packages do not link against libjvm and libjava.
 241 # This list will eventually go away and each Programs' makefiles
 242 # will have to explicitly declare that they want to link to libjava/libjvm
 243 #
 244 NO_JAVALIB_PKGS = \
 245                 sun.security.mscapi \
 246                 sun.security.krb5 \
 247                 sun.security.pkcs11 \
 248                 sun.security.jgss \
 249                 sun.security.jgss.wrapper \
 250                 sun.security.ec \
 251                 sun.security.smartcardio \
 252                 com.sun.security.auth.module
 253 
 254 ifdef PACKAGE
 255 # put JAVALIB first, but do not lose any platform specific values....
 256   ifeq (,$(findstring $(PACKAGE),$(NO_JAVALIB_PKGS)))
 257     LDLIBS_COMMON = $(JAVALIB)
 258   endif
 259 endif # PACKAGE
 260 
 261 #
 262 # Libraries that must appear ahead of libc.so on the link command line
 263 #
 264 ifdef PROGRAM
 265 
 266   ifeq ($(PLATFORM), solaris)
 267     LDLIBS_COMMON = -lthread -ldl
 268   endif
 269 
 270   ifeq ($(PLATFORM), linux)
 271     LDLIBS_COMMON = -ldl
 272   endif
 273 
 274 endif # PROGRAM
 275 
 276 LDLIBS_COMMON += $(EXTRA_LIBS)
 277 
 278 # for generated libraries
 279 LIBDIR              = $(OUTPUTDIR)/lib
 280 ABS_LIBDIR          = $(ABS_OUTPUTDIR)/lib
 281 # Optional place to save the windows .lib files
 282 LIBFILES_DIR        = $(OUTPUTDIR)/libfiles
 283 # for ext jre files
 284 EXTDIR              = $(LIBDIR)/ext
 285 # for generated include files
 286 INCLUDEDIR          = $(OUTPUTDIR)/include
 287 # for generated class files
 288 CLASSBINDIR         = $(OUTPUTDIR)/classes
 289 DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
 290 # for generated tool class files
 291 BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
 292 # for build tool jar files
 293 BUILDTOOLJARDIR     = $(OUTPUTDIR)/btjars
 294 ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
 295 # for generated tool class files
 296 BUILDTOOLBINDIR     = $(OUTPUTDIR)/btbins
 297 # for generated java source files
 298 GENSRCDIR           = $(OUTPUTDIR)/gensrc
 299 # for generated C source files (not javah)
 300 GENNATIVESRCDIR     = $(OUTPUTDIR)/gennativesrc
 301 # for imported source files
 302 IMPORTSRCDIR        = $(OUTPUTDIR)/impsrc
 303 # for imported documents
 304 IMPORTDOCDIR        = $(OUTPUTDIR)/impdoc
 305 # for generated demo
 306 DEMODIR             = $(OUTPUTDIR)/demo
 307 # for sample code
 308 SAMPLEDIR           = $(OUTPUTDIR)/sample
 309 # for generated documentation
 310 DOCSDIR             = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
 311 DOCSDIRSUFFIX       =
 312 
 313 # The MESSAGE, WARNING and ERROR files are used to store sanityck and 
 314 # warnings and errors. 
 315 ifndef ERROR_FILE
 316   ERROR_FILE   = $(OUTPUTDIR)/sanityCheckErrors.txt
 317 endif
 318 ifndef WARNING_FILE
 319   WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
 320 endif
 321 ifndef MESSAGE_FILE
 322   MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
 323 endif
 324 
 325 JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
 326 JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
 327 
 328 #where the demo source can be found
 329 DEMOSRCDIR          = $(SHARE_SRC)/demo
 330 
 331 #where the sample source can be found
 332 SAMPLESRCDIR          = $(SHARE_SRC)/sample
 333 
 334 # An attempt is made to generate unique enough directories for the
 335 # generated files to not have name collisisons. Most build units
 336 # defines PRODUCT (except Release.gmk), but then they may or may 
 337 # not define PACKAGE, PROGRAM, and LIBRARY. This code attempts to
 338 # generate a unique OBJDIR/CLASSHDRDIR for each build unit based
 339 # on which of those values are set within each build unit.
 340 
 341 UNIQUE_LOCATION_STRING = tmp
 342 
 343 ifneq ($(PRODUCT),)
 344   UNIQUE_LOCATION_STRING += /$(PRODUCT)
 345 endif
 346 
 347 ifneq ($(PACKAGE),)
 348   UNIQUE_LOCATION_STRING += /$(PACKAGE)
 349 endif
 350 
 351 ifneq ($(PROGRAM),)
 352   UNIQUE_LOCATION_STRING += /$(PROGRAM)
 353 endif
 354 
 355 ifneq ($(LIBRARY),)
 356   ifneq ($(LIBRARY_OUTPUT),)
 357     UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
 358   else
 359     UNIQUE_LOCATION_STRING += /$(LIBRARY)
 360   endif
 361 endif
 362 
 363 # the use of += above makes a space separated list which we need to 
 364 # remove for filespecs.
 365 #
 366 NULLSTRING :=
 367 ONESPACE := $(NULLSTRING) # space before this comment is required.
 368 UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
 369 
 370 # TEMPDIR is a unique general purpose directory
 371 # need to use 'override' because GNU Make on Linux exports the wrong
 372 # value.
 373 override TEMPDIR      = $(OUTPUTDIR)/$(UNIQUE_PATH)
 374 override ABS_TEMPDIR  = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
 375 
 376 # This must be created right away for pattern rules in Sanity.gmk to work.
 377 dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
 378 dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
 379 
 380 # OBJDIRNAME is the name of the directory where the object code is to
 381 #   be placed. It's name depends on whether the data model architecture 
 382 #   is 32-bit or not.
 383 ifneq ($(ARCH_DATA_MODEL), 32)
 384   OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
 385 else
 386   OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
 387 endif
 388 OBJDIR      = $(TEMPDIR)/$(OBJDIRNAME)
 389 
 390 # CLASSHDRDIR is where the generated C Class Header files go.
 391 CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
 392 
 393 #
 394 # CLASSDESTDIR can be used to specify the directory where generated classes
 395 # are to be placed. The default is CLASSBINDIR.
 396 #
 397 ifndef CLASSDESTDIR
 398 CLASSDESTDIR = $(CLASSBINDIR)
 399 endif
 400 
 401 INCLUDES = -I. -I$(CLASSHDRDIR) \
 402         $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
 403 OTHER_CPPFLAGS += $(INCLUDES)
 404 
 405 #
 406 # vpaths.  These are the default locations searched for source files.
 407 # GNUmakefiles of individual areas often override the default settings.
 408 # There are no longer default vpath entries for C and assembler files
 409 # so we can ensure that libraries don't get their hands on JVM files.
 410 #
 411 # We define an intermediate variable for Java files because
 412 # we use its value later to help define $SOURCEPATH
 413 
 414 VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
 415 ifdef OPENJDK
 416   VPATH.java = $(VPATH0.java)
 417 else
 418   #
 419   # If filenames are duplicated between open/closed workspaces, prefer
 420   # the closed files.
 421   #
 422   # Source ordering is important: some targets depend on closed files
 423   # replacing open ones, and thus the closed file sources must be found
 424   # before the open ones.
 425   #
 426   # Don't reorder without consulting the teams that depend on this behavior.
 427   #
 428   VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
 429 endif
 430 vpath %.java $(VPATH.java)
 431 vpath %.class $(CLASSBINDIR)
 432 vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
 433 
 434 #
 435 # VPATH.h is used elsewhere to generate include flags.  By default, 
 436 # anyone has access to the include files that the JVM area exports,
 437 # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
 438 # relatives.
 439 #
 440 VPATH.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
 441 vpath %.h   $(VPATH.h)
 442 
 443 #
 444 # Used in two ways: helps link against libjava.so. Also if overridden
 445 # determines where your shared library is installed.
 446 #
 447 ifndef LIB_LOCATION
 448   LIB_LOCATION    =  $(LIBDIR)/$(LIBARCH)
 449 endif
 450 
 451 #
 452 # Java header and stub variables
 453 #
 454 CLASSHDRS     = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
 455 CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
 456 STUBPREAMBLE  = $(INCLUDEDIR)/StubPreamble.h
 457 
 458 #
 459 # Classpath seen by javac (different from the one seen by the VM
 460 # running javac), and useful variables.
 461 #
 462 SOURCEPATH      = $(VPATH.java)
 463 PKG             = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
 464 PKGDIR          = $(subst .,/,$(PACKAGE))
 465 
 466 #
 467 # The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
 468 #
 469 include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
 470 
 471 UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
 472 
 473 # Run MAKE $@ for a launcher:
 474 #   $(call make-launcher, name, mainclass, java-args, main-args)
 475 define make-launcher
 476 $(CD) $(BUILDDIR)/launchers && \
 477 $(MAKE) -f Makefile.launcher \
 478         PROGRAM=$(strip $1) \
 479         MAIN_CLASS=$(strip $2) \
 480         MAIN_JAVA_ARGS="$(strip $3)" \
 481         MAIN_ARGS="$(strip $4)"
 482 endef
 483 
 484 #
 485 # Convenient macros
 486 #
 487 
 488 # Prepare $@ target, remove old one and making sure directory exists
 489 define prep-target
 490 $(MKDIR) -p $(@D)
 491 $(RM) $@
 492 endef
 493 
 494 # Simple install of $< file to $@
 495 define install-file
 496 $(prep-target)
 497 $(CP) $< $@
 498 endef
 499 
 500 define chmod-file
 501 $(CHMOD) $1 $@
 502 endef
 503 
 504 define install-sym-link
 505 $(LN) -s $1 $@
 506 endef
 507 
 508 define install-manifest-file
 509 $(install-file)
 510 endef
 511 
 512 # Cleanup rule for after debug java run (hotspot.log file is left around)
 513 #   (This could be an old leftover file in a read-only area, use the @- prefix)
 514 HOTSPOT_LOG_NAME = hotspot.log
 515 define java-vm-cleanup
 516 if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
 517 endef
 518 
 519 # Current directory
 520 CURRENT_DIRECTORY := $(shell $(PWD))
 521 
 522 #
 523 # Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
 524 #    used for this file, otherwise the default settings are used.
 525 #
 526 CFLAGS_$(VARIANT)/BYFILE    = $(CFLAGS_$(VARIANT)/$(@F)) \
 527                               $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
 528 CXXFLAGS_$(VARIANT)/BYFILE  = $(CXXFLAGS_$(VARIANT)/$(@F)) \
 529                               $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
 530 
 531 #
 532 # Tool flags
 533 #
 534 # EXTRA_CFLAGS are used to define cross-compilation options
 535 #
 536 ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
 537 CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
 538 CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
 539 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 540                   $(DEFINES) $(OPTIONS:%=-D%)
 541 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
 542 LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
 543 LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
 544                   $(OTHER_LINTFLAGS)
 545 
 546 VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
 547 
 548 ifdef INSANE
 549   export INSANE
 550 endif
 551 
 552 ifdef ALT_COPYRIGHT_YEAR
 553   COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
 554 else
 555   COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
 556 endif
 557 
 558 # "Legacy" usage of the custom make repository
 559 ifeq ($(HAS_CUSTOM_MAKE),1)
 560   include $(CUSTOM_MAKE_DIR)/common/Defs.gmk
 561 endif
 562 
 563 # Install of imported file (JDK_IMPORT_PATH, or some other external location)
 564 define install-importonly-file
 565 @$(ECHO) "ASSEMBLY_IMPORT: $@"
 566 $(prep-target)
 567 $(CP) $< $@
 568 @if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
 569   if [ -x /usr/sbin/selinuxenabled ] ; then                         \
 570     /usr/sbin/selinuxenabled;                                       \
 571     if [ $$? = 0 ] ; then                                           \
 572       $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
 573       /usr/bin/chcon -t textrel_shlib_t $@;                         \
 574       if [ $$? != 0 ]; then                                         \
 575         echo "ERROR: Cannot chcon $@";                              \
 576       fi;                                                           \
 577     fi;                                                             \
 578   fi;                                                               \
 579 fi
 580 endef
 581 
 582 define install-import-file
 583 $(install-importonly-file)
 584 endef
 585 
 586 ifeq ($(HAS_CUSTOM_MAKE),1)
 587   include $(CUSTOM_MAKE_DIR)/Defs.gmk
 588 endif
 589 
 590 .PHONY: all build clean clobber