Defs-control.gmk 4.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
#
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# 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 components.
#

ifndef JDK_MAKE_SHARED_DIR
  JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/makefiles/common/shared
endif

ifndef HOTSPOT_TOPDIR
  HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
endif
ifndef LANGTOOLS_TOPDIR
  LANGTOOLS_TOPDIR=$(TOPDIR)/langtools
endif
ifndef CORBA_TOPDIR
  CORBA_TOPDIR=$(TOPDIR)/corba
endif
ifndef JAXP_TOPDIR
  JAXP_TOPDIR=$(TOPDIR)/jaxp
endif
ifndef JAXWS_TOPDIR
  JAXWS_TOPDIR=$(TOPDIR)/jaxws
endif
ifndef JDK_TOPDIR
  JDK_TOPDIR=$(TOPDIR)/jdk
endif
ifndef INSTALL_TOPDIR
  INSTALL_TOPDIR=$(TOPDIR)/install
endif
ifndef SPONSORS_TOPDIR
  SPONSORS_TOPDIR=$(TOPDIR)/sponsors
endif
ifndef DEPLOY_TOPDIR
  DEPLOY_TOPDIR=$(TOPDIR)/deploy
endif

# Get shared platform settings
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk

# Default directory immediately above the "build" output directory (OUTPUTDIR)
BUILD_PARENT_DIRECTORY=$(TOPDIR)

# Get platform specific settings
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk

SRC_BUNDLEDIR       = $(OUTPUTDIR)/source-bundles
ABS_SRC_BUNDLEDIR   = $(ABS_OUTPUTDIR)/source-bundles
BIN_BUNDLEDIR       = $(OUTPUTDIR)/bundles
BIN_DEMOS_BUNDLEDIR = $(OUTPUTDIR)/demos-bundles
ABS_BIN_BUNDLEDIR   = $(ABS_OUTPUTDIR)/bundles

dummy := $(shell $(MKDIR) -p $(BIN_BUNDLEDIR))
dummy := $(shell $(MKDIR) -p $(BIN_DEMOS_BUNDLEDIR) )
dummy := $(shell $(MKDIR) -p $(SRC_BUNDLEDIR) )

TEMP_DIR = $(OUTPUTDIR)/tmp
ABS_TEMP_DIR = $(ABS_OUTPUTDIR)/tmp

dummy := $(shell $(MKDIR) -p $(TEMP_DIR))

# The language version we want for this jdk build
SOURCE_LANGUAGE_VERSION=7
# The class version we want for this jdk build
TARGET_CLASS_VERSION=7

# The MESSAGE, WARNING and ERROR files are used to store sanity check and 
# source check messages, warnings and errors. 
export ERROR_FILE   := $(ABS_OUTPUTDIR)/sanityCheckErrors.txt
export WARNING_FILE := $(ABS_OUTPUTDIR)/sanityCheckWarnings.txt
export MESSAGE_FILE := $(ABS_OUTPUTDIR)/sanityCheckMessages.txt

# source bundle generation definitions
BUNDLE_DATE := $(shell $(DATE) '+%d_%b_%Y' | $(TR) "[A-Z]" "[a-z]")
ifdef ALT_BUNDLE_DATE
  BUNDLE_DATE := $(ALT_BUNDLE_DATE)
endif

# If the update version contains non-numeric characters, we need
# to massage it into a numeric format.  Unfortunately, the
# Windows VERSIONINFO resource that we stick in jvm.dll cannot
# handle non-numeric characters.  We have to do this here because
# Hotspot (nmake) cannot handle calculations.  So we use the
# following formula:
# COOKED_JDK_UPDATE_VERSION = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
# 
# Here are some examples:
#     1.5.0    b01  ->  5,0,0,1
#     1.5.0_10 b01  ->  5,0,100,1 
#     1.4.2 b01     ->  4,2,0,1
#     1.4.2_02 b01  ->  4,2,20,1
#     1.4.2_02a b01 ->  4,2,21,1
#     1.4.2_02b b01 ->  4,2,22,1
ifdef JDK_UPDATE_VERSION
  VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345")
  CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}')
  CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}')
  CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}')
  ifeq ($(CHAR3),)
    CHAR3 := 0
  endif
  ifeq ($(CHAR1), 0)
    COOKED_JDK_UPDATE_VERSION := $(CHAR2)$(CHAR3)
  else
    COOKED_JDK_UPDATE_VERSION := $(CHAR1)$(CHAR2)$(CHAR3)
  endif
endif

ifneq ($(JDK_BUILD_NUMBER),)
 COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) \
			       | $(SED) -e 's/^b//' | $(SED) -e 's/^0//')
else
 COOKED_BUILD_NUMBER = 0
endif