1 #
   2 # Copyright (c) 2013, 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 
  26 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include JavaCompilation.gmk
  31 
  32 # The jars created in this file are required for the exploded jdk image to function and
  33 # cannot wait to be built in the images target.
  34 
  35 SECURITY_CLASSES_SUBDIR := modules
  36 
  37 ##########################################################################################
  38 # Create manifest for security jars
  39 #
  40 # Include these extra attributes for now, should probably take out.
  41 #
  42 MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
  43 JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
  44 
  45 $(JCE_MANIFEST): $(MAINMANIFEST)
  46         $(MKDIR) -p $(@D)
  47         $(RM) $@ $@.tmp
  48         $(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
  49             -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
  50             $(MAINMANIFEST) >> $@.tmp
  51         $(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
  52         $(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
  53         $(MV) $@.tmp $@
  54 
  55 ##########################################################################################
  56 # For security and crypto jars, always build the jar, but for closed, install the prebuilt
  57 # signed version instead of the newly built jar. Unsigned jars are treated as intermediate
  58 # targets and explicitly added to the TARGETS list. For open, signing is not needed. See
  59 # SignJars.gmk for more information.
  60 #
  61 # The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
  62 # variable is set to no if these jars can't be built to skip that step of the build.
  63 # Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
  64 # other way to get the jars than to build them.
  65 
  66 SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
  67 SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
  68 
  69 $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
  70     SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/jdk.crypto.pkcs11, \
  71     SUFFIXES := .class, \
  72     INCLUDES := sun/security/pkcs11, \
  73     JAR := $(SUNPKCS11_JAR_UNSIGNED), \
  74     MANIFEST := $(JCE_MANIFEST), \
  75     SKIP_METAINF := true))
  76 
  77 $(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
  78 
  79 ifndef OPENJDK
  80   SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
  81   $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
  82         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
  83         $(install-file)
  84 else
  85   $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
  86         $(install-file)
  87 endif
  88 
  89 TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
  90 
  91 ##########################################################################################
  92 
  93 SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
  94 SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunec.jar
  95 
  96 $(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
  97     SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/jdk.crypto.ec, \
  98     SUFFIXES := .class, \
  99     INCLUDES := sun/security/ec, \
 100     JAR := $(SUNEC_JAR_UNSIGNED), \
 101     MANIFEST := $(JCE_MANIFEST), \
 102     SKIP_METAINF := true))
 103 
 104 $(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
 105 
 106 ifndef OPENJDK
 107   SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
 108   $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
 109         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 110         $(install-file)
 111 else
 112   $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
 113         $(install-file)
 114 endif
 115 
 116 TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
 117 
 118 ##########################################################################################
 119 
 120 SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
 121 SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
 122 
 123 ifneq ($(BUILD_CRYPTO), no)
 124   $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
 125       SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/java.base, \
 126       SUFFIXES := .class, \
 127       INCLUDES := com/sun/crypto/provider, \
 128       JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
 129       MANIFEST := $(JCE_MANIFEST), \
 130       SKIP_METAINF := true))
 131 
 132   $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
 133 
 134   TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
 135 endif
 136 
 137 ifndef OPENJDK
 138   SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
 139   $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
 140         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 141         $(install-file)
 142 else
 143   $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
 144         $(install-file)
 145 endif
 146 
 147 TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
 148 
 149 ##########################################################################################
 150 
 151 JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
 152 JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/jce.jar
 153 
 154 ifneq ($(BUILD_CRYPTO), no)
 155   $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
 156       SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/java.base, \
 157       SUFFIXES := .class, \
 158       INCLUDES := javax/crypto sun/security/internal, \
 159       JAR := $(JCE_JAR_UNSIGNED), \
 160       MANIFEST := $(JCE_MANIFEST), \
 161       SKIP_METAINF := true))
 162 
 163   $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
 164 
 165   TARGETS += $(JCE_JAR_UNSIGNED)
 166 endif
 167 
 168 ifndef OPENJDK
 169   JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
 170   $(JCE_JAR_DST): $(JCE_JAR_SRC)
 171         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 172         $(install-file)
 173 else
 174   $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
 175         $(install-file)
 176 endif
 177 
 178 TARGETS += $(JCE_JAR_DST)
 179 
 180 ##########################################################################################
 181 
 182 ifeq ($(OPENJDK_TARGET_OS), windows)
 183 
 184   SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
 185   SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunmscapi.jar
 186 
 187   $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
 188       SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/jdk.crypto.mscapi, \
 189       SUFFIXES := .class, \
 190       INCLUDES := sun/security/mscapi, \
 191       JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
 192       MANIFEST := $(JCE_MANIFEST), \
 193       SKIP_METAINF := true))
 194 
 195   $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
 196 
 197   ifndef OPENJDK
 198     SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
 199     $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
 200         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 201         $(install-file)
 202   else
 203     $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
 204         $(install-file)
 205   endif
 206 
 207   TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
 208 
 209 endif
 210 
 211 ##########################################################################################
 212 
 213 ifeq ($(OPENJDK_TARGET_OS), solaris)
 214   ifndef OPENJDK
 215 
 216     UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
 217     UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
 218     UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
 219 
 220     $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
 221         SRCS := $(JDK_OUTPUTDIR)/$(SECURITY_CLASSES_SUBDIR)/jdk.crypto.ucrypto, \
 222         SUFFIXES := .class, \
 223         INCLUDES := com/oracle/security/ucrypto, \
 224         JAR := $(UCRYPTO_JAR_UNSIGNED), \
 225         MANIFEST := $(JCE_MANIFEST), \
 226         SKIP_METAINF := true))
 227 
 228     $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
 229 
 230     $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
 231         @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
 232         $(install-file)
 233 
 234     TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
 235 
 236   endif
 237 endif
 238 
 239 all: $(TARGETS)
 240 
 241 .PHONY: default all