blob: de686d44b59e8df454abc9a16df1d13952981c55 [file] [log] [blame]
ihse554e46f2013-11-14 11:19:32 +01001#
ptbrunetdc4e52b2015-03-31 18:39:00 +04002# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
ihse554e46f2013-11-14 11:19:32 +01003# 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
26include 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
47GENSRC_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
61GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
62
63##########################################################################################
64
ihse554e46f2013-11-14 11:19:32 +010065GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
66
67GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
68GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
69GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry
70
71SOR_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_LD), \
80 OBJECT_DIR := $(GENSRC_SOR_BIN), \
81 OUTPUT_DIR := $(GENSRC_SOR_BIN), \
82 PROGRAM := genSocketOptionRegistry))
83
84ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), )
85 HAS_SOCKET_OPTION_REGISTRY := true
86endif
87
88ifneq ($(HAS_SOCKET_OPTION_REGISTRY), true)
89 $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
90 $(MKDIR) -p $(@D)
91 $(RM) $@ $@.tmp
92 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
93 $(BUILD_GENSRC_SOR_EXE) >> $@.tmp
94 $(MV) $@.tmp $@
95else
96 $(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
97 $(call install-file)
98endif
99
100##########################################################################################
101
102ifneq ($(OPENJDK_TARGET_OS), windows)
103
104 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
105
106 GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
107 GENSRC_UC_SRC_FILE := genUnixConstants.c
108 GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants
109
110 UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
111 $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
112
113 $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
114 SRC := $(GENSRC_UC_SRC), \
115 INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
116 LANG := C, \
117 CC := $(BUILD_CC), \
118 LDEXE := $(BUILD_CC), \
119 CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
120 OBJECT_DIR := $(GENSRC_UC_BIN), \
121 OUTPUT_DIR := $(GENSRC_UC_BIN), \
122 PROGRAM := genUnixConstants))
123
124 ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), )
125 HAS_UNIX_CONSTANTS := true
126 endif
127
128 ifneq ($(HAS_UNIX_CONSTANTS), true)
129 $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
130 $(MKDIR) -p $(@D)
131 $(RM) $@ $@.tmp
132 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
133 $(BUILD_GENSRC_UC_EXE) >> $@.tmp
134 $(MV) $@.tmp $@
135 else
136 $(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
137 $(call install-file)
138 endif
139
140endif
141
142##########################################################################################
143
144ifeq ($(OPENJDK_TARGET_OS), solaris)
145
146 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
147
148 GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
149 GENSRC_SOL_SRC_FILE := genSolarisConstants.c
150 GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants
151
152 SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
153 $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
154
155 $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
156 SRC := $(GENSRC_SOL_SRC), \
157 INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
158 LANG := C, \
159 CC := $(BUILD_CC), \
160 LDEXE := $(BUILD_CC), \
161 OBJECT_DIR := $(GENSRC_SOL_BIN), \
162 OUTPUT_DIR := $(GENSRC_SOL_BIN), \
163 PROGRAM := genSolarisConstants))
164
165 $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
166 $(MKDIR) -p $(@D)
167 $(RM) $@ $@.tmp
168 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
169 $(BUILD_GENSRC_SOL_EXE) >> $@.tmp
170 $(MV) $@.tmp $@
171
172
173endif
174
175##########################################################################################
176
ihse554e46f2013-11-14 11:19:32 +0100177 ifeq ($(OPENJDK_TARGET_OS), windows)
178
179 AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
ptbrunetdc4e52b2015-03-31 18:39:00 +0400180 AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
ihse554e46f2013-11-14 11:19:32 +0100181
182 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
183 $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
184 $(AB_SRC_DIR)/32bit/AccessBridgeLoader.java
185 $(install-file)
186
187 $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
188 $(AB_SRC_DIR)/AccessBridge.java
189 $(install-file)
190
191 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java: \
192 $(AB_SRC_DIR)/legacy/AccessBridgeLoader.java
193 $(install-file)
194
195 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
196 $(AB_SRC_DIR)/AccessBridge.java
197 $(install-file)
198
199 GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java \
200 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java \
201 $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
202 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
203
204 else
205 $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
206 $(AB_SRC_DIR)/64bit/AccessBridgeLoader.java
207 $(install-file)
208
209 $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
210 $(AB_SRC_DIR)/AccessBridge.java
211 $(install-file)
212
213 GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java \
214 $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
215
216 endif
217 endif
ihse554e46f2013-11-14 11:19:32 +0100218
219##########################################################################################