jdk/make/CreateSecurityJars.gmk
changeset 27577 54d97f463289
parent 27576 0db747c09110
parent 27575 f20b507032b5
child 27580 ca12cdda0551
equal deleted inserted replaced
27576:0db747c09110 27577:54d97f463289
     1 #
       
     2 # Copyright (c) 2013, 2014, 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 ##########################################################################################
       
    33 # Create manifest for security jars
       
    34 #
       
    35 # Include these extra attributes for now, should probably take out.
       
    36 #
       
    37 MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
       
    38 JCE_MANIFEST := $(JDK_OUTPUTDIR)/jce/unsigned/_the.security.manifest.mf
       
    39 
       
    40 $(JCE_MANIFEST): $(MAINMANIFEST)
       
    41 	$(MKDIR) -p $(@D)
       
    42 	$(RM) $@ $@.tmp
       
    43 	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
       
    44 	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
       
    45 	    $(MAINMANIFEST) >> $@.tmp
       
    46 	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
       
    47 	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
       
    48 	$(ECHO) "Release-Version: $(RELEASE)" >> $@.tmp
       
    49 	$(MV) $@.tmp $@
       
    50 
       
    51 ##########################################################################################
       
    52 # For crypto jars, always build the jar.
       
    53 #
       
    54 # The source for the crypto jars is not available for all licensees.
       
    55 # The BUILD_CRYPTO variable is set to no if these jars can't be built
       
    56 # to skip that step of the build.
       
    57 
       
    58 SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
       
    59 SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
       
    60 
       
    61 $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
       
    62     SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.pkcs11, \
       
    63     SUFFIXES := .class, \
       
    64     INCLUDES := sun/security/pkcs11, \
       
    65     JAR := $(SUNPKCS11_JAR_UNSIGNED), \
       
    66     MANIFEST := $(JCE_MANIFEST), \
       
    67     SKIP_METAINF := true))
       
    68 
       
    69 $(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
       
    70 
       
    71 $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
       
    72 	$(install-file)
       
    73 
       
    74 TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
       
    75 
       
    76 ##########################################################################################
       
    77 
       
    78 SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
       
    79 SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunec.jar
       
    80 
       
    81 $(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
       
    82     SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ec, \
       
    83     SUFFIXES := .class, \
       
    84     INCLUDES := sun/security/ec, \
       
    85     JAR := $(SUNEC_JAR_UNSIGNED), \
       
    86     MANIFEST := $(JCE_MANIFEST), \
       
    87     SKIP_METAINF := true))
       
    88 
       
    89 $(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
       
    90 
       
    91 $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
       
    92 	$(install-file)
       
    93 
       
    94 TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
       
    95 
       
    96 ##########################################################################################
       
    97 
       
    98 SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
       
    99 SUNJCE_PROVIDER_JAR_UNSIGNED := \
       
   100     $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
       
   101 
       
   102 ifneq ($(BUILD_CRYPTO), no)
       
   103   $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
       
   104       SRCS := $(JDK_OUTPUTDIR)/modules/java.base, \
       
   105       SUFFIXES := .class, \
       
   106       INCLUDES := com/sun/crypto/provider, \
       
   107       JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
       
   108       MANIFEST := $(JCE_MANIFEST), \
       
   109       SKIP_METAINF := true))
       
   110 
       
   111   $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
       
   112 
       
   113   TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
       
   114 endif
       
   115 
       
   116 $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
       
   117 	$(install-file)
       
   118 
       
   119 TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
       
   120 
       
   121 ##########################################################################################
       
   122 
       
   123 JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
       
   124 JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/jce.jar
       
   125 
       
   126 ifneq ($(BUILD_CRYPTO), no)
       
   127   $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
       
   128       SRCS := $(JDK_OUTPUTDIR)/modules/java.base, \
       
   129       SUFFIXES := .class, \
       
   130       INCLUDES := javax/crypto sun/security/internal, \
       
   131       JAR := $(JCE_JAR_UNSIGNED), \
       
   132       MANIFEST := $(JCE_MANIFEST), \
       
   133       SKIP_METAINF := true))
       
   134 
       
   135   $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
       
   136 
       
   137   TARGETS += $(JCE_JAR_UNSIGNED)
       
   138 endif
       
   139 
       
   140 $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
       
   141 	$(install-file)
       
   142 
       
   143 TARGETS += $(JCE_JAR_DST)
       
   144 
       
   145 ##########################################################################################
       
   146 
       
   147 ifeq ($(OPENJDK_TARGET_OS), windows)
       
   148 
       
   149   SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
       
   150   SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunmscapi.jar
       
   151 
       
   152   $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
       
   153       SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.mscapi, \
       
   154       SUFFIXES := .class, \
       
   155       INCLUDES := sun/security/mscapi, \
       
   156       JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
       
   157       MANIFEST := $(JCE_MANIFEST), \
       
   158       SKIP_METAINF := true))
       
   159 
       
   160   $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
       
   161 
       
   162   $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
       
   163 	$(install-file)
       
   164 
       
   165   TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
       
   166 
       
   167 endif
       
   168 
       
   169 ##########################################################################################
       
   170 
       
   171 ifeq ($(OPENJDK_TARGET_OS), solaris)
       
   172 
       
   173   UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
       
   174   UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
       
   175 
       
   176   $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
       
   177       SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
       
   178       SUFFIXES := .class, \
       
   179       INCLUDES := com/oracle/security/ucrypto, \
       
   180       JAR := $(UCRYPTO_JAR_UNSIGNED), \
       
   181       MANIFEST := $(JCE_MANIFEST), \
       
   182       SKIP_METAINF := true))
       
   183 
       
   184   $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
       
   185 
       
   186   $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
       
   187 	$(install-file)
       
   188 
       
   189   TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
       
   190 
       
   191 endif
       
   192 
       
   193 all: $(TARGETS)
       
   194 
       
   195 .PHONY: default all