Defs.gmk revision 2812
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Common variables used by all the Java makefiles. This file should
# not contain rules.
#
# WARNING: This file is shared with other workspaces.
# So when it includes other files, it must use JDK_TOPDIR.
#
# Check for strange explicit settings (change to empty or true)
#
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
# This little rule is only understood by Sun's make, and is harmless
# when seen by the GNU make tool. If using Sun's make, this causes the
# make command to fail.
#
JDK_TOPDIR=$(BUILDDIR)/..
else
# Hack, due to deploy repository using this file.
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
# there yet.
#
# Files that cannot be included in the OpenJDK distribution are
# collected under a parent directory which contains just those files.
# If we have no closed directory, force it to an openjdk build
CLOSED_SRC_DIR_EXISTS := $(shell \
echo true; \
else \
echo false; \
fi)
OPENJDK = true
# Define where closed directories are
else
# If OPENJDK is defined, we may still need to use some native libraries that
# exist only as part of the closed source. If the closed sources are not
# available, the libraries must have been pre-built. Since these libraries
# and the JDK internal interfaces to these are reasonably stable this is not
# a significant problem. But we do need to provide a way to locate them,
# including a way to point to a new one when there have been changes.
#
# If you have a formal binary plugs download, set ALT_BINARY_PLUGS_PATH
# to the location.
# (Optionally you can set ALT_CLOSED_JDK_IMPORT_PATH to point to the latest
# build JDK, or last promotion for this JDK version, but will not work
# on windows).
#
# As the OPENJDK is built, the binary plugs are used instead of building the
# libraries.
# Individual Makefiles that specify USE_BINARY_PLUG_LIBRARY, will get
# the binary plug copy (or a copy from a built JDK).
#
# See common/internal/BinaryPlugs.gmk for more information.
#
# Usage notes:
#
# ALT_BINARY_PLUGS_JARFILE is probably rarely needed. It can be used
# to identify the exact jar file to be used for all closed classes..
#
# ALT_BINARY_PLUGS_PATH points to a directory containing precisely the
# binaries needed to build.
#
# ALT_BUILD_BINARY_PLUGS_PATH points to a directory containing binary plug dirs
# multiple architectures named using the standard conventions
# This is useful for build scripts that need to build multiple architectures
# of the OpenJDK.
#
# ALT_CLOSED_JDK_IMPORT_PATH points to the top-level of a specific platform
# JDK image.
#
# The precedence is that
# 1. ALT_BINARY_PLUGS_JARFILE overrides any other location of the classes
# 2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries
# 3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH
# 4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries
# Note: If any of the ALT_ variables are modified here, it is assumed
# that the build should be done with IMPORT_BINARY_PLUGS=true as
# well. Otherwise the default will be IMPORT_BINARY_PLUGS=false.
# Lastly, setting IMPORT_BINARY_PLUGS=false on the command line
# will override this logic, and plugs will not be imported.
#
IMPORT_BINARY_PLUGS=true
IMPORT_BINARY_PLUGS=true
else
IMPORT_BINARY_PLUGS=true
IMPORT_BINARY_PLUGS=true
endif # OPENJDK
#
# Get platform definitions
#
#
# Freetype logic is applicable to OpenJDK only
#
#if we use system lib we do not need to copy it to build tree
USING_SYSTEM_FT_LIB=false
# historically for Solaris we have slightly different devtools
# naming conventions
DEVTOOLS_FT_DIR_EXISTS = $(shell \
echo true; \
else \
echo false; \
fi)
else
else
USING_SYSTEM_FT_LIB=true
else
else
#
# zlib version
#
#
# Localizations for the different parts of the product beyond English
#
#
# A list of locales we support but don't have resource files.
# This is defined to optimize the search of resource bundles.
#
#
# All libraries except libjava and libjvm itself link against libjvm and
# libjava, the latter for its exported common utilities. libjava only links
# against libjvm. Programs' makefiles take their own responsibility for
# adding other libs.
#
# put JAVALIB first, but do not lose any platform specific values....
LDLIBS_COMMON = $(JAVALIB)
endif # PACKAGE
#
# Libraries that must appear ahead of libc.so on the link command line
#
LDLIBS_COMMON = -ldl
endif # PROGRAM
LDLIBS_COMMON += $(EXTRA_LIBS)
#
# Default is to build, not import native binaries
#
IMPORT_NATIVE_BINARIES=false
# If importing libraries in, no incremental builds
INCREMENTAL_BUILD=false
# for generated libraries
# Optional place to save the windows .lib files
# for ext jre files
# for generated include files
# for generated class files
# for modules
# for generated tool class files
# for build tool jar files
# for generated tool class files
# for generated java source files
# for generated C source files (not javah)
# for imported source files
# for imported documents
# for generated demo
# for sample code
# for generated documentation
# The MESSAGE, WARNING and ERROR files are used to store sanityck and
# warnings and errors.
#where the demo source can be found
# An attempt is made to generate unique enough directories for the
# generated files to not have name collisisons. Most build units
# defines PRODUCT (except Release.gmk), but then they may or may
# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and
# LIBRARY. This code chunk attempts to generate a unique
# OBJDIR/CLASSHDRDIR for each build unit based on which of those
# values are set within each build unit.
UNIQUE_LOCATION_STRING += /$(PRODUCT)
UNIQUE_LOCATION_STRING += /$(PACKAGE)
UNIQUE_LOCATION_STRING += /$(PROGRAM)
else
UNIQUE_LOCATION_STRING += /$(LIBRARY)
UNIQUE_LOCATION_STRING += /$(THREADDIR)
#
# Build units may or may not define MODULE. Default to "other".
#
# MODULE variable defines the lowest-level module name that
# might or might not be the name of the modules created in
# the modules build (see make/modules/modules.config and
# modules.group).
#
# the use of += above makes a space separated list which we need to
# remove for filespecs.
#
NULLSTRING :=
# TEMPDIR is a unique general purpose directory
# need to use 'override' because GNU Make on Linux exports the wrong
# value.
# This must be created right away for pattern rules in Sanity.gmk to work.
# OBJDIRNAME is the name of the directory where the object code is to
# be placed. It's name depends on whether the data model architecture
# is 32-bit or not.
else
# CLASSHDRDIR is where the generated C Class Header files go.
#
# CLASSDESTDIR can be used to specify the directory where generated classes
# are to be placed. The default is CLASSBINDIR.
#
CLASSDESTDIR = $(CLASSBINDIR)
INCLUDES = -I. -I$(CLASSHDRDIR) \
OTHER_CPPFLAGS = $(INCLUDES)
#
# vpaths. These are the default locations searched for source files.
# GNUmakefiles of individual areas often override the default settings.
# There are no longer default vpath entries for C and assembler files
# so we can ensure that libraries don't get their hands on JVM files.
#
# We define an intermediate variable for Java files because
# we use its value later to help define $SOURCEPATH
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
VPATH.java = $(VPATH0.java)
else
#
# the closed files.
#
# Source ordering is important: some targets depend on closed files
# replacing open ones, and thus the closed file sources must be found
# before the open ones.
#
# Don't reorder without consulting the teams that depend on this behavior.
#
VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
#
# VPATH.h is used elsewhere to generate include flags. By default,
# anyone has access to the include files that the JVM area exports,
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
# relatives.
#
#
# Used in two ways: helps link against libjava.so. Also if overridden
# determines where your shared library is installed.
#
#
# Java header and stub variables
#
#
# Classpath seen by javac (different from the one seen by the VM
# running javac), and useful variables.
#
SOURCEPATH = $(VPATH.java)
#
#
#
# Macros to find the module that $@ belongs to
#
MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
-e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
-e 's%.*\/lib\/%lib\/%' \
-e 's%.*\/bin\/%bin\/%' \
-e 's%.*\/include\/%include\/%' \
-e 's%.*\/demo\/%demo\/%' \
-e 's%.*\/sample\/%sample\/%'
# Install a file to its module
# Install all files from the directory to its module
# chmod the file in its module
# install a sym link in its module
# Run MAKE $@ for a launcher:
# $(call make-launcher, name, mainclass, java-args, main-args)
$(MAKE) -f Makefile.launcher \
MAIN_CLASS=$(strip $2) \
#
# Convenient macros
#
# Prepare $@ target, remove old one and making sure directory exists
$(MKDIR) -p $(@D)
$(RM) $@
# Simple install of $< file to $@
$(CP) $< $@
$(CHMOD) $1 $@
$(LN) -s $1 $@
#
# Marcos for files not belonging to any module
$(CP) $< $@
# Cleanup rule for after debug java run (hotspot.log file is left around)
# (This could be an old leftover file in a read-only area, use the @- prefix)
# Current directory
#
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
# used for this file, otherwise the default settings are used.
#
#
# Tool flags
#
export INSANE
else
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
@$(ECHO) "ASSEMBLY_IMPORT: $@"
$(CP) $< $@
if [ $$? = 0 ] ; then \
if [ $$? != 0 ]; then \
echo "ERROR: Cannot chcon $@"; \
fi; \
fi; \
fi; \
fi