blob: 812b2cee6c71b69fa6b9d37beb0ab4bd8f57dd61 [file] [log] [blame]
Fredrik Ohstrome32ab982012-04-10 08:22:03 -07001#
2# Copyright (c) 2011, 2012, 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
Alan Bateman50ccbb62013-01-21 23:21:15 -050026include ProfileNames.gmk
27
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070028##########################################################################################
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
Alan Bateman50ccbb62013-01-21 23:21:15 -050033$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
34$(PROFILE_VERSION_JAVA_TARGETS): \
35 $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070036 $(MKDIR) -p $(@D)
Kelly O'Hairc363db82012-09-18 11:29:24 -070037 $(RM) $@ $@.tmp
Alan Bateman50ccbb62013-01-21 23:21:15 -050038 $(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@)
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070039 $(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' \
Alan Bateman50ccbb62013-01-21 23:21:15 -050043 -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
Kelly O'Hairc363db82012-09-18 11:29:24 -070044 $< > $@.tmp
45 $(MV) $@.tmp $@
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070046
Alan Bateman50ccbb62013-01-21 23:21:15 -050047GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
48 $(PROFILE_VERSION_JAVA_TARGETS)
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070049
50##########################################################################################
51# Version file for jconsole
52
Kelly O'Hair38c629a2012-10-26 14:23:29 -070053$(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070054 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
55 $(MKDIR) -p $(@D)
Kelly O'Hairc363db82012-09-18 11:29:24 -070056 $(RM) $@ $@.tmp
Kelly O'Hair38c629a2012-10-26 14:23:29 -070057 $(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
Kelly O'Hairc363db82012-09-18 11:29:24 -070058 $(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
59 $(MV) $@.tmp $@
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070060
Kelly O'Hair38c629a2012-10-26 14:23:29 -070061GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070062
63##########################################################################################
64
Erik Joelsson4e7263a2012-07-03 16:10:44 -070065ifeq ($(OPENJDK_TARGET_OS_API),posix)
66 UPSUFFIX:=$(OPENJDK_TARGET_OS)
67 ifeq ($(OPENJDK_TARGET_OS),macosx)
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070068 UPSUFFIX:=bsd
69 endif
70 # UNIXProcess.java is different for solaris and linux. We need to copy
71 # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/.
72
Kelly O'Hair38c629a2012-10-26 14:23:29 -070073 $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java : \
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070074 $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
Kelly O'Hair38c629a2012-10-26 14:23:29 -070075 $(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
Erik Joelsson989cb5b2013-04-05 09:39:10 +020076 $(call install-file)
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070077 $(CHMOD) u+rw $@
78
Kelly O'Hair38c629a2012-10-26 14:23:29 -070079 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java
Fredrik Ohstrome32ab982012-04-10 08:22:03 -070080endif
81
82##########################################################################################
Erik Joelssonf558e392012-06-07 20:40:50 -070083
Kelly O'Hair38c629a2012-10-26 14:23:29 -070084GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
Erik Joelssonf558e392012-06-07 20:40:50 -070085
86GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
87GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
Kelly O'Hair38c629a2012-10-26 14:23:29 -070088GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry
Erik Joelssonf558e392012-06-07 20:40:50 -070089
90SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
91 $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
92
Erik Joelssonf558e392012-06-07 20:40:50 -070093$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
94 SRC:=$(GENSRC_SOR_SRC),\
95 INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
96 LANG:=C,\
Kelly O'Hairc363db82012-09-18 11:29:24 -070097 CC:=$(BUILD_CC),\
98 LDEXE:=$(BUILD_LD),\
Erik Joelsson4e7263a2012-07-03 16:10:44 -070099 OBJECT_DIR:=$(GENSRC_SOR_BIN),\
100 OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
101 PROGRAM:=genSocketOptionRegistry))
102
Kelly O'Hairc363db82012-09-18 11:29:24 -0700103ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
104 HAS_SOCKET_OPTION_REGISTRY:=true
105endif
106
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700107ifneq ($(HAS_SOCKET_OPTION_REGISTRY),true)
108$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700109 $(MKDIR) -p $(@D)
Kelly O'Hairc363db82012-09-18 11:29:24 -0700110 $(RM) $@ $@.tmp
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700111 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
112 $(BUILD_GENSRC_SOR_EXE) >> $@.tmp
113 $(MV) $@.tmp $@
114else
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700115$(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
Erik Joelsson989cb5b2013-04-05 09:39:10 +0200116 $(call install-file)
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700117endif
Erik Joelssonf558e392012-06-07 20:40:50 -0700118
119##########################################################################################
120
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700121ifneq ($(OPENJDK_TARGET_OS),windows)
Erik Joelssonf558e392012-06-07 20:40:50 -0700122
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700123GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
Erik Joelssonf558e392012-06-07 20:40:50 -0700124
Kelly O'Hairc363db82012-09-18 11:29:24 -0700125GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
Erik Joelssonf558e392012-06-07 20:40:50 -0700126GENSRC_UC_SRC_FILE := genUnixConstants.c
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700127GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants
Erik Joelssonf558e392012-06-07 20:40:50 -0700128
129UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
130 $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
131
Erik Joelssonf558e392012-06-07 20:40:50 -0700132$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
133 SRC:=$(GENSRC_UC_SRC),\
134 INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
135 LANG:=C,\
Kelly O'Hairc363db82012-09-18 11:29:24 -0700136 CC:=$(BUILD_CC),\
137 LDEXE:=$(BUILD_CC),\
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700138 CFLAGS:=$(filter -D%,$(CFLAGS_JDKEXE)),\
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700139 OBJECT_DIR:=$(GENSRC_UC_BIN),\
140 OUTPUT_DIR:=$(GENSRC_UC_BIN),\
141 PROGRAM:=genUnixConstants))
142
Kelly O'Hairc363db82012-09-18 11:29:24 -0700143ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
144 HAS_UNIX_CONSTANTS:=true
145endif
146
147ifneq ($(HAS_UNIX_CONSTANTS),true)
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700148$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700149 $(MKDIR) -p $(@D)
Kelly O'Hairc363db82012-09-18 11:29:24 -0700150 $(RM) $@ $@.tmp
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700151 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
152 $(BUILD_GENSRC_UC_EXE) >> $@.tmp
153 $(MV) $@.tmp $@
154else
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700155$(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
Erik Joelsson989cb5b2013-04-05 09:39:10 +0200156 $(call install-file)
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700157endif
Erik Joelssonf558e392012-06-07 20:40:50 -0700158
159endif
160
161##########################################################################################
162
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700163ifeq ($(OPENJDK_TARGET_OS),solaris)
Erik Joelssonf558e392012-06-07 20:40:50 -0700164
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700165GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
Erik Joelssonf558e392012-06-07 20:40:50 -0700166
Kelly O'Hairc363db82012-09-18 11:29:24 -0700167GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
Erik Joelssonf558e392012-06-07 20:40:50 -0700168GENSRC_SOL_SRC_FILE := genSolarisConstants.c
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700169GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants
Erik Joelssonf558e392012-06-07 20:40:50 -0700170
171SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
172 $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
173
Erik Joelssonf558e392012-06-07 20:40:50 -0700174$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
175 SRC:=$(GENSRC_SOL_SRC),\
176 INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
177 LANG:=C,\
Kelly O'Hairc363db82012-09-18 11:29:24 -0700178 CC:=$(BUILD_CC),\
179 LDEXE:=$(BUILD_CC),\
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700180 OBJECT_DIR:=$(GENSRC_SOL_BIN),\
181 OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
182 PROGRAM:=genSolarisConstants))
183
Kelly O'Hair38c629a2012-10-26 14:23:29 -0700184$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700185 $(MKDIR) -p $(@D)
Kelly O'Hairc363db82012-09-18 11:29:24 -0700186 $(RM) $@ $@.tmp
Erik Joelsson4e7263a2012-07-03 16:10:44 -0700187 NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
188 $(BUILD_GENSRC_SOL_EXE) >> $@.tmp
189 $(MV) $@.tmp $@
190
Erik Joelssonf558e392012-06-07 20:40:50 -0700191
192endif
Ragini Prasad435bcab2013-01-18 11:33:31 -0800193
194##########################################################################################
195
196ifndef OPENJDK
197ifeq ($(OPENJDK_TARGET_OS), windows)
198
199 AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
200 AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
201
202 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
203 $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
204 $(AB_SRC_DIR)/32bit/AccessBridge.java
205 $(install-file)
206
207 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
208 $(AB_SRC_DIR)/legacy/AccessBridge.java
209 $(install-file)
210
211 GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
212 $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
213
214 else
215 $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
216 $(AB_SRC_DIR)/64bit/AccessBridge.java
217 $(install-file)
218
219 GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
220
221 endif
222endif
223endif
224
225##########################################################################################