#
# 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 CLOSE_SRC_INCLUDED isn't set to true, check if there's any
# closed directory.
CLOSED_SRC_INCLUDED := $(shell \
echo true; \
else \
echo false; \
fi)
# Set OPENJDK based on CLOSED_SRC_INCLUDED
OPENJDK = true
# Define where closed directories are
else
#
# Get platform definitions
#
#
# SE-Embedded support, if enabled
#
#
# Cross-compilation Settings
#
# Can't run the tools we just built
USE_ONLY_BOOTDIR_TOOLS = true
# When cross-compiling CC generates code for the target, but
# some parts of the build generate C code that has to be compiled
# and executed on the build host - HOST_CC is the 'local' compiler.
# set it explicitly
else
# Must set HOST_CC if not already set
# Reset the VM name for client-only builds
#
# 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)
USING_SYSTEM_FT_LIB=true
else
else
else
USING_SYSTEM_FT_LIB=true
else
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)
# for generated libraries
# Optional place to save the windows .lib files
# for ext jre files
# for generated include files
# for generated class files
# 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
#where the sample 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, PROGRAM, and LIBRARY. This code 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)
# 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
else
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.
#
else
else
#
# 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)
#
#
# 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 $@
# 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
#
# EXTRA_CFLAGS are used to define cross-compilation options
#
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