jdk/make/sun/security/pkcs11/Makefile
author jjg
Mon, 15 Aug 2011 11:48:20 -0700
changeset 10336 0bb1999251f8
parent 9849 eb437e9fba66
child 10798 413b731e1818
permissions -rw-r--r--
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror Reviewed-by: xuelei, mullan Contributed-by: alexandre.boulgakov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8583
diff changeset
     2
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Makefile for building sunpkcs11.jar and native libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# This file was derived from make/com/sun/crypto/provider/Makefile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
# respectively.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
# JCE builds are very different between OpenJDK and JDK.  The OpenJDK JCE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# jar files do not require signing, but those for JDK do.  If an unsigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
# jar file is installed into JDK, things will break when the crypto
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
# routines are called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# This Makefile does the "real" build of the JCE files.  For OpenJDK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
# the jar files built here are installed directly into the OpenJDK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
# For JDK, the binaries use pre-built/pre-signed binary files stored in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
# the closed workspace that are not shipped in the OpenJDK workspaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
# We still build the JDK files here to verify the files compile, and in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
# preparation for possible signing.  Developers working on JCE in JDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
# must sign the JCE files before testing.  The JCE signing key is kept
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
# separate from the JDK workspace to prevent its disclosure.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
# SPECIAL NOTE TO JCE/JDK developers:  The source files must eventually
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
# be built, signed, and then the resulting jar files MUST BE CHECKED
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
# INTO THE CLOSED PART OF THE WORKSPACE*.  This separate step *MUST NOT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
# reflected in the shipped binaries.  The "release" target should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
# used to generate the required files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
# There are a number of targets to help both JDK/OpenJDK developers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
# Main Targets (JDK/OPENJDK):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    62
#     all/clobber/clean        The usual, plus the native libraries.
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    63
#                                  If OpenJDK, installs sunpkcs11.jar.
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    64
#                                  If JDK, installs prebuilt
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    65
#                                      sunpkcs11.jar.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    67
#     jar                      Builds/installs sunpkcs11.jar
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    68
#                                  If OpenJDK, does not sign.
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    69
#                                  If JDK, tries to sign.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
# Other lesser-used Targets (JDK/OPENJDK):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    73
#     build-jar                Builds sunpkcs11.jar
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    74
#                                  (does not sign/install)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    76
#     install-jar              Alias for "jar" above.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
# Other targets (JDK only):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    80
#     sign                     Alias for sign-jar
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    81
#          sign-jar            Builds/signs sunpkcs11.jar (no install)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    83
#     release                  Builds all targets in preparation
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    84
#                              for workspace integration.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
#
3353
ddbd63234844 6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents: 916
diff changeset
    86
#     install-prebuilt         Installs the pre-built jar files
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
# This makefile was written to support parallel target execution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
BUILDDIR = ../../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
PACKAGE = sun.security.pkcs11
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
LIBRARY = j2pkcs11
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
PRODUCT = sun
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
    95
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
    96
#
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
    97
# The following is for when we need to do postprocessing
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
    98
# (signing/obfuscation) against a read-only build.  If the OUTPUTDIR
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
    99
# isn't writable, the build currently crashes out.
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   100
#
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   101
ifndef OPENJDK
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   102
  ifdef ALT_JCE_BUILD_DIR
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   103
    # =====================================================
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   104
    # Where to place the output, in case we're building from a read-only
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   105
    # build area.  (e.g. a release engineering build.)
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   106
    JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   107
    IGNORE_WRITABLE_OUTPUTDIR_TEST=true
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   108
  else
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   109
    JCE_BUILD_DIR=${TEMPDIR}
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   110
  endif
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   111
endif
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   112
10336
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9849
diff changeset
   113
JAVAC_MAX_WARNINGS=false
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9849
diff changeset
   114
JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 9849
diff changeset
   115
JAVAC_WARNINGS_FATAL=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
# C and Java Files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
include FILES_c.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
# Subdirectories of these are automatically included.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
AUTO_FILES_JAVA_DIRS = sun/security/pkcs11
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
# Java files that define native methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
FILES_export = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    sun/security/pkcs11/wrapper/PKCS11.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    sun/security/pkcs11/Secmod.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
# Find native code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
vpath %.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
  $(SHARE_SRC)/native/sun/security/pkcs11/wrapper \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  $(PLATFORM_SRC)/native/sun/security/pkcs11/wrapper \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
# Find include files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
OTHER_INCLUDES += \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
  -I$(SHARE_SRC)/native/sun/security/pkcs11/wrapper \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  -I$(PLATFORM_SRC)/native/sun/security/pkcs11/wrapper
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
# Rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
CLASSDESTDIR = $(TEMPDIR)/classes
9849
eb437e9fba66 7003952: SEC: securely load DLLs and launch executables using fully qualified path
valeriep
parents: 9035
diff changeset
   153
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
include $(BUILDDIR)/common/Mapfile-vers.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
include $(BUILDDIR)/common/Library.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
# Libraries to link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
  OTHER_LDLIBS = $(JVMLIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  OTHER_LDLIBS = -ldl $(JVMLIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   168
# Other config files
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   169
SUNPKCS11_CFG   =
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   170
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   171
ifeq ($(PLATFORM), solaris)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   172
SUNPKCS11_CFG   = sunpkcs11-cfg
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   173
endif # PLATFORM
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   174
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   175
SUNPKCS11_CFG_SRC   = $(TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   176
SUNPKCS11_CFG_BUILD = $(LIBDIR)/security/sunpkcs11-solaris.cfg
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   177
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
# We use a variety of subdirectories in the $(TEMPDIR) depending on what
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
# part of the build we're doing.  Both OPENJDK/JDK builds are initially
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
# done in the unsigned area.  When files are signed in JDK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
# they will be placed in the appropriate area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
UNSIGNED_DIR = $(TEMPDIR)/unsigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
# Rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
ifdef OPENJDK
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   191
all: $(SUNPKCS11_CFG) build-jar install-jar
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
else
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   193
all: $(SUNPKCS11_CFG) build-jar install-prebuilt
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
	$(build-warning)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   197
sunpkcs11-cfg: $(SUNPKCS11_CFG_BUILD)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   198
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   199
$(SUNPKCS11_CFG_BUILD): $(SUNPKCS11_CFG_SRC)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   200
	$(install-file)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   201
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   202
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   203
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
# =====================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
# Build the unsigned sunpkcs11.jar file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
JAR_DESTFILE = $(EXTDIR)/sunpkcs11.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
# The sunpkcs11.jar needs to be in the extension class directory,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
# therefore none of its classes can appear in $(CLASSBINDIR). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
# Currently no one is using any of the PKCS11 internals, so these files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
# should not have been built.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
# Since the -C option to jar is used below, each directory entry must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
# preceded with the appropriate directory to "cd" into.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
build-jar: $(UNSIGNED_DIR)/sunpkcs11.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
# Build sunpkcs11.jar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
$(UNSIGNED_DIR)/sunpkcs11.jar: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
	$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
	$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 300
diff changeset
   232
	    $(BOOT_JAR_JFLAGS)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
	@$(java-vm-cleanup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
# =====================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
# Sign the provider jar file.  Not needed for OpenJDK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   241
SIGNED_DIR = $(JCE_BUILD_DIR)/signed
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
sign: sign-jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
sign-jar: $(SIGNED_DIR)/sunpkcs11.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   247
ifndef ALT_JCE_BUILD_DIR
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
$(SIGNED_DIR)/sunpkcs11.jar: $(UNSIGNED_DIR)/sunpkcs11.jar
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   249
else
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   250
#
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   251
# We have to remove the build dependency, otherwise, we'll try to rebuild it
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   252
# which we can't do on a read-only filesystem.
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   253
#
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   254
$(SIGNED_DIR)/sunpkcs11.jar:
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   255
	@if [ ! -r $(UNSIGNED_DIR)/sunpkcs11.jar ] ; then \
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   256
            $(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunpkcs11.jar"; \
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   257
            exit 1; \
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   258
        fi
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   259
endif
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   260
	$(call sign-file, $(UNSIGNED_DIR)/sunpkcs11.jar)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
# =====================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
# Create the Release Engineering files.  Signed builds, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
release: $(SIGNED_DIR)/sunpkcs11.jar
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   268
	$(RM) $(JCE_BUILD_DIR)/release/sunpkcs11.jar
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   269
	$(MKDIR) -p $(JCE_BUILD_DIR)/release
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   270
	$(CP) $(SIGNED_DIR)/sunpkcs11.jar $(JCE_BUILD_DIR)/release
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
	$(release-warning)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
endif # OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
# =====================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
# Install routines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
# Install sunpkcs11.jar, depending on which type is requested.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
install-jar jar: $(JAR_DESTFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
	$(release-warning)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunpkcs11.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
$(JAR_DESTFILE): $(SIGNED_DIR)/sunpkcs11.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
endif
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 7668
diff changeset
   293
	$(install-file)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
install-prebuilt:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
	@$(ECHO) "\n>>>Installing prebuilt SunPKCS11 provider..."
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
	$(RM) $(JAR_DESTFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
	$(CP) $(PREBUILT_DIR)/pkcs11/sunpkcs11.jar $(JAR_DESTFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
# =====================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
# Support routines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
clobber clean::
300
d4f77ff718fd 6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents: 2
diff changeset
   308
	$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3353
diff changeset
   309
	$(RM) $(SUNPKCS11_CFG_BUILD) 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
.PHONY: build-jar jar install-jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
.PHONY: sign sign-jar release install-prebuilt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
endif