Defs.gmk revision 116
0N/A#
0N/A# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Sun designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Sun in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A
0N/A#
0N/A# Common variables used by all the Java makefiles. This file should
0N/A# not contain rules.
0N/A#
0N/A
0N/A# WARNING: This file is shared with other workspaces.
0N/A# So when it includes other files, it must use JDK_TOPDIR.
0N/A#
0N/A
116N/A# Check for strange explicit settings (change to empty or true)
116N/Aifdef OPENJDK
116N/A ifneq ($(OPENJDK),true)
116N/A x:=$(error "OPENJDK (if defined) can only be set to true")
116N/A endif
116N/Aendif
116N/A
0N/A#
0N/A# On Solaris, the 'make' utility from Sun will not work with these makefiles.
0N/A# This little rule is only understood by Sun's make, and is harmless
0N/A# when seen by the GNU make tool. If using Sun's make, this causes the
0N/A# make command to fail.
0N/A#
0N/ASUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
0N/A
0N/Aifndef JDK_TOPDIR
9N/A ifdef BUILDDIR
9N/A JDK_TOPDIR=$(BUILDDIR)/..
9N/A else
9N/A JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository")
9N/A endif
9N/Aendif
9N/Aifndef BUILDDIR
9N/A # Hack, due to deploy repository using this file.
9N/A BUILDDIR=$(JDK_TOPDIR)/make
0N/Aendif
0N/Aifndef JDK_MAKE_SHARED_DIR
0N/A JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
0N/Aendif
0N/A
0N/Ainclude $(JDK_MAKE_SHARED_DIR)/Platform.gmk
0N/A
0N/ATOPDIR=$(BUILDDIR)/..
0N/A
0N/Ainclude $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
0N/A
0N/A# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
0N/A# src/solaris so if you want to build on Linux you didn't need a src/linux
0N/A# directory. In an ideal world it would be called src/genunix but we are not
0N/A# there yet.
0N/A#
0N/Aifndef SHARE_SRC
7N/A SHARE_SRC = $(BUILDDIR)/../src/share
0N/Aendif
0N/A
0N/A# Files that cannot be included in the OpenJDK distribution are
0N/A# collected under a parent directory which contains just those files.
0N/Aifndef CLOSED_SRC
7N/A CLOSED_SRC = $(BUILDDIR)/../src/closed
0N/Aendif
0N/A
0N/A# If we have no closed directory, force it to an openjdk build
0N/ACLOSED_SRC_DIR_EXISTS := $(shell \
0N/A if [ -d $(CLOSED_SRC) ] ; then \
0N/A echo true; \
0N/A else \
0N/A echo false; \
0N/A fi)
0N/Aifeq ($(CLOSED_SRC_DIR_EXISTS), false)
0N/A OPENJDK = true
0N/Aendif
0N/A
0N/A# Define where closed directories are
0N/Aifdef OPENJDK
0N/A CLOSED_SRC =
0N/A CLOSED_SHARE_SRC =
0N/Aelse
0N/A ifndef CLOSED_SHARE_SRC
0N/A CLOSED_SHARE_SRC = $(CLOSED_SRC)/share
0N/A endif
0N/Aendif
0N/A
0N/A# If OPENJDK is defined, we may still need to use some native libraries that
0N/A# exist only as part of the closed source. If the closed sources are not
0N/A# available, the libraries must have been pre-built. Since these libraries
0N/A# and the JDK internal interfaces to these are reasonably stable this is not
0N/A# a significant problem. But we do need to provide a way to locate them,
0N/A# including a way to point to a new one when there have been changes.
0N/A#
0N/A# If you have a formal binary plugs download, set ALT_BINARY_PLUGS_PATH
0N/A# to the location.
0N/A# (Optionally you can set ALT_CLOSED_JDK_IMPORT_PATH to point to the latest
0N/A# build JDK, or last promotion for this JDK version, but will not work
0N/A# on windows).
0N/A#
0N/A# As the OPENJDK is built, the binary plugs are used instead of building the
0N/A# libraries.
0N/A# Individual Makefiles that specify USE_BINARY_PLUG_LIBRARY, will get
0N/A# the binary plug copy (or a copy from a built JDK).
0N/A#
0N/A# See common/internal/BinaryPlugs.gmk for more information.
0N/A#
0N/A# Usage notes:
0N/A#
0N/A# ALT_BINARY_PLUGS_JARFILE is probably rarely needed. It can be used
0N/A# to identify the exact jar file to be used for all closed classes..
0N/A#
0N/A# ALT_BINARY_PLUGS_PATH points to a directory containing precisely the
0N/A# binaries needed to build.
0N/A#
0N/A# ALT_BUILD_BINARY_PLUGS_PATH points to a directory containing binary plug dirs
0N/A# multiple architectures named using the standard conventions
0N/A# This is useful for build scripts that need to build multiple architectures
0N/A# of the OpenJDK.
0N/A#
0N/A# ALT_CLOSED_JDK_IMPORT_PATH points to the top-level of a specific platform
0N/A# JDK image.
0N/A#
0N/A# The precedence is that
0N/A# 1. ALT_BINARY_PLUGS_JARFILE overrides any other location of the classes
0N/A# 2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries
0N/A# 3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH
0N/A# 4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries
0N/A#
0N/A
0N/A# Always needed, defines the name of the imported/exported jarfile
0N/ABINARY_PLUGS_JARNAME = rt-closed.jar
0N/A
0N/Aifdef OPENJDK
0N/A ifdef ALT_CLOSED_JDK_IMPORT_PATH
0N/A CLOSED_JDK_IMPORT_PATH = $(ALT_CLOSED_JDK_IMPORT_PATH)
0N/A BINARY_PLUGS_PATH = $(CLOSED_JDK_IMPORT_PATH)
0N/A BINARY_PLUGS_JARFILE = $(CLOSED_JDK_IMPORT_PATH)/jre/lib/rt.jar
0N/A endif
0N/A ifdef ALT_BUILD_BINARY_PLUGS_PATH
0N/A BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH)
0N/A else
0N/A BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs
0N/A endif
0N/A BINARY_PLUGS_PATH = $(BUILD_BINARY_PLUGS_PATH)/$(PLATFORM)-$(ARCH)
0N/A BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
0N/A ifdef ALT_BINARY_PLUGS_PATH
0N/A BINARY_PLUGS_PATH = $(ALT_BINARY_PLUGS_PATH)
0N/A BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
0N/A endif
0N/A ifdef ALT_BINARY_PLUGS_JARFILE
0N/A BINARY_PLUGS_JARFILE = $(ALT_BINARY_PLUGS_JARFILE)
0N/A endif
0N/Aendif # OPENJDK
0N/A
0N/A#
0N/A# Get platform definitions
0N/A#
0N/A
0N/Ainclude $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
0N/A
0N/A#
0N/A# Freetype logic is applicable to OpenJDK only
0N/A#
0N/Aifdef OPENJDK
0N/A
0N/A#if we use system lib we do not need to copy it to build tree
0N/AUSING_SYSTEM_FT_LIB=false
0N/A
0N/Aifeq ($(PLATFORM), windows)
0N/A DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
0N/Aendif
0N/Aifeq ($(PLATFORM), linux)
0N/A DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
0N/Aendif
0N/Aifeq ($(PLATFORM), solaris)
0N/A # historically for Solaris we have slightly different devtools
0N/A # naming conventions
0N/A DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
0N/Aendif
0N/A
0N/ADEVTOOLS_FT_DIR_EXISTS = $(shell \
0N/A if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
0N/A echo true; \
0N/A else \
0N/A echo false; \
0N/A fi)
0N/A
0N/A ifdef ALT_FREETYPE_LIB_PATH
0N/A FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
0N/A else
0N/A ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
0N/A FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
0N/A else
0N/A FREETYPE_LIB_PATH = /usr/lib
0N/A USING_SYSTEM_FT_LIB=true
0N/A endif
0N/A endif
0N/A
0N/A ifeq ($(PLATFORM), windows)
0N/A FREETYPE_LIB = $(FREETYPE_LIB_PATH)/freetype.lib
0N/A else
0N/A FREETYPE_LIB = -L$(FREETYPE_LIB_PATH) -lfreetype
0N/A endif
0N/A
0N/A ifdef ALT_FREETYPE_HEADERS_PATH
0N/A FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
0N/A else
0N/A ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
0N/A FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
0N/A else
0N/A FREETYPE_HEADERS_PATH = /usr/include
0N/A endif
0N/A endif
0N/Aendif
0N/A
0N/A#
0N/A# Localizations for the different parts of the product beyond English
0N/A#
0N/A
0N/AJRE_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
0N/APLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
0N/AJDK_LOCALES = ja zh_CN
0N/A
0N/A#
0N/A# A list of locales we support but don't have resource files.
0N/A# This is defined to optimize the search of resource bundles.
0N/A#
0N/AJRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
0N/A
0N/A#
0N/A# All libraries except libjava and libjvm itself link against libjvm and
0N/A# libjava, the latter for its exported common utilities. libjava only links
0N/A# against libjvm. Programs' makefiles take their own responsibility for
0N/A# adding other libs.
0N/A#
0N/Aifdef PACKAGE
0N/A# put JAVALIB first, but do not lose any platform specific values....
0N/A LDLIBS_COMMON = $(JAVALIB)
0N/Aendif # PACKAGE
0N/A
0N/A#
0N/A# Libraries that must appear ahead of libc.so on the link command line
0N/A#
0N/Aifdef PROGRAM
0N/A
0N/A ifeq ($(PLATFORM), solaris)
0N/A LDLIBS_COMMON = -lthread -ldl
0N/A endif
0N/A
0N/A ifeq ($(PLATFORM), linux)
0N/A LDLIBS_COMMON = -ldl
0N/A endif
0N/A
0N/Aendif # PROGRAM
0N/A
0N/ALDLIBS_COMMON += $(EXTRA_LIBS)
0N/A
0N/A#
0N/A# Default is to build, not import native binaries
0N/A#
0N/Aifndef IMPORT_NATIVE_BINARIES
0N/A IMPORT_NATIVE_BINARIES=false
0N/Aendif
0N/A# If importing libraries in, no incremental builds
0N/Aifeq ($(IMPORT_NATIVE_BINARIES),true)
0N/A INCREMENTAL_BUILD=false
0N/Aendif
0N/A
0N/A# for generated libraries
0N/ALIBDIR = $(OUTPUTDIR)/lib
0N/AABS_LIBDIR = $(ABS_OUTPUTDIR)/lib
0N/A# Optional place to save the windows .lib files
0N/ALIBFILES_DIR = $(OUTPUTDIR)/libfiles
0N/A# for ext jre files
0N/AEXTDIR = $(LIBDIR)/ext
0N/A# for generated include files
0N/AINCLUDEDIR = $(OUTPUTDIR)/include
0N/A# for generated class files
0N/ACLASSBINDIR = $(OUTPUTDIR)/classes
0N/ADEMOCLASSDIR = $(OUTPUTDIR)/democlasses
0N/A# for generated tool class files
0N/ABUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses
0N/A# for build tool jar files
0N/ABUILDTOOLJARDIR = $(OUTPUTDIR)/btjars
0N/AABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
0N/A# for generated java source files
0N/AGENSRCDIR = $(OUTPUTDIR)/gensrc
0N/A# for generated C source files (not javah)
0N/AGENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc
0N/A# for imported source files
0N/AIMPORTSRCDIR = $(OUTPUTDIR)/impsrc
0N/A# for imported documents
0N/AIMPORTDOCDIR = $(OUTPUTDIR)/impdoc
0N/A# for generated demo
0N/ADEMODIR = $(OUTPUTDIR)/demo
0N/A# for sample code
0N/ASAMPLEDIR = $(OUTPUTDIR)/sample
0N/A# for generated documentation
0N/ADOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
0N/ADOCSDIRSUFFIX =
0N/A
0N/A# The MESSAGE, WARNING and ERROR files are used to store sanityck and
0N/A# SCCS check messages, warnings and errors.
0N/Aifndef ERROR_FILE
0N/A ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt
0N/Aendif
0N/Aifndef WARNING_FILE
0N/A WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
0N/Aendif
0N/Aifndef MESSAGE_FILE
0N/A MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
0N/Aendif
0N/A
0N/AJDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
0N/AJRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
0N/A
0N/A#where the demo source can be found
0N/ADEMOSRCDIR = $(SHARE_SRC)/demo
0N/A
0N/A# An attempt is made to generate unique enough directories for the
0N/A# generated files to not have name collisisons. Most build units
0N/A# defines PRODUCT (except Release.gmk), but then they may or may
0N/A# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and
0N/A# LIBRARY. This code chunk attempts to generate a unique
0N/A# OBJDIR/CLASSHDRDIR for each build unit based on which of those
0N/A# values are set within each build unit.
0N/A
0N/AUNIQUE_LOCATION_STRING = tmp
0N/A
0N/Aifneq ($(PRODUCT),)
0N/A UNIQUE_LOCATION_STRING += /$(PRODUCT)
0N/Aendif
0N/A
0N/Aifneq ($(PACKAGE),)
0N/A UNIQUE_LOCATION_STRING += /$(PACKAGE)
0N/Aendif
0N/A
0N/Aifneq ($(PROGRAM),)
0N/A UNIQUE_LOCATION_STRING += /$(PROGRAM)
0N/Aendif
0N/A
0N/Aifneq ($(LIBRARY),)
0N/A ifneq ($(LIBRARY_OUTPUT),)
0N/A UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
0N/A else
0N/A UNIQUE_LOCATION_STRING += /$(LIBRARY)
0N/A endif
0N/Aendif
0N/A
0N/Aifneq ($(THREADDIR),)
0N/A UNIQUE_LOCATION_STRING += /$(THREADDIR)
0N/Aendif
0N/A
0N/A# the use of += above makes a space separated list which we need to
0N/A# remove for filespecs.
0N/A#
0N/ANULLSTRING :=
0N/AONESPACE := $(NULLSTRING) # space before this comment is required.
0N/AUNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
0N/A
0N/A# TEMPDIR is a unique general purpose directory
0N/A# need to use 'override' because GNU Make on Linux exports the wrong
0N/A# value.
0N/Aoverride TEMPDIR = $(OUTPUTDIR)/$(UNIQUE_PATH)
0N/Aoverride ABS_TEMPDIR = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
0N/A
0N/A# This must be created right away for pattern rules in Sanity.gmk to work.
0N/Adummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
0N/Adummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
0N/A
0N/A# OBJDIRNAME is the name of the directory where the object code is to
0N/A# be placed. It's name depends on whether the data model architecture
0N/A# is 32-bit or not.
0N/Aifneq ($(ARCH_DATA_MODEL), 32)
0N/A OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
0N/Aelse
0N/A OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX)
0N/Aendif
0N/AOBJDIR = $(TEMPDIR)/$(OBJDIRNAME)
0N/A
0N/A# CLASSHDRDIR is where the generated C Class Header files go.
0N/ACLASSHDRDIR = $(TEMPDIR)/CClassHeaders
0N/A
0N/A#
0N/A# CLASSDESTDIR can be used to specify the directory where generated classes
0N/A# are to be placed. The default is CLASSBINDIR.
0N/A#
0N/Aifndef CLASSDESTDIR
0N/ACLASSDESTDIR = $(CLASSBINDIR)
0N/Aendif
0N/A
0N/AINCLUDES = -I. -I$(CLASSHDRDIR) \
0N/A $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
0N/AOTHER_CPPFLAGS = $(INCLUDES)
0N/A
0N/A
0N/A#
0N/A# vpaths. These are the default locations searched for source files.
0N/A# GNUmakefiles of individual areas often override the default settings.
0N/A# There are no longer default vpath entries for C and assembler files
0N/A# so we can ensure that libraries don't get their hands on JVM files.
0N/A#
0N/A# We define an intermediate variable for Java files because
0N/A# we use its value later to help define $SOURCEPATH
0N/A
0N/AVPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
0N/Aifdef OPENJDK
0N/A VPATH.java = $(VPATH0.java)
0N/Aelse
0N/A #
0N/A # If filenames are duplicated between open/closed workspaces, prefer
0N/A # the closed files.
0N/A #
0N/A # Source ordering is important: some targets depend on closed files
0N/A # replacing open ones, and thus the closed file sources must be found
0N/A # before the open ones.
0N/A #
0N/A # Don't reorder without consulting the teams that depend on this behavior.
0N/A #
0N/A VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
0N/Aendif
0N/Avpath %.java $(VPATH.java)
0N/Avpath %.class $(CLASSBINDIR)
0N/Avpath %.$(OBJECT_SUFFIX) $(OBJDIR)
0N/A
0N/A#
0N/A# VPATH.h is used elsewhere to generate include flags. By default,
0N/A# anyone has access to the include files that the JVM area exports,
0N/A# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
0N/A# relatives.
0N/A#
0N/AVPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/include$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/javavm/include
0N/Avpath %.h $(VPATH.h)
0N/A
0N/A#
0N/A# Used in two ways: helps link against libjava.so. Also if overridden
0N/A# determines where your shared library is installed.
0N/A#
0N/Aifndef LIB_LOCATION
0N/A LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
0N/Aendif
0N/A
0N/A#
0N/A# Java header and stub variables
0N/A#
0N/ACLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
0N/ACLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
0N/ASTUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h
0N/A
0N/A#
0N/A# Classpath seen by javac (different from the one seen by the VM
0N/A# running javac), and useful variables.
0N/A#
0N/ASOURCEPATH = $(VPATH.java)
0N/APKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
0N/APKGDIR = $(subst .,/,$(PACKAGE))
0N/A
0N/A#
0N/A# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
0N/A#
0N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
0N/A
0N/A#
0N/A# Set opt level to ALT_OPT if set otherwise _OPT
0N/A#
0N/APOPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
0N/A
0N/A#
0N/A# Convenient macros
0N/A#
0N/A
0N/A# Prepare $@ target, remove old one and making sure directory exists
0N/Adefine prep-target
0N/A$(MKDIR) -p $(@D)
0N/A$(RM) $@
0N/Aendef
0N/A
0N/A# Simple install of $< file to $@
0N/Adefine install-file
0N/A$(prep-target)
0N/A$(CP) $< $@
0N/Aendef
0N/A
0N/A# Cleanup rule for after debug java run (hotspot.log file is left around)
0N/A# (This could be an old leftover file in a read-only area, use the @- prefix)
0N/AHOTSPOT_LOG_NAME = hotspot.log
0N/Adefine java-vm-cleanup
0N/Aif [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
0N/Aendef
0N/A
0N/A# Default make settings for processing SUBDIRS with clobber or clean names
0N/ASUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
0N/ASUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false
0N/A
0N/A# Current directory
0N/ACURRENT_DIRECTORY := $(shell $(PWD))
0N/A
0N/A# If no timing wanted, we need to define these as empty
0N/Aifdef NO_TIMING
0N/A
0N/ATIMING_ID:=NA
0N/A
0N/Adefine TIMING_start
0N/At=0:0:0:0
0N/Aendef
0N/A
0N/Adefine TIMING_end
0N/Atime_used=0
0N/Aendef
0N/A
0N/Aelse # NO_TIMING
0N/A
0N/A# Default timing id
0N/ATIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
0N/A
0N/A# Timing start (must be used in same shell, e.g. same command line)
0N/A# Defines the shell variable $1 to have the start time.
0N/Adefine TIMING_start
0N/A$1=`$(DATE) +%j:%H:%M:%S`
0N/Aendef
0N/A
0N/A# Timing end (must be used in same shell, e.g. same command line)
0N/A# Expects shell variable $1 to have been defined as the start time.
0N/A# Expects shell variable $2 to have timing id string
0N/A# Sets total_seconds shell variable as the total seconds used.
0N/A# Sets time_used shell variable to contain format "%dh%dm%ds"
0N/Adefine TIMING_end
0N/AbegTime="$${$1}"; \
0N/Atiming_id="$${$2}"; \
0N/AendTime=`$(DATE) +%j:%H:%M:%S`; \
0N/Ad1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${d1}" = "" ] ; then d1=0; fi; \
0N/Ah1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${h1}" = "" ] ; then h1=0; fi; \
0N/Am1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${m1}" = "" ] ; then m1=0; fi; \
0N/As1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${s1}" = "" ] ; then s1=0; fi; \
0N/Ad2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${d2}" = "" ] ; then d2=0; fi; \
0N/Ah2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${h2}" = "" ] ; then h2=0; fi; \
0N/Am2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${m2}" = "" ] ; then m2=0; fi; \
0N/As2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
0N/Aif [ "$${s2}" = "" ] ; then s2=0; fi; \
0N/At1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
0N/A '+' $${m1} '*' 60 '+' $${s1}`; \
0N/At2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
0N/A '+' $${m2} '*' 60 '+' $${s2}`; \
0N/Atotal_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
0N/Aif [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
0N/At_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
0N/At_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
0N/At_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
0N/Atime_used=$${t_sec}; \
0N/Aif [ "$${t_hour}" != "0h" ] ; then \
0N/Atime_used=$${t_hour}$${t_min}$${t_sec}; \
0N/Aelif [ "$${t_min}" != "0m" ] ; then \
0N/Atime_used=$${t_min}$${t_sec}; \
0N/Aelse \
0N/Atime_used=$${t_sec}; \
0N/Afi; \
0N/A$(PRINTF) " Timing: %05d seconds or %s for %s\n" \
0N/A $${total_seconds} $${time_used} $${timing_id}
0N/Aendef
0N/A
0N/Aendif # NO_TIMING
0N/A
0N/A# Given a SUBDIRS list, cd into them and make them
0N/A# SUBDIRS_MAKEFLAGS Make settings for a subdir make
0N/A# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
0N/Adefine SUBDIRS-loop
0N/A@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
0N/A@for i in DUMMY $(SUBDIRS) ; do \
0N/A if [ "$$i" != "DUMMY" ] ; then \
0N/A $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
0N/A timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
0N/A $(call TIMING_start,startTime); \
0N/A curDir=$(CURRENT_DIRECTORY); \
0N/A $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
0N/A $(SUBDIRS_MAKEFLAGS) \
0N/A $(SUBDIRS_MAKEFLAGS-$@) \
0N/A FULL_VERSION=$(FULL_VERSION) \
0N/A RELEASE=$(RELEASE) || exit 1; \
0N/A $(CD) $${curDir}; \
0N/A $(call TIMING_end,startTime,timing_id); \
0N/A $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
0N/A fi ; \
0N/Adone
0N/A@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
0N/Aendef
0N/A
0N/A# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
0N/A# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
0N/Adefine OTHERSUBDIRS-loop
0N/A@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
0N/A@for i in DUMMY $(OTHERSUBDIRS) ; do \
0N/A if [ "$$i" != "DUMMY" ] ; then \
0N/A $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
0N/A timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
0N/A $(call TIMING_start,startTime); \
0N/A curDir=$(CURRENT_DIRECTORY); \
0N/A $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
0N/A $(OTHERSUBDIRS_MAKEFLAGS) \
0N/A FULL_VERSION=$(FULL_VERSION) \
0N/A RELEASE=$(RELEASE) || exit 1; \
0N/A $(CD) $${curDir}; \
0N/A $(call TIMING_end,startTime,timing_id); \
0N/A $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
0N/A fi ; \
0N/Adone
0N/A@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
0N/Aendef
0N/A
0N/A#
0N/A# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
0N/A# used for this file, otherwise the default settings are used.
0N/A#
0N/ACFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \
0N/A $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
0N/ACXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \
0N/A $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
0N/A
0N/A#
0N/A# Tool flags
0N/A#
0N/AASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
0N/ACFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS)
0N/ACXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
0N/ACPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
0N/A $(DEFINES) $(OPTIONS:%=-D%)
0N/ALDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
0N/ALDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
0N/ALINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
0N/A $(OTHER_LINTFLAGS)
0N/A
0N/A# this should be moved into Defs-<platform>.gmk.....
0N/Aifeq ($(PLATFORM), windows)
0N/A VERSION_DEFINES = -DRELEASE="\"$(RELEASE)\""
0N/Aelse
0N/A VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
0N/Aendif
0N/A
0N/A# Note: As a rule, GNU Make rules should not appear in any of the
0N/A# Defs*.gmk files. These were added for Kestrel-Solaris and do address
0N/A# a TeamWare bug. They should be moved elsewhere for Merlin.
0N/A#
0N/A# Override gnumake built-in rules which do sccs get operations badly.
0N/A# (They put the checked out code in the current directory, not in the
0N/A# directory of the original file.)
0N/A# Since this is a symptom of a teamware failure, complain and die on the spot.
0N/A
0N/A# This message immediately goes to stdout and the build terminates.
0N/Adefine SCCS-trouble
0N/A$(error \
0N/A"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
0N/A is out of date with respect to its SCCS file $<. \
0N/A This can happen from an unresolved Teamware conflict, a file movement, or \
0N/A a failure in which SCCS files are updated but the 'sccs get' was not done. \
0N/A You should double check for other out of date files in your workspace. \
0N/A Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
0N/Aendef
0N/A
0N/A%:: s.%
0N/A @$(SCCS-trouble)
0N/A%:: SCCS/s.%
0N/A @$(SCCS-trouble)
0N/A @$(ECHO) " is out of date with respect to its SCCS file." >> $(WARNING_FILE)
0N/A @$(ECHO) " This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
0N/A @$(ECHO) " This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
0N/A @$(ECHO) " in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
0N/A @$(ECHO) " Check for other out of date files in your workspace." >> $(WARNING_FILE)
0N/A @$(ECHO) "" >> $(WARNING_FILE)
0N/A @#exit 666
0N/A
0N/Aifdef INSANE
0N/A export INSANE
0N/Aendif
0N/A
0N/Aifdef ALT_COPYRIGHT_YEAR
0N/A COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
0N/Aelse
0N/A COPYRIGHT_YEAR = $(shell $(DATE) '+%Y')
0N/Aendif
0N/A
0N/A# Install of imported file (JDK_IMPORT_PATH, or some other external location)
0N/Adefine install-import-file
0N/A@$(ECHO) "ASSEMBLY_IMPORT: $@"
0N/A$(install-file)
0N/Aendef
0N/A
0N/A.PHONY: all build clean clobber