1 #
   2 # Copyright (c) 2011, 2015, 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 include ProfileNames.gmk
  27 
  28 ##########################################################################################
  29 # Install the launcher name, release version string, full version
  30 # string and the runtime name into the Version.java file.
  31 # To be printed by java -version
  32 
  33 $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
  34 $(PROFILE_VERSION_JAVA_TARGETS): \
  35     $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
  36         $(MKDIR) -p $(@D)
  37         $(RM) $@ $@.tmp
  38         $(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@)
  39         $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
  40             -e 's/@@java_version@@/$(RELEASE)/g' \
  41             -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
  42             -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
  43             -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
  44             $< > $@.tmp
  45         $(MV) $@.tmp $@
  46 
  47 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
  48     $(PROFILE_VERSION_JAVA_TARGETS)
  49 
  50 ##########################################################################################
  51 # Version file for jconsole
  52 
  53 $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \
  54     $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
  55         $(MKDIR) -p $(@D)
  56         $(RM) $@ $@.tmp
  57         $(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
  58         $(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
  59         $(MV) $@.tmp $@
  60 
  61 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
  62 
  63 ##########################################################################################
  64 
  65 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
  66 
  67 GENSRC_SOR_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/ch
  68 GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
  69 GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/btnative/genSocketOptionRegistry
  70 
  71 SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
  72     $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
  73 
  74 $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
  75     SRC := $(GENSRC_SOR_SRC), \
  76     INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
  77     LANG := C, \
  78     CC := $(BUILD_CC), \
  79     LDEXE := $(BUILD_CC), \
  80     OBJECT_DIR := $(GENSRC_SOR_BIN), \
  81     OUTPUT_DIR := $(GENSRC_SOR_BIN), \
  82     PROGRAM := genSocketOptionRegistry))
  83 
  84 SOR_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
  85 
  86 ifeq ($(wildcard $(SOR_PREGEN_FILE)), )
  87   $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
  88         $(MKDIR) -p $(@D)
  89         $(RM) $@ $@.tmp
  90         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
  91         $(BUILD_GENSRC_SOR_EXE) >> $@.tmp
  92         $(MV) $@.tmp $@
  93 else
  94   $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(SOR_PREGEN_FILE)
  95         $(call install-file)
  96 endif
  97 
  98 ##########################################################################################
  99 
 100 ifneq ($(OPENJDK_TARGET_OS), windows)
 101 
 102   GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
 103 
 104   GENSRC_UC_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
 105   GENSRC_UC_SRC_FILE := genUnixConstants.c
 106   GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/btnative/genUnixConstants
 107 
 108   UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
 109       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 110 
 111   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
 112       SRC := $(GENSRC_UC_SRC), \
 113       INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
 114       LANG := C, \
 115       CC := $(BUILD_CC), \
 116       LDEXE := $(BUILD_CC), \
 117       CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
 118       OBJECT_DIR := $(GENSRC_UC_BIN), \
 119       OUTPUT_DIR := $(GENSRC_UC_BIN), \
 120       PROGRAM := genUnixConstants))
 121 
 122   UC_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
 123 
 124   ifeq ($(wildcard $(UC_PREGEN_FILE)), )
 125     $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
 126         $(MKDIR) -p $(@D)
 127         $(RM) $@ $@.tmp
 128         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
 129         $(BUILD_GENSRC_UC_EXE) >> $@.tmp
 130         $(MV) $@.tmp $@
 131   else
 132     $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(UC_PREGEN_FILE)
 133         $(call install-file)
 134   endif
 135 
 136 endif
 137 
 138 ##########################################################################################
 139 
 140 ifeq ($(OPENJDK_TARGET_OS), solaris)
 141 
 142   GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
 143 
 144   GENSRC_SOL_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
 145   GENSRC_SOL_SRC_FILE := genSolarisConstants.c
 146   GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/btnative/genSolarisConstants
 147 
 148   SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
 149       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 150 
 151   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
 152       SRC := $(GENSRC_SOL_SRC), \
 153       INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
 154       LANG := C, \
 155       CC := $(BUILD_CC), \
 156       LDEXE := $(BUILD_CC), \
 157       OBJECT_DIR := $(GENSRC_SOL_BIN), \
 158       OUTPUT_DIR := $(GENSRC_SOL_BIN), \
 159       PROGRAM := genSolarisConstants))
 160 
 161   $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
 162         $(MKDIR) -p $(@D)
 163         $(RM) $@ $@.tmp
 164         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
 165         $(BUILD_GENSRC_SOL_EXE) >> $@.tmp
 166         $(MV) $@.tmp $@
 167 
 168 
 169 endif
 170 
 171 ##########################################################################################
 172 
 173   ifeq ($(OPENJDK_TARGET_OS), windows)
 174 
 175     AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
 176   AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
 177 
 178     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 179       $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
 180           $(AB_SRC_DIR)/32bit/AccessBridgeLoader.java
 181                 $(install-file)
 182 
 183       $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
 184           $(AB_SRC_DIR)/AccessBridge.java
 185                 $(install-file)
 186 
 187       $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java: \
 188           $(AB_SRC_DIR)/legacy/AccessBridgeLoader.java
 189                 $(install-file)
 190 
 191       $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
 192           $(AB_SRC_DIR)/AccessBridge.java
 193                 $(install-file)
 194 
 195       GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java \
 196           $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java \
 197           $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
 198           $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
 199 
 200     else
 201       $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
 202           $(AB_SRC_DIR)/64bit/AccessBridgeLoader.java
 203                 $(install-file)
 204 
 205       $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
 206           $(AB_SRC_DIR)/AccessBridge.java
 207                 $(install-file)
 208 
 209       GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java \
 210           $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
 211 
 212     endif
 213   endif
 214 
 215 ##########################################################################################
--- EOF ---