Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 1 | # |
Christoph Langer | 337aabc | 2020-09-22 10:20:06 +0200 | [diff] [blame] | 2 | # Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 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 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 26 | ################################################################################ |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 27 | # Install the launcher name, release version string, full version |
Chris Hegarty | d6208a2 | 2016-03-03 12:07:13 +0000 | [diff] [blame] | 28 | # string and the runtime name into the VersionProps.java file. |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 29 | |
Christoph Langer | 337aabc | 2020-09-22 10:20:06 +0200 | [diff] [blame] | 30 | ifeq ($(COMPANY_NAME), N/A) |
| 31 | VENDOR=Oracle Corporation |
| 32 | else |
| 33 | VENDOR=$(COMPANY_NAME) |
| 34 | endif |
| 35 | |
Magnus Ihse Bursie | e9cf247 | 2015-06-11 00:23:01 +0200 | [diff] [blame] | 36 | $(eval $(call SetupTextFileProcessing, BUILD_VERSION_JAVA, \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 37 | SOURCE_FILES := $(TOPDIR)/src/java.base/share/classes/java/lang/VersionProps.java.template, \ |
Chris Hegarty | d6208a2 | 2016-03-03 12:07:13 +0000 | [diff] [blame] | 38 | OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/VersionProps.java, \ |
Magnus Ihse Bursie | e9cf247 | 2015-06-11 00:23:01 +0200 | [diff] [blame] | 39 | REPLACEMENTS := \ |
| 40 | @@LAUNCHER_NAME@@ => $(LAUNCHER_NAME) ; \ |
| 41 | @@RUNTIME_NAME@@ => $(RUNTIME_NAME) ; \ |
| 42 | @@VERSION_SHORT@@ => $(VERSION_SHORT) ; \ |
Claes Redestad | a2ed889 | 2016-06-28 00:39:26 +0200 | [diff] [blame] | 43 | @@VERSION_STRING@@ => $(VERSION_STRING) ; \ |
| 44 | @@VERSION_NUMBER@@ => $(VERSION_NUMBER) ; \ |
| 45 | @@VERSION_PRE@@ => $(VERSION_PRE) ; \ |
| 46 | @@VERSION_BUILD@@ => $(VERSION_BUILD) ; \ |
Mark Reinhold | 0214135 | 2017-12-13 17:28:24 -0800 | [diff] [blame] | 47 | @@VERSION_OPT@@ => $(VERSION_OPT) ; \ |
| 48 | @@VERSION_DATE@@ => $(VERSION_DATE) ; \ |
Christoph Langer | cd0ddcf | 2018-11-28 15:53:49 -0500 | [diff] [blame] | 49 | @@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING) ; \ |
Christoph Langer | 337aabc | 2020-09-22 10:20:06 +0200 | [diff] [blame] | 50 | @@VENDOR@@ => $(VENDOR) ; \ |
Christoph Langer | cd0ddcf | 2018-11-28 15:53:49 -0500 | [diff] [blame] | 51 | @@VENDOR_URL@@ => $(VENDOR_URL) ; \ |
Mark Reinhold | 391df2e | 2019-10-29 08:26:55 -0700 | [diff] [blame] | 52 | @@VENDOR_URL_BUG@@ => $(VENDOR_URL_BUG) ; \ |
| 53 | @@VENDOR_URL_VM_BUG@@ => $(VENDOR_URL_VM_BUG), \ |
Magnus Ihse Bursie | e9cf247 | 2015-06-11 00:23:01 +0200 | [diff] [blame] | 54 | )) |
Erik Joelsson | 5a030d7 | 2015-01-26 10:29:11 +0100 | [diff] [blame] | 55 | |
Magnus Ihse Bursie | e9cf247 | 2015-06-11 00:23:01 +0200 | [diff] [blame] | 56 | GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA) |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 57 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 58 | ################################################################################ |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 59 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 60 | ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), ) |
| 61 | # Need to specify language since the template file has a non standard |
| 62 | # extension. |
| 63 | CPP_FLAGS += -x c |
| 64 | else ifeq ($(TOOLCHAIN_TYPE), microsoft) |
| 65 | CPP_FLAGS += -nologo |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 66 | endif |
| 67 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 68 | # Generate a java source file from a template through the C preprocessor for the |
| 69 | # target system. First extract the copyright notice at the start of the file. |
| 70 | # Run the preprocessor. Filter out the default compiler stderr output on |
| 71 | # Windows. Filter out all the header files output. Remove all "PREFIX_" strings |
| 72 | # that were added to variable references in the template files to avoid being |
| 73 | # matched by the preprocessor. Remove any #line directives left by the |
| 74 | # preprocessor. |
| 75 | define generate-preproc-src |
| 76 | $(call MakeDir, $(@D)) |
| 77 | ( $(NAWK) '/@@END_COPYRIGHT@@/{exit}1' $< && \ |
Lucy Lu | ec1c3bc | 2017-10-17 16:51:11 -0700 | [diff] [blame] | 78 | $(CPP) $(CPP_FLAGS) $(SYSROOT_CFLAGS) $(CFLAGS_JDKLIB) $< \ |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 79 | 2> >($(GREP) -v '^$(<F)$$' >&2) \ |
| 80 | | $(NAWK) '/@@START_HERE@@/,0' \ |
| 81 | | $(SED) -e 's/@@START_HERE@@/\/\/ AUTOMATICALLY GENERATED FILE - DO NOT EDIT/' \ |
| 82 | -e 's/PREFIX_//' -e 's/^#.*//' \ |
| 83 | ) > $@ |
| 84 | endef |
| 85 | |
| 86 | GENSRC_SOR_FILE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/ch/SocketOptionRegistry.java |
| 87 | |
| 88 | $(GENSRC_SOR_FILE): \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 89 | $(TOPDIR)/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 90 | $(generate-preproc-src) |
| 91 | |
| 92 | GENSRC_JAVA_BASE += $(GENSRC_SOR_FILE) |
| 93 | |
| 94 | ################################################################################ |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 95 | |
| 96 | ifneq ($(OPENJDK_TARGET_OS), windows) |
| 97 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 98 | GENSRC_UC_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/UnixConstants.java |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 99 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 100 | $(GENSRC_UC_FILE): \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 101 | $(TOPDIR)/src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 102 | $(generate-preproc-src) |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 103 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 104 | GENSRC_JAVA_BASE += $(GENSRC_UC_FILE) |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 105 | |
| 106 | endif |
| 107 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 108 | ################################################################################ |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 109 | |
| 110 | ifeq ($(OPENJDK_TARGET_OS), solaris) |
| 111 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 112 | GENSRC_SC_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/fs/SolarisConstants.java |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 113 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 114 | $(GENSRC_SC_FILE): \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 115 | $(TOPDIR)/src/java.base/solaris/classes/sun/nio/fs/SolarisConstants.java.template |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 116 | $(generate-preproc-src) |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 117 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 118 | GENSRC_JAVA_BASE += $(GENSRC_SC_FILE) |
Magnus Ihse Bursie | 453a40a | 2013-11-14 11:19:32 +0100 | [diff] [blame] | 119 | |
| 120 | endif |
| 121 | |
Erik Joelsson | 26cd467 | 2016-03-24 14:23:37 +0100 | [diff] [blame] | 122 | ################################################################################ |
Bradford Wetmore | fdb9c95 | 2016-12-05 17:04:02 -0800 | [diff] [blame] | 123 | # Create the javax/crypto/JceSecurity.class, using the build default. |
| 124 | # |
| 125 | ifeq ($(UNLIMITED_CRYPTO), true) |
| 126 | JCE_DEFAULT_POLICY = unlimited |
| 127 | else |
| 128 | JCE_DEFAULT_POLICY = limited |
| 129 | endif |
| 130 | |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 131 | ifneq ($(wildcard $(TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template), ) |
Magnus Ihse Bursie | 0d93c1d | 2017-02-17 14:55:35 +0100 | [diff] [blame] | 132 | $(eval $(call SetupTextFileProcessing, BUILD_JCESECURITY_JAVA, \ |
Erik Joelsson | 72c4ec5 | 2017-09-12 19:03:56 +0200 | [diff] [blame] | 133 | SOURCE_FILES := $(TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template, \ |
Magnus Ihse Bursie | 0d93c1d | 2017-02-17 14:55:35 +0100 | [diff] [blame] | 134 | OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/javax/crypto/JceSecurity.java, \ |
| 135 | REPLACEMENTS := \ |
Bradford Wetmore | fdb9c95 | 2016-12-05 17:04:02 -0800 | [diff] [blame] | 136 | @@JCE_DEFAULT_POLICY@@ => $(JCE_DEFAULT_POLICY), \ |
Magnus Ihse Bursie | 0d93c1d | 2017-02-17 14:55:35 +0100 | [diff] [blame] | 137 | )) |
Bradford Wetmore | fdb9c95 | 2016-12-05 17:04:02 -0800 | [diff] [blame] | 138 | |
Magnus Ihse Bursie | 0d93c1d | 2017-02-17 14:55:35 +0100 | [diff] [blame] | 139 | GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA) |
| 140 | endif |