1 #
   2 # Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 #
  27 # Common variables used by all the Java makefiles.  This file should
  28 # not contain rules.
  29 #
  30 
  31 # WARNING: This file is shared with other components.
  32 #
  33 
  34 ifndef JDK_MAKE_SHARED_DIR
  35   JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/make/common/shared
  36 endif
  37 
  38 ifndef HOTSPOT_TOPDIR
  39   HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
  40 endif
  41 ifndef LANGTOOLS_TOPDIR
  42   LANGTOOLS_TOPDIR=$(TOPDIR)/langtools
  43 endif
  44 ifndef CORBA_TOPDIR
  45   CORBA_TOPDIR=$(TOPDIR)/corba
  46 endif
  47 ifndef JAXP_TOPDIR
  48   JAXP_TOPDIR=$(TOPDIR)/jaxp
  49 endif
  50 ifndef JAXWS_TOPDIR
  51   JAXWS_TOPDIR=$(TOPDIR)/jaxws
  52 endif
  53 ifndef JDK_TOPDIR
  54   JDK_TOPDIR=$(TOPDIR)/jdk
  55 endif
  56 ifndef INSTALL_TOPDIR
  57   INSTALL_TOPDIR=$(TOPDIR)/install
  58 endif
  59 ifndef SPONSORS_TOPDIR
  60   SPONSORS_TOPDIR=$(TOPDIR)/sponsors
  61 endif
  62 ifndef DEPLOY_TOPDIR
  63   DEPLOY_TOPDIR=$(TOPDIR)/deploy
  64 endif
  65 
  66 # Get shared platform settings
  67 include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
  68 
  69 # Default directory immediately above the "build" output directory (OUTPUTDIR)
  70 BUILD_PARENT_DIRECTORY=$(TOPDIR)
  71 
  72 # Get platform specific settings
  73 include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
  74 
  75 SRC_BUNDLEDIR       = $(OUTPUTDIR)/source-bundles
  76 ABS_SRC_BUNDLEDIR   = $(ABS_OUTPUTDIR)/source-bundles
  77 BIN_BUNDLEDIR       = $(OUTPUTDIR)/bundles
  78 ABS_BIN_BUNDLEDIR   = $(ABS_OUTPUTDIR)/bundles
  79 JRL_BUNDLEDIR       = $(OUTPUTDIR)/java.net
  80 ABS_JRL_BUNDLEDIR   = $(ABS_OUTPUTDIR)/java.net
  81 
  82 dummy := $(shell $(MKDIR) -p $(BIN_BUNDLEDIR))
  83 dummy := $(shell $(MKDIR) -p $(SRC_BUNDLEDIR) )
  84 dummy := $(shell $(MKDIR) -p $(JRL_BUNDLEDIR) )
  85 
  86 TEMP_DIR = $(OUTPUTDIR)/tmp
  87 ABS_TEMP_DIR = $(ABS_OUTPUTDIR)/tmp
  88 
  89 dummy := $(shell $(MKDIR) -p $(TEMP_DIR))
  90 
  91 # The language version we want for this jdk build
  92 SOURCE_LANGUAGE_VERSION=7
  93 # The class version we want for this jdk build
  94 TARGET_CLASS_VERSION=7
  95 
  96 # The MESSAGE, WARNING and ERROR files are used to store sanity check and 
  97 # source check messages, warnings and errors. 
  98 export ERROR_FILE   := $(ABS_OUTPUTDIR)/sanityCheckErrors.txt
  99 export WARNING_FILE := $(ABS_OUTPUTDIR)/sanityCheckWarnings.txt
 100 export MESSAGE_FILE := $(ABS_OUTPUTDIR)/sanityCheckMessages.txt
 101 
 102 # source bundle generation definitions
 103 BUNDLE_DATE := $(shell $(DATE) '+%d_%b_%Y' | $(TR) "[A-Z]" "[a-z]")
 104 ifdef ALT_BUNDLE_DATE
 105   BUNDLE_DATE := $(ALT_BUNDLE_DATE)
 106 endif
 107 
 108 # If the update version contains non-numeric characters, we need
 109 # to massage it into a numeric format.  Unfortunately, the
 110 # Windows VERSIONINFO resource that we stick in jvm.dll cannot
 111 # handle non-numeric characters.  We have to do this here because
 112 # Hotspot (nmake) cannot handle calculations.  So we use the
 113 # following formula:
 114 # COOKED_JDK_UPDATE_VERSION = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
 115 # 
 116 # Here are some examples:
 117 #     1.5.0    b01  ->  5,0,0,1
 118 #     1.5.0_10 b01  ->  5,0,100,1 
 119 #     1.4.2 b01     ->  4,2,0,1
 120 #     1.4.2_02 b01  ->  4,2,20,1
 121 #     1.4.2_02a b01 ->  4,2,21,1
 122 #     1.4.2_02b b01 ->  4,2,22,1
 123 ifdef JDK_UPDATE_VERSION
 124   VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345")
 125   CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}')
 126   CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}')
 127   CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}')
 128   ifeq ($(CHAR3),)
 129     CHAR3 := 0
 130   endif
 131   ifeq ($(CHAR1), 0)
 132     COOKED_JDK_UPDATE_VERSION := $(CHAR2)$(CHAR3)
 133   else
 134     COOKED_JDK_UPDATE_VERSION := $(CHAR1)$(CHAR2)$(CHAR3)
 135   endif
 136 endif
 137 
 138 ifneq ($(JDK_BUILD_NUMBER),)
 139  COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) \
 140                                | $(SED) -e 's/^b//' | $(SED) -e 's/^0//')
 141 else
 142  COOKED_BUILD_NUMBER = 0
 143 endif
 144