Defs.gmk revision 165
#
# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
# 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. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.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
#
else
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
else
#
# 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 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
# SCCS check messages, 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)
# 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.
#
VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/include$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/javavm/include
#
# 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)
#
#
#
# Set opt level to ALT_OPT if set otherwise _OPT
#
#
# Convenient macros
#
# Prepare $@ target, remove old one and making sure directory exists
$(MKDIR) -p $(@D)
$(RM) $@
# Simple install of $< file to $@
$(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)
# Default make settings for processing SUBDIRS with clobber or clean names
# Current directory
# If no timing wanted, we need to define these as empty
t=0:0:0:0
else # NO_TIMING
# Default timing id
# Timing start (must be used in same shell, e.g. same command line)
# Defines the shell variable $1 to have the start time.
# Timing end (must be used in same shell, e.g. same command line)
# Expects shell variable $1 to have been defined as the start time.
# Expects shell variable $2 to have timing id string
# Sets total_seconds shell variable as the total seconds used.
# Sets time_used shell variable to contain format "%dh%dm%ds"
begTime="$${$1}"; \
timing_id="$${$2}"; \
if [ "$${t_hour}" != "0h" ] ; then \
elif [ "$${t_min}" != "0m" ] ; then \
else \
fi; \
$(PRINTF) " Timing: %05d seconds or %s for %s\n" \
endif # NO_TIMING
# Given a SUBDIRS list, cd into them and make them
# SUBDIRS_MAKEFLAGS Make settings for a subdir make
# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
if [ "$$i" != "DUMMY" ] ; then \
$(call TIMING_start,startTime); \
curDir=$(CURRENT_DIRECTORY); \
$(SUBDIRS_MAKEFLAGS) \
$(SUBDIRS_MAKEFLAGS-$@) \
FULL_VERSION=$(FULL_VERSION) \
$(call TIMING_end,startTime,timing_id); \
fi ; \
done
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
if [ "$$i" != "DUMMY" ] ; then \
$(call TIMING_start,startTime); \
curDir=$(CURRENT_DIRECTORY); \
FULL_VERSION=$(FULL_VERSION) \
$(call TIMING_end,startTime,timing_id); \
fi ; \
done
#
# 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
#
# this should be moved into Defs-<platform>.gmk.....
else
# Note: As a rule, GNU Make rules should not appear in any of the
# Defs*.gmk files. These were added for Kestrel-Solaris and do address
# a TeamWare bug. They should be moved elsewhere for Merlin.
#
# Override gnumake built-in rules which do sccs get operations badly.
# (They put the checked out code in the current directory, not in the
# directory of the original file.)
# Since this is a symptom of a teamware failure, complain and die on the spot.
# This message immediately goes to stdout and the build terminates.
$(error \
is out of date with respect to its SCCS file $<. \
This can happen from an unresolved Teamware conflict, a file movement, or \
a failure in which SCCS files are updated but the 'sccs get' was not done. \
You should double check for other out of date files in your workspace. \
%:: s.%
%:: SCCS/s.%
@#exit 666
export INSANE
else
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
@$(ECHO) "ASSEMBLY_IMPORT: $@"