GensrcMisc.gmk revision 8845:4be14673b9bf
1267982Sdim# 2267982Sdim# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 3267982Sdim# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4267982Sdim# 5267982Sdim# This code is free software; you can redistribute it and/or modify it 6267982Sdim# under the terms of the GNU General Public License version 2 only, as 7267982Sdim# published by the Free Software Foundation. Oracle designates this 8267982Sdim# particular file as subject to the "Classpath" exception as provided 9267982Sdim# by Oracle in the LICENSE file that accompanied this code. 10267982Sdim# 11267982Sdim# This code is distributed in the hope that it will be useful, but WITHOUT 12267982Sdim# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13267982Sdim# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14267982Sdim# version 2 for more details (a copy is included in the LICENSE file that 15267982Sdim# accompanied this code). 16267982Sdim# 17267982Sdim# You should have received a copy of the GNU General Public License version 18267982Sdim# 2 along with this work; if not, write to the Free Software Foundation, 19267982Sdim# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20267982Sdim# 21267982Sdim# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22267982Sdim# or visit www.oracle.com if you need additional information or have any 23267982Sdim# questions. 24267982Sdim# 25267982Sdim 26267982Sdiminclude ProfileNames.gmk 27267982Sdim 28267982Sdim########################################################################################## 29267982Sdim# Install the launcher name, release version string, full version 30267982Sdim# string and the runtime name into the Version.java file. 31267982Sdim# To be printed by java -version 32267982Sdim 33267982Sdim$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \ 34267982Sdim$(PROFILE_VERSION_JAVA_TARGETS): \ 35268065Sdim $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template 36267982Sdim $(MKDIR) -p $(@D) 37267982Sdim $(RM) $@ $@.tmp 38267982Sdim $(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@) 39267982Sdim $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \ 40267982Sdim -e 's/@@java_version@@/$(RELEASE)/g' \ 41267982Sdim -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ 42267982Sdim -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ 43267982Sdim -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ 44267982Sdim $< > $@.tmp 45267982Sdim $(MV) $@.tmp $@ 46267982Sdim 47267982SdimGENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \ 48267982Sdim $(PROFILE_VERSION_JAVA_TARGETS) 49267982Sdim 50267982Sdim########################################################################################## 51267982Sdim# Version file for jconsole 52267982Sdim 53267982Sdim$(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \ 54267982Sdim $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template 55267982Sdim $(MKDIR) -p $(@D) 56267982Sdim $(RM) $@ $@.tmp 57267982Sdim $(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java 58267982Sdim $(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp 59267982Sdim $(MV) $@.tmp $@ 60267982Sdim 61267982SdimGENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java 62267982Sdim 63267982Sdim########################################################################################## 64267982Sdim 65267982Sdimifeq ($(OPENJDK_TARGET_OS_API), posix) 66267982Sdim UPSUFFIX := $(OPENJDK_TARGET_OS) 67267982Sdim ifeq ($(OPENJDK_TARGET_OS), macosx) 68267982Sdim UPSUFFIX := bsd 69267982Sdim endif 70267982Sdim # UNIXProcess.java is different for solaris and linux. We need to copy 71267982Sdim # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/. 72267982Sdim 73267982Sdim $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java: \ 74267982Sdim $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX) 75267982Sdim $(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java 76267982Sdim $(call install-file) 77267982Sdim $(CHMOD) u+rw $@ 78267982Sdim 79267982Sdim GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java 80267982Sdimendif 81267982Sdim 82267982Sdim########################################################################################## 83267982Sdim 84267982SdimGENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java 85267982Sdim 86267982SdimGENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch 87267982SdimGENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c 88267982SdimGENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry 89267982Sdim 90267982SdimSOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \ 91267982Sdim $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 92267982Sdim 93267982Sdim$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \ 94267982Sdim SRC := $(GENSRC_SOR_SRC), \ 95267982Sdim INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \ 96267982Sdim LANG := C, \ 97267982Sdim CC := $(BUILD_CC), \ 98267982Sdim LDEXE := $(BUILD_LD), \ 99267982Sdim OBJECT_DIR := $(GENSRC_SOR_BIN), \ 100267982Sdim OUTPUT_DIR := $(GENSRC_SOR_BIN), \ 101267982Sdim PROGRAM := genSocketOptionRegistry)) 102267982Sdim 103267982Sdimifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), ) 104267982Sdim HAS_SOCKET_OPTION_REGISTRY := true 105267982Sdimendif 106267982Sdim 107267982Sdimifneq ($(HAS_SOCKET_OPTION_REGISTRY), true) 108267982Sdim $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE) 109267982Sdim $(MKDIR) -p $(@D) 110267982Sdim $(RM) $@ $@.tmp 111267982Sdim NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp 112267982Sdim $(BUILD_GENSRC_SOR_EXE) >> $@.tmp 113267982Sdim $(MV) $@.tmp $@ 114267982Sdimelse 115267982Sdim $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java 116267982Sdim $(call install-file) 117267982Sdimendif 118267982Sdim 119267982Sdim########################################################################################## 120267982Sdim 121267982Sdimifneq ($(OPENJDK_TARGET_OS), windows) 122267982Sdim 123267982Sdim GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java 124267982Sdim 125267982Sdim GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs 126267982Sdim GENSRC_UC_SRC_FILE := genUnixConstants.c 127267982Sdim GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants 128267982Sdim 129267982Sdim UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \ 130267982Sdim $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 131267982Sdim 132267982Sdim $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \ 133267982Sdim SRC := $(GENSRC_UC_SRC), \ 134267982Sdim INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \ 135267982Sdim LANG := C, \ 136267982Sdim CC := $(BUILD_CC), \ 137267982Sdim LDEXE := $(BUILD_CC), \ 138267982Sdim CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \ 139267982Sdim OBJECT_DIR := $(GENSRC_UC_BIN), \ 140267982Sdim OUTPUT_DIR := $(GENSRC_UC_BIN), \ 141267982Sdim PROGRAM := genUnixConstants)) 142267982Sdim 143267982Sdim ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), ) 144267982Sdim HAS_UNIX_CONSTANTS := true 145267982Sdim endif 146267982Sdim 147267982Sdim ifneq ($(HAS_UNIX_CONSTANTS), true) 148267982Sdim $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE) 149267982Sdim $(MKDIR) -p $(@D) 150267982Sdim $(RM) $@ $@.tmp 151267982Sdim NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp 152267982Sdim $(BUILD_GENSRC_UC_EXE) >> $@.tmp 153267982Sdim $(MV) $@.tmp $@ 154267982Sdim else 155267982Sdim $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java 156267982Sdim $(call install-file) 157267982Sdim endif 158267982Sdim 159267982Sdimendif 160267982Sdim 161267982Sdim########################################################################################## 162267982Sdim 163267982Sdimifeq ($(OPENJDK_TARGET_OS), solaris) 164267982Sdim 165267982Sdim GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java 166267982Sdim 167267982Sdim GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs 168267982Sdim GENSRC_SOL_SRC_FILE := genSolarisConstants.c 169267982Sdim GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants 170267982Sdim 171267982Sdim SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \ 172267982Sdim $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 173267982Sdim 174267982Sdim $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \ 175267982Sdim SRC := $(GENSRC_SOL_SRC), \ 176267982Sdim INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \ 177267982Sdim LANG := C, \ 178267982Sdim CC := $(BUILD_CC), \ 179267982Sdim LDEXE := $(BUILD_CC), \ 180267982Sdim OBJECT_DIR := $(GENSRC_SOL_BIN), \ 181267982Sdim OUTPUT_DIR := $(GENSRC_SOL_BIN), \ 182267982Sdim PROGRAM := genSolarisConstants)) 183267982Sdim 184267982Sdim $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE) 185267982Sdim $(MKDIR) -p $(@D) 186267982Sdim $(RM) $@ $@.tmp 187267982Sdim NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp 188267982Sdim $(BUILD_GENSRC_SOL_EXE) >> $@.tmp 189267982Sdim $(MV) $@.tmp $@ 190267982Sdim 191267982Sdim 192267982Sdimendif 193267982Sdim 194267982Sdim########################################################################################## 195267982Sdim 196267982Sdimifndef OPENJDK 197267982Sdim ifeq ($(OPENJDK_TARGET_OS), windows) 198267982Sdim 199267982Sdim AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab 200267982Sdim AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility 201267982Sdim 202267982Sdim ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) 203267982Sdim $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \ 204267982Sdim $(AB_SRC_DIR)/32bit/AccessBridgeLoader.java 205267982Sdim $(install-file) 206267982Sdim 207267982Sdim $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \ 208267982Sdim $(AB_SRC_DIR)/AccessBridge.java 209267982Sdim $(install-file) 210267982Sdim 211267982Sdim $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java: \ 212267982Sdim $(AB_SRC_DIR)/legacy/AccessBridgeLoader.java 213267982Sdim $(install-file) 214267982Sdim 215267982Sdim $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \ 216267982Sdim $(AB_SRC_DIR)/AccessBridge.java 217267982Sdim $(install-file) 218267982Sdim 219267982Sdim GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java \ 220267982Sdim $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java \ 221267982Sdim $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \ 222267982Sdim $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java 223267982Sdim 224267982Sdim else 225267982Sdim $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java: \ 226267982Sdim $(AB_SRC_DIR)/64bit/AccessBridgeLoader.java 227267982Sdim $(install-file) 228267982Sdim 229267982Sdim $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \ 230267982Sdim $(AB_SRC_DIR)/AccessBridge.java 231267982Sdim $(install-file) 232267982Sdim 233267982Sdim GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java \ 234267982Sdim $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java 235267982Sdim 236267982Sdim endif 237267982Sdim endif 238267982Sdimendif 239267982Sdim 240267982Sdim########################################################################################## 241267982Sdim