corba/make/common/Defs.gmk
author tbell
Thu, 30 Jul 2009 23:37:25 -0700
changeset 3359 0589e2ed45b3
parent 4 02bb8761fcce
child 3871 3d528461f61d
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     2
# Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
# have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
# Common variables used by all the Java makefiles.  This file should
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
# not contain rules.
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
#    This little rule is only understood by Sun's make, and is harmless
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
#    when seen by the GNU make tool. If using Sun's make, this causes the
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
#    make command to fail.
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
include $(BUILDDIR)/common/shared/Platform.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
TOPDIR=$(BUILDDIR)/..
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
include $(TOPDIR)/make/common/CancelImplicits.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
# src/solaris so if you want to build on Linux you didn't need a src/linux
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
# directory.  In an ideal world it would be called src/genunix but we are not
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
# there yet.
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
ifndef SHARE_SRC
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
  SHARE_SRC    = $(TOPDIR)/src/share
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
_OUTPUTDIR=$(TOPDIR)/build/$(PLATFORM)-$(ARCH)
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
# Get platform definitions
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
include $(TOPDIR)/make/common/Defs-$(PLATFORM).gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
# Localizations for the different parts of the product beyond English
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
JRE_LOCALES   = de es fr it ja ko sv zh_CN zh_TW zh_HK
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
JDK_LOCALES  = ja zh_CN
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
# A list of locales we support but don't have resource files.
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
# This is defined to optimize the search of resource bundles.
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
# All libraries except libjava and libjvm itself link against libjvm and
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
# libjava, the latter for its exported common utilities.  libjava only links
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
# against libjvm.  Programs' makefiles take their own responsibility for
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
# adding other libs.
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
ifdef PACKAGE
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
# put JAVALIB first, but do not lose any platform specific values....
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
  LDLIBS_COMMON = $(JAVALIB)
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
endif # PACKAGE
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
# Libraries that must appear ahead of libc.so on the link command line
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
ifdef PROGRAM
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
  ifeq ($(PLATFORM), solaris)
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
    LDLIBS_COMMON = -lthread -ldl
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
  ifeq ($(PLATFORM), linux)
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
    LDLIBS_COMMON = -ldl
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
endif # PROGRAM
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
LDLIBS_COMMON += $(EXTRA_LIBS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
# Default is to build, not import native binaries
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
ifndef IMPORT_NATIVE_BINARIES
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
  IMPORT_NATIVE_BINARIES=false
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
# If importing libraries in, no incremental builds
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
ifeq ($(IMPORT_NATIVE_BINARIES),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
 INCREMENTAL_BUILD=false
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
# for generated libraries
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
LIBDIR              = $(OUTPUTDIR)/lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
ABS_LIBDIR          = $(ABS_OUTPUTDIR)/lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
# Optional place to save the windows .lib files
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
LIBFILES_DIR        = $(OUTPUTDIR)/libfiles
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
# for ext jre files
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
EXTDIR              = $(LIBDIR)/ext
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
# for generated include files
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
INCLUDEDIR          = $(OUTPUTDIR)/include
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
# for generated class files
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
CLASSBINDIR         = $(OUTPUTDIR)/classes
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
# for generated tool class files
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
# for build tool jar files
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
BUILDTOOLJARDIR     = $(OUTPUTDIR)/btjars
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
# for generated java source files
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
GENSRCDIR           = $(OUTPUTDIR)/gensrc
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
# for generated C source files (not javah)
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
GENNATIVESRCDIR     = $(OUTPUTDIR)/gennativesrc
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
# for imported source files
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
IMPORTSRCDIR        = $(OUTPUTDIR)/impsrc
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
# for imported documents
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
IMPORTDOCDIR        = $(OUTPUTDIR)/impdoc
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
# for generated demo
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
DEMODIR             = $(OUTPUTDIR)/demo
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
# for sample code
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
SAMPLEDIR           = $(OUTPUTDIR)/sample
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
# for generated documentation
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
DOCSDIR             = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
DOCSDIRSUFFIX       =
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
# An attempt is made to generate unique enough directories for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
# generated files to not have name collisisons. Most build units
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
# defines PRODUCT (except Release.gmk), but then they may or may 
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and 
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
# LIBRARY. This code chunk attempts to generate a unique 
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
# OBJDIR/CLASSHDRDIR for each build unit based on which of those 
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
# values are set within each build unit.
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
UNIQUE_LOCATION_STRING = tmp
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
ifneq ($(PRODUCT),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
  UNIQUE_LOCATION_STRING += /$(PRODUCT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
ifneq ($(PACKAGE),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
  UNIQUE_LOCATION_STRING += /$(PACKAGE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
ifneq ($(PROGRAM),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
  UNIQUE_LOCATION_STRING += /$(PROGRAM)
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
ifneq ($(LIBRARY),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
  ifneq ($(LIBRARY_OUTPUT),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
    UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
  else
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
    UNIQUE_LOCATION_STRING += /$(LIBRARY)
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
ifneq ($(THREADDIR),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
  UNIQUE_LOCATION_STRING += /$(THREADDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
# the use of += above makes a space separated list which we need to 
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
# remove for filespecs.
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
NULLSTRING :=
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
ONESPACE := $(NULLSTRING) # space before this comment is required.
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
# TEMPDIR is a unique general purpose directory
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
# need to use 'override' because GNU Make on Linux exports the wrong
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
# value.
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
override TEMPDIR      = $(OUTPUTDIR)/$(UNIQUE_PATH)
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
override ABS_TEMPDIR  = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
# This must be created right away for pattern rules in Sanity.gmk to work.
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
# OBJDIRNAME is the name of the directory where the object code is to
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
#   be placed. It's name depends on whether the data model architecture 
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
#   is 32-bit or not.
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
ifneq ($(ARCH_DATA_MODEL), 32)
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
  OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
  OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
OBJDIR      = $(TEMPDIR)/$(OBJDIRNAME)
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
# CLASSHDRDIR is where the generated C Class Header files go.
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
# CLASSDESTDIR can be used to specify the directory where generated classes
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
# are to be placed. The default is CLASSBINDIR.
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
ifndef CLASSDESTDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
CLASSDESTDIR = $(CLASSBINDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
INCLUDES = -I. -I$(CLASSHDRDIR) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
	$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
OTHER_CPPFLAGS = $(INCLUDES)
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
# vpaths.  These are the default locations searched for source files.
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
# GNUmakefiles of individual areas often override the default settings.
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
# There are no longer default vpath entries for C and assembler files
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
# so we can ensure that libraries don't get their hands on JVM files.
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
# We define an intermediate variable for Java files because
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
# we use its value later to help define $SOURCEPATH
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
VPATH.java = $(VPATH0.java)
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
vpath %.java $(VPATH.java)
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
vpath %.class $(CLASSBINDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
# VPATH.h is used elsewhere to generate include flags.  By default, 
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
# anyone has access to the include files that the JVM area exports,
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
# relatives.
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
ifeq ($(PLATFORM), windows)
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
  VPATH.h = $(BOOTDIR)/include;$(BOOTDIR)/include/$(PLATFORM_INCLUDE_NAME)
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
  VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/include$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/javavm/include
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
vpath %.h   $(VPATH.h)
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
# Used in two ways: helps link against libjava.so. Also if overridden
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
# determines where your shared library is installed.
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
ifndef LIB_LOCATION
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
  LIB_LOCATION    =  $(LIBDIR)/$(LIBARCH)
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
# Java header and stub variables
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
CLASSHDRS     = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
STUBPREAMBLE  = $(INCLUDEDIR)/StubPreamble.h
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
# Classpath seen by javac (different from the one seen by the VM
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
# running javac), and useful variables.
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
SOURCEPATH	= $(VPATH.java)
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
PKG		= $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
PKGDIR		= $(subst .,/,$(PACKAGE))
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
include $(BUILDDIR)/common/shared/Defs-java.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
# Set opt level to ALT_OPT if set otherwise _OPT
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
POPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
# Convenient macros
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
# Prepare $@ target, remove old one and making sure directory exists
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
define prep-target
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
$(MKDIR) -p $(@D)
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
$(RM) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
# Simple install of $< file to $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
define install-file
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
$(CP) $< $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
# Cleanup rule for after debug java run (hotspot.log file is left around)
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
#   (This could be an old leftover file in a read-only area, use the @- prefix)
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
HOTSPOT_LOG_NAME = hotspot.log
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
define java-vm-cleanup
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
# Default make settings for processing SUBDIRS with clobber or clean names
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
SUBDIRS_MAKEFLAGS-clean   = INCREMENTAL_BUILD=false
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
# Current directory
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
CURRENT_DIRECTORY := $(shell $(PWD))
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
# If no timing wanted, we need to define these as empty
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
ifdef NO_TIMING
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
TIMING_ID:=NA
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
define TIMING_start
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
t=0:0:0:0
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
define TIMING_end
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
time_used=0
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
else # NO_TIMING
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
# Default timing id
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
# Timing start (must be used in same shell, e.g. same command line)
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
#    Defines the shell variable $1 to have the start time.
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
define TIMING_start
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
$1=`$(DATE) +%j:%H:%M:%S`
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
# Timing end (must be used in same shell, e.g. same command line)
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
#    Expects shell variable $1 to have been defined as the start time.
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
#    Expects shell variable $2 to have timing id string
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
#    Sets total_seconds shell variable as the total seconds used.
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
#    Sets time_used shell variable to contain format "%dh%dm%ds"
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
define TIMING_end
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
begTime="$${$1}"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
timing_id="$${$2}"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
endTime=`$(DATE) +%j:%H:%M:%S`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
if [ "$${d1}" = "" ] ; then d1=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
if [ "$${h1}" = "" ] ; then h1=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
if [ "$${m1}" = "" ] ; then m1=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
if [ "$${s1}" = "" ] ; then s1=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
if [ "$${d2}" = "" ] ; then d2=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
if [ "$${h2}" = "" ] ; then h2=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
if [ "$${m2}" = "" ] ; then m2=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
if [ "$${s2}" = "" ] ; then s2=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
		 '+' $${m1} '*' 60 '+' $${s1}`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
		 '+' $${m2} '*' 60 '+' $${s2}`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
time_used=$${t_sec}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
if [ "$${t_hour}" != "0h" ] ; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
time_used=$${t_hour}$${t_min}$${t_sec}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
elif [ "$${t_min}" != "0m" ] ; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
time_used=$${t_min}$${t_sec}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
time_used=$${t_sec}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
$(PRINTF) "  Timing: %05d seconds or %s for %s\n" \
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
    $${total_seconds} $${time_used} $${timing_id}
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
endif # NO_TIMING
02bb8761fcce Initial load
duke
parents:
diff changeset
   387
02bb8761fcce Initial load
duke
parents:
diff changeset
   388
# Given a SUBDIRS list, cd into them and make them
02bb8761fcce Initial load
duke
parents:
diff changeset
   389
#   SUBDIRS_MAKEFLAGS      Make settings for a subdir make
02bb8761fcce Initial load
duke
parents:
diff changeset
   390
#   SUBDIRS_MAKEFLAGS-$@   Make settings specific to this target
02bb8761fcce Initial load
duke
parents:
diff changeset
   391
define SUBDIRS-loop
02bb8761fcce Initial load
duke
parents:
diff changeset
   392
@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   393
@for i in DUMMY $(SUBDIRS) ; do \
02bb8761fcce Initial load
duke
parents:
diff changeset
   394
  if [ "$$i" != "DUMMY" ] ; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   395
    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   396
    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   397
    $(call TIMING_start,startTime); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   398
    curDir=$(CURRENT_DIRECTORY); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   399
    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
02bb8761fcce Initial load
duke
parents:
diff changeset
   400
			  $(SUBDIRS_MAKEFLAGS) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   401
			  $(SUBDIRS_MAKEFLAGS-$@) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   402
			  FULL_VERSION=$(FULL_VERSION) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   403
			  RELEASE=$(RELEASE) || exit 1; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   404
	       $(CD) $${curDir}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   405
    $(call TIMING_end,startTime,timing_id); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   406
    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   407
  fi ; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   408
done
02bb8761fcce Initial load
duke
parents:
diff changeset
   409
@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   410
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   411
02bb8761fcce Initial load
duke
parents:
diff changeset
   412
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
02bb8761fcce Initial load
duke
parents:
diff changeset
   413
#   OTHERSUBDIRS_MAKEFLAGS      Make settings for a subdir make
02bb8761fcce Initial load
duke
parents:
diff changeset
   414
define OTHERSUBDIRS-loop
02bb8761fcce Initial load
duke
parents:
diff changeset
   415
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   416
@for i in DUMMY $(OTHERSUBDIRS) ; do \
02bb8761fcce Initial load
duke
parents:
diff changeset
   417
  if [ "$$i" != "DUMMY" ] ; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   418
    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   419
    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   420
    $(call TIMING_start,startTime); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   421
    curDir=$(CURRENT_DIRECTORY); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   422
    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
02bb8761fcce Initial load
duke
parents:
diff changeset
   423
		          $(OTHERSUBDIRS_MAKEFLAGS) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   424
			  FULL_VERSION=$(FULL_VERSION) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   425
			  RELEASE=$(RELEASE) || exit 1; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   426
	       $(CD) $${curDir}; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   427
    $(call TIMING_end,startTime,timing_id); \
02bb8761fcce Initial load
duke
parents:
diff changeset
   428
    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   429
  fi ; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   430
done
02bb8761fcce Initial load
duke
parents:
diff changeset
   431
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   432
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   433
02bb8761fcce Initial load
duke
parents:
diff changeset
   434
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   435
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
02bb8761fcce Initial load
duke
parents:
diff changeset
   436
#    used for this file, otherwise the default settings are used.
02bb8761fcce Initial load
duke
parents:
diff changeset
   437
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   438
CFLAGS_$(VARIANT)/BYFILE    = $(CFLAGS_$(VARIANT)/$(@F)) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   439
                              $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
02bb8761fcce Initial load
duke
parents:
diff changeset
   440
CXXFLAGS_$(VARIANT)/BYFILE  = $(CXXFLAGS_$(VARIANT)/$(@F)) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   441
                              $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
02bb8761fcce Initial load
duke
parents:
diff changeset
   442
02bb8761fcce Initial load
duke
parents:
diff changeset
   443
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   444
# Tool flags
02bb8761fcce Initial load
duke
parents:
diff changeset
   445
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   446
ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   447
CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   448
CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   449
CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   450
		  $(DEFINES) $(OPTIONS:%=-D%)
02bb8761fcce Initial load
duke
parents:
diff changeset
   451
LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   452
LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
02bb8761fcce Initial load
duke
parents:
diff changeset
   453
LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   454
		  $(OTHER_LINTFLAGS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   455
02bb8761fcce Initial load
duke
parents:
diff changeset
   456
# this should be moved into Defs-<platform>.gmk.....
02bb8761fcce Initial load
duke
parents:
diff changeset
   457
ifeq ($(PLATFORM), windows)
02bb8761fcce Initial load
duke
parents:
diff changeset
   458
  VERSION_DEFINES = -DRELEASE="\"$(RELEASE)\""
02bb8761fcce Initial load
duke
parents:
diff changeset
   459
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   460
  VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
02bb8761fcce Initial load
duke
parents:
diff changeset
   461
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   462
02bb8761fcce Initial load
duke
parents:
diff changeset
   463
# Note: As a rule, GNU Make rules should not appear in any of the 
02bb8761fcce Initial load
duke
parents:
diff changeset
   464
# Defs*.gmk files. These were added for Kestrel-Solaris and do address
02bb8761fcce Initial load
duke
parents:
diff changeset
   465
# a TeamWare bug. They should be moved elsewhere for Merlin.
02bb8761fcce Initial load
duke
parents:
diff changeset
   466
# 
02bb8761fcce Initial load
duke
parents:
diff changeset
   467
#  Override gnumake built-in rules which do sccs get operations badly.
02bb8761fcce Initial load
duke
parents:
diff changeset
   468
#  (They put the checked out code in the current directory, not in the
02bb8761fcce Initial load
duke
parents:
diff changeset
   469
#  directory of the original file.) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   470
# Since this is a symptom of a teamware failure, complain and die on the spot.
02bb8761fcce Initial load
duke
parents:
diff changeset
   471
02bb8761fcce Initial load
duke
parents:
diff changeset
   472
# This message immediately goes to stdout and the build terminates.
02bb8761fcce Initial load
duke
parents:
diff changeset
   473
define SCCS-trouble
02bb8761fcce Initial load
duke
parents:
diff changeset
   474
$(error  \
02bb8761fcce Initial load
duke
parents:
diff changeset
   475
"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   476
 is out of date with respect to its SCCS file $<. \
02bb8761fcce Initial load
duke
parents:
diff changeset
   477
 This can happen from an unresolved Teamware conflict, a file movement, or \
02bb8761fcce Initial load
duke
parents:
diff changeset
   478
 a failure in which SCCS files are updated but the 'sccs get' was not done. \
02bb8761fcce Initial load
duke
parents:
diff changeset
   479
 You should double check for other out of date files in your workspace. \
02bb8761fcce Initial load
duke
parents:
diff changeset
   480
 Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
02bb8761fcce Initial load
duke
parents:
diff changeset
   481
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   482
02bb8761fcce Initial load
duke
parents:
diff changeset
   483
%:: s.%
02bb8761fcce Initial load
duke
parents:
diff changeset
   484
	@$(SCCS-trouble)
02bb8761fcce Initial load
duke
parents:
diff changeset
   485
%:: SCCS/s.%
02bb8761fcce Initial load
duke
parents:
diff changeset
   486
	@$(SCCS-trouble)
02bb8761fcce Initial load
duke
parents:
diff changeset
   487
	@$(ECHO) "         is out of date with respect to its SCCS file." >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   488
	@$(ECHO) "         This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   489
	@$(ECHO) "         This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   490
	@$(ECHO) "         in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   491
	@$(ECHO) "         Check for other out of date files in your workspace." >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   492
	@$(ECHO) "" >> $(WARNING_FILE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   493
	@#exit 666
02bb8761fcce Initial load
duke
parents:
diff changeset
   494
02bb8761fcce Initial load
duke
parents:
diff changeset
   495
ifdef INSANE
02bb8761fcce Initial load
duke
parents:
diff changeset
   496
  export INSANE
02bb8761fcce Initial load
duke
parents:
diff changeset
   497
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   498
02bb8761fcce Initial load
duke
parents:
diff changeset
   499
ifdef ALT_COPYRIGHT_YEAR
02bb8761fcce Initial load
duke
parents:
diff changeset
   500
  COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   501
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   502
  COPYRIGHT_YEAR = $(shell $(DATE) '+%Y')
02bb8761fcce Initial load
duke
parents:
diff changeset
   503
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   504
02bb8761fcce Initial load
duke
parents:
diff changeset
   505
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
02bb8761fcce Initial load
duke
parents:
diff changeset
   506
define install-import-file
02bb8761fcce Initial load
duke
parents:
diff changeset
   507
@$(ECHO) "ASSEMBLY_IMPORT: $@"
02bb8761fcce Initial load
duke
parents:
diff changeset
   508
$(install-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   509
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   510
02bb8761fcce Initial load
duke
parents:
diff changeset
   511
.PHONY: all build clean clobber