1 #
   2 # Copyright (c) 2011, 2014, 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 # Install the launcher name, release version string, full version
  28 # string and the runtime name into the Version.java file.
  29 # To be printed by java -version
  30 
  31 # These dependencies should ideally be added to prerequesites for Version.java
  32 # but skip for now until we have better incremental build for java.
  33 #    $(call DependOnVariable, LAUNCHER_NAME) \
  34 #    $(call DependOnVariable, RELEASE) \
  35 #    $(call DependOnVariable, FULL_VERSION) \
  36 #    $(call DependOnVariable, RUNTIME_VERSION)



  37 
  38 $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java: \
  39     $(JDK_TOPDIR)/src/java.base/share/classes/sun/misc/Version.java.template
  40         $(MKDIR) -p $(@D)
  41         $(RM) $@ $@.tmp
  42         $(ECHO) Generating sun/misc/Version.java
  43         $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
  44             -e 's/@@java_version@@/$(RELEASE)/g' \
  45             -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
  46             -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
  47             $< > $@.tmp
  48         $(MV) $@.tmp $@
  49 
  50 GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/misc/Version.java
  51 
  52 ##########################################################################################
  53 
  54 GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java
  55 
  56 GENSRC_SOR_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/ch
  57 GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
  58 GENSRC_SOR_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genSocketOptionRegistry
  59 
  60 SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
  61     $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
  62 
  63 $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
  64     SRC := $(GENSRC_SOR_SRC), \
  65     INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
  66     TOOLCHAIN := TOOLCHAIN_BUILD, \
  67     OBJECT_DIR := $(GENSRC_SOR_BIN), \
  68     OUTPUT_DIR := $(GENSRC_SOR_BIN), \
  69     PROGRAM := genSocketOptionRegistry))
  70 
  71 SOR_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/java.base/$(OPENJDK_TARGET_OS)/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
  72 
  73 ifeq ($(wildcard $(SOR_PREGEN_FILE)), )
  74   $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
  75         $(MKDIR) -p $(@D)
  76         $(RM) $@ $@.tmp
  77         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
  78             $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
  79         $(BUILD_GENSRC_SOR_EXE) >> $@.tmp
  80         $(MV) $@.tmp $@
  81 else
  82   $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java: $(SOR_PREGEN_FILE)
  83         $(call install-file)
  84 endif
  85 
  86 ##########################################################################################
  87 
  88 ifneq ($(OPENJDK_TARGET_OS), windows)
  89 
  90   GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java
  91 
  92   GENSRC_UC_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
  93   GENSRC_UC_SRC_FILE := genUnixConstants.c
  94   GENSRC_UC_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genUnixConstants
  95 
  96   UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
  97       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
  98 
  99   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
 100       SRC := $(GENSRC_UC_SRC), \
 101       INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
 102       TOOLCHAIN := TOOLCHAIN_BUILD, \
 103       CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
 104       OBJECT_DIR := $(GENSRC_UC_BIN), \
 105       OUTPUT_DIR := $(GENSRC_UC_BIN), \
 106       PROGRAM := genUnixConstants))
 107 
 108   UC_PREGEN_FILE := $(JDK_TOPDIR)/src/closed/java.base/$(OPENJDK_TARGET_OS)/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
 109 
 110   ifeq ($(wildcard $(UC_PREGEN_FILE)), )
 111     $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
 112         $(MKDIR) -p $(@D)
 113         $(RM) $@ $@.tmp
 114         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
 115             $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
 116         $(BUILD_GENSRC_UC_EXE) >> $@.tmp
 117         $(MV) $@.tmp $@
 118   else
 119     $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java: $(UC_PREGEN_FILE)
 120         $(call install-file)
 121   endif
 122 
 123 endif
 124 
 125 ##########################################################################################
 126 
 127 ifeq ($(OPENJDK_TARGET_OS), solaris)
 128 
 129   GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java
 130 
 131   GENSRC_SOL_SRC := $(JDK_TOPDIR)/make/src/native/genconstants/fs
 132   GENSRC_SOL_SRC_FILE := genSolarisConstants.c
 133   GENSRC_SOL_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genSolarisConstants
 134 
 135   SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
 136       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 137 
 138   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
 139       SRC := $(GENSRC_SOL_SRC), \
 140       INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
 141       TOOLCHAIN := TOOLCHAIN_BUILD, \
 142       OBJECT_DIR := $(GENSRC_SOL_BIN), \
 143       OUTPUT_DIR := $(GENSRC_SOL_BIN), \
 144       PROGRAM := genSolarisConstants))
 145 
 146   $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
 147         $(MKDIR) -p $(@D)
 148         $(RM) $@ $@.tmp
 149         NAWK="$(NAWK)" SH="$(SH)" $(SH) -e \
 150             $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
 151         $(BUILD_GENSRC_SOL_EXE) >> $@.tmp
 152         $(MV) $@.tmp $@
 153 
 154 
 155 endif
 156 
 157 ##########################################################################################
--- EOF ---