GensrcMisc.gmk 9.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

26 27
include ProfileNames.gmk

28 29 30 31 32
##########################################################################################
# Install the launcher name, release version string, full version
# string and the runtime name into the Version.java file.
# To be printed by java -version

33 34 35
$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
$(PROFILE_VERSION_JAVA_TARGETS): \
		$(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 40 41 42
	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
	       -e 's/@@java_version@@/$(RELEASE)/g' \
	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
	       -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
43
	       -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
44 45
            $< > $@.tmp
	$(MV) $@.tmp $@
46

47 48
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
    $(PROFILE_VERSION_JAVA_TARGETS)
49 50 51 52

##########################################################################################
# Version file for jconsole

O
ohair 已提交
53
$(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \
54 55
                $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
	$(MKDIR) -p $(@D)
56
	$(RM) $@ $@.tmp
O
ohair 已提交
57
	$(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
58 59
	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
	$(MV) $@.tmp $@
60

O
ohair 已提交
61
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
62 63 64

##########################################################################################

65 66 67
ifeq ($(OPENJDK_TARGET_OS_API),posix)
    UPSUFFIX:=$(OPENJDK_TARGET_OS)
    ifeq ($(OPENJDK_TARGET_OS),macosx)
68 69 70 71 72
        UPSUFFIX:=bsd
    endif
    # UNIXProcess.java is different for solaris and linux. We need to copy
    # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/.

O
ohair 已提交
73
    $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java : \
74
              $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
O
ohair 已提交
75
	$(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
76
	$(call install-file)
77 78
	$(CHMOD) u+rw $@

O
ohair 已提交
79
    GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java
80 81 82
endif

##########################################################################################
83

O
ohair 已提交
84
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
85 86 87

GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
O
ohair 已提交
88
GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry
89 90 91 92 93 94 95 96

SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
		SRC:=$(GENSRC_SOR_SRC),\
		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
		LANG:=C,\
97 98
		CC:=$(BUILD_CC),\
		LDEXE:=$(BUILD_LD),\
99 100 101 102
		OBJECT_DIR:=$(GENSRC_SOR_BIN),\
		OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
                PROGRAM:=genSocketOptionRegistry))

103 104 105 106
ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
  HAS_SOCKET_OPTION_REGISTRY:=true
endif

O
ohair 已提交
107 108
ifneq ($(HAS_SOCKET_OPTION_REGISTRY),true)
$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
109
	$(MKDIR) -p $(@D)
110
	$(RM) $@ $@.tmp
111 112 113 114
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
	$(MV) $@.tmp $@
else
O
ohair 已提交
115
$(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
116
	$(call install-file)
117
endif
118 119 120

##########################################################################################

121
ifneq ($(OPENJDK_TARGET_OS),windows)
122

O
ohair 已提交
123
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
124

125
GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
126
GENSRC_UC_SRC_FILE := genUnixConstants.c
O
ohair 已提交
127
GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants
128 129 130 131 132 133 134 135

UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
		SRC:=$(GENSRC_UC_SRC),\
		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
		LANG:=C,\
136 137
		CC:=$(BUILD_CC),\
		LDEXE:=$(BUILD_CC),\
O
ohair 已提交
138
		CFLAGS:=$(filter -D%,$(CFLAGS_JDKEXE)),\
139 140 141 142
		OBJECT_DIR:=$(GENSRC_UC_BIN),\
                OUTPUT_DIR:=$(GENSRC_UC_BIN),\
		PROGRAM:=genUnixConstants))

143 144 145 146 147
ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
  HAS_UNIX_CONSTANTS:=true
endif

ifneq ($(HAS_UNIX_CONSTANTS),true)
O
ohair 已提交
148
$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
149
	$(MKDIR) -p $(@D)
150
	$(RM) $@ $@.tmp
151 152 153 154
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
	$(MV) $@.tmp $@
else
O
ohair 已提交
155
$(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
156
	$(call install-file)
157
endif
158 159 160 161 162

endif

##########################################################################################

163
ifeq ($(OPENJDK_TARGET_OS),solaris)
164

O
ohair 已提交
165
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
166

167
GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
168
GENSRC_SOL_SRC_FILE := genSolarisConstants.c
O
ohair 已提交
169
GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants
170 171 172 173 174 175 176 177

SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
		SRC:=$(GENSRC_SOL_SRC),\
		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
		LANG:=C,\
178 179
		CC:=$(BUILD_CC),\
		LDEXE:=$(BUILD_CC),\
180 181 182 183
		OBJECT_DIR:=$(GENSRC_SOL_BIN),\
		OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
		PROGRAM:=genSolarisConstants))

O
ohair 已提交
184
$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
185
	$(MKDIR) -p $(@D)
186
	$(RM) $@ $@.tmp
187 188 189 190
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
	$(MV) $@.tmp $@

191 192

endif
193 194 195 196 197 198 199 200 201 202

##########################################################################################

ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)

    AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
    AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility

    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
203 204 205 206
         $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
			$(AB_SRC_DIR)/32bit/AccessBridgeLoader.java
		$(install-file)

207
         $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
208 209 210 211 212
			$(AB_SRC_DIR)/AccessBridge.java
		$(install-file)

         $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java: \
			$(AB_SRC_DIR)/legacy/AccessBridgeLoader.java
213 214 215
		$(install-file)

         $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
216
			$(AB_SRC_DIR)/AccessBridge.java
217 218
		$(install-file)

219 220 221 222
        GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java \
		       $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java \
			   $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
			   $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
223 224

    else
225 226
         $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
			$(AB_SRC_DIR)/64bit/AccessBridgeLoader.java
227 228
		$(install-file)

229 230
         GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java \
			$(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
231 232

    endif
233

234 235 236
endif
endif

237
##########################################################################################