4597N/A#
4597N/A# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
4597N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4597N/A#
4597N/A# This code is free software; you can redistribute it and/or modify it
4597N/A# under the terms of the GNU General Public License version 2 only, as
4597N/A# published by the Free Software Foundation. Oracle designates this
4597N/A# particular file as subject to the "Classpath" exception as provided
4597N/A# by Oracle in the LICENSE file that accompanied this code.
4597N/A#
4597N/A# This code is distributed in the hope that it will be useful, but WITHOUT
4597N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4597N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4597N/A# version 2 for more details (a copy is included in the LICENSE file that
4597N/A# accompanied this code).
4597N/A#
4597N/A# You should have received a copy of the GNU General Public License version
4597N/A# 2 along with this work; if not, write to the Free Software Foundation,
4597N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4597N/A#
4597N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4597N/A# or visit www.oracle.com if you need additional information or have any
4597N/A# questions.
4597N/A#
4597N/A
4597N/A#
4597N/A# Makefile for building ucrypto.jar and its native libraries.
4597N/A#
4597N/A# This file was modified from make/sun/security/pkcs11/Makefile.
4597N/A#
4597N/A#
4597N/A# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle
4597N/A# JDK builds respectively.)
4597N/A#
4597N/A# This Makefile does the "real" build of the Ucrypto provider files.
4597N/A# Since the sources are unavailable for OpenJDK, this Makefile is only
4597N/A# useful for JDK.
4597N/A#
4597N/A#
4597N/A# Main Targets (JDK on Solaris):
4597N/A#
4597N/A# all The usual, ucrypto.jar plus the native libraries.
4597N/A# builds and installs the prebuilt/signed jar.
4597N/A#
4597N/A# clobber/clean Cleans up the temp directory, ucrypto.jar, the
4597N/A# native libraries, and the config file from the
4597N/A# build area
4597N/A#
4597N/A# jar Builds, signs and installs ucrypto.jar
4597N/A# (Can only be done on machines with access to
4597N/A# the signing keystore)
4597N/A#
4597N/A# Other lesser-used Targets (JDK on Solaris):
4597N/A#
4597N/A# build-jar Builds ucrypto.jar (no sign/install)
4597N/A#
4597N/A# sign Builds/signs ucrypto.jar (no install)
4597N/A#
4597N/A# release Builds all targets in preparation
4597N/A# for workspace integration.
4597N/A# (Can only be done on machines with access to
4597N/A# the signing keystore)
4597N/A#
4597N/A# install-prebuilt Installs the pre-built jar files
4597N/A#
4597N/A# NOTE: None of the above target will update the prebuilt provider binary
4597N/A# under the closed workspace. To update it, you must explicitly copy the
4597N/A# binary from either the tmp/signed or lib/ext directory.
4597N/A#
4597N/A# This makefile was written to support parallel target execution.
4597N/A#
4597N/A
4597N/ABUILDDIR = ../../../..
4597N/A
4597N/Ainclude $(BUILDDIR)/common/Defs.gmk
4597N/A
4597N/Aifndef OPENJDK
4597N/A ifneq ($(PLATFORM), solaris)
4597N/A all:
4597N/A else
4597N/A PACKAGE = com.oracle.security.ucrypto
4597N/A LIBRARY = j2ucrypto
4597N/A PRODUCT = oracle
4597N/A
4597N/A #
4597N/A # The following is for when we need to do postprocessing
4597N/A # (signing/obfuscation) against a read-only build. If the OUTPUTDIR
4597N/A # isn't writable, the build currently crashes out.
4597N/A #
4597N/A ifdef ALT_JCE_BUILD_DIR
4597N/A # =====================================================
4597N/A # Where to place the output, in case we're building from a read-only
4597N/A # build area. (e.g. a release engineering build.)
4597N/A JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
4597N/A IGNORE_WRITABLE_OUTPUTDIR_TEST=true
4597N/A else
4597N/A JCE_BUILD_DIR=${TEMPDIR}
4597N/A endif
4597N/A
4597N/A JAVAC_MAX_WARNINGS=false
4597N/A JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
4597N/A JAVAC_WARNINGS_FATAL=true
4597N/A
4597N/A #
4597N/A # C and Java Files
4597N/A #
4597N/A include FILES_c.gmk
4597N/A
4597N/A #
4597N/A # Subdirectories of these are automatically included.
4597N/A #
4597N/A AUTO_FILES_JAVA_DIRS = com/oracle/security/ucrypto
4597N/A
4597N/A #
4597N/A # Java files that define native methods
4597N/A #
4597N/A FILES_export = \
4597N/A com/oracle/security/ucrypto/UcryptoProvider.java \
4597N/A com/oracle/security/ucrypto/NativeCipher.java \
4597N/A com/oracle/security/ucrypto/NativeDigest.java \
4597N/A com/oracle/security/ucrypto/NativeKey.java \
4597N/A com/oracle/security/ucrypto/NativeRSASignature.java \
4597N/A com/oracle/security/ucrypto/NativeRSACipher.java
4597N/A
4597N/A #
4597N/A # Find native code
4597N/A #
4597N/A vpath %.c \
4597N/A $(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
4597N/A
4597N/A #
4597N/A # Find include files
4597N/A #
4597N/A OTHER_INCLUDES += \
4597N/A -I$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
4597N/A
4597N/A #
4597N/A # Rules
4597N/A #
4597N/A CLASSDESTDIR = $(TEMPDIR)/classes
4597N/A JAVAHFLAGS = -bootclasspath \
5108N/A "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
4597N/A
4597N/A include $(BUILDDIR)/common/Mapfile-vers.gmk
4597N/A include $(BUILDDIR)/common/Library.gmk
4597N/A
4597N/A #
4597N/A # Libraries to link
4597N/A #
4597N/A OTHER_LDLIBS = -ldl
4597N/A
4597N/A # Default config file
4597N/A UCRYPTO_CFG_SRC = $(CLOSED_SRC)/share/lib/security/ucrypto-solaris.cfg
4597N/A UCRYPTO_CFG_BUILD = $(LIBDIR)/security/ucrypto-solaris.cfg
4597N/A
4597N/A #
4597N/A # We use a variety of subdirectories in the $(TEMPDIR) depending on what
4597N/A # part of the build we're doing. Build is initially done in the unsigned
4597N/A # area and when files are signed, they will be placed in the appropriate area.
4597N/A #
4597N/A UNSIGNED_DIR = $(TEMPDIR)/unsigned
4597N/A
4597N/A #
4597N/A # Rules
4597N/A #
4597N/A all: ucrypto-cfg build-jar install-prebuilt
4597N/A $(build-warning)
4597N/A
4597N/A ucrypto-cfg: $(UCRYPTO_CFG_BUILD)
4597N/A
4597N/A $(UCRYPTO_CFG_BUILD): $(UCRYPTO_CFG_SRC)
4597N/A $(install-file)
4597N/A
4597N/A include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
4597N/A
4597N/A
4597N/A # =====================================================
4597N/A # Build the unsigned ucrypto.jar file.
4597N/A #
4597N/A
4597N/A JAR_DESTFILE = $(EXTDIR)/ucrypto.jar
4597N/A
4597N/A #
4597N/A # The ucrypto.jar needs to be in the extension class directory,
4597N/A # therefore none of its classes can appear in $(CLASSBINDIR).
4597N/A # Currently no one is using any of the internals, so these files
4597N/A # should not have been built.
4597N/A #
4597N/A
4597N/A #
4597N/A # Since the -C option to jar is used below, each directory entry must be
4597N/A # preceded with the appropriate directory to "cd" into.
4597N/A #
4597N/A JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
4597N/A
4597N/A build-jar: $(UNSIGNED_DIR)/ucrypto.jar
4597N/A
4597N/A #
4597N/A # Build ucrypto.jar.
4597N/A #
5434N/A $(UNSIGNED_DIR)/ucrypto.jar: build $(JCE_MANIFEST_FILE)
4597N/A $(prep-target)
5434N/A $(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \
4597N/A $(BOOT_JAR_JFLAGS)
4597N/A @$(java-vm-cleanup)
4597N/A
4597N/A #
4597N/A # Sign ucrypto.jar
4597N/A #
4597N/A SIGNED_DIR = $(JCE_BUILD_DIR)/signed
4597N/A
4597N/A sign: $(SIGNED_DIR)/ucrypto.jar
4597N/A
4597N/A ifndef ALT_JCE_BUILD_DIR
4597N/A $(SIGNED_DIR)/ucrypto.jar: $(UNSIGNED_DIR)/ucrypto.jar
4597N/A else
4597N/A #
4597N/A # We have to remove the build dependency, otherwise, we'll try to rebuild it
4597N/A # which we can't do on a read-only filesystem.
4597N/A #
4597N/A $(SIGNED_DIR)/ucrypto.jar:
4597N/A @if [ ! -r $(UNSIGNED_DIR)/ucrypto.jar ] ; then \
4597N/A $(ECHO) "Couldn't find $(UNSIGNED_DIR)/ucrypto.jar"; \
4597N/A exit 1; \
4597N/A fi
4597N/A endif
4597N/A $(call sign-file, $(UNSIGNED_DIR)/ucrypto.jar)
4597N/A
4597N/A
4597N/A # =====================================================
4597N/A # Create the Release Engineering files. Signed builds, etc.
4597N/A #
4597N/A
4597N/A release: $(SIGNED_DIR)/ucrypto.jar
4597N/A $(RM) $(JCE_BUILD_DIR)/release/ucrypto.jar
4597N/A $(MKDIR) -p $(JCE_BUILD_DIR)/release
4597N/A $(CP) $(SIGNED_DIR)/ucrypto.jar $(JCE_BUILD_DIR)/release
4597N/A $(release-warning)
4597N/A
4597N/A
4597N/A # =====================================================
4597N/A # Install routines.
4597N/A #
4597N/A
4597N/A #
4597N/A # Install ucrypto.jar, depending on which type is requested.
4597N/A #
4597N/A jar: $(JAR_DESTFILE)
4597N/A $(release-warning)
4597N/A
4597N/A $(JAR_DESTFILE): $(SIGNED_DIR)/ucrypto.jar
4597N/A $(install-file)
4597N/A
4597N/A install-prebuilt:
4597N/A @$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
4597N/A $(RM) $(JAR_DESTFILE)
4597N/A $(CP) $(PREBUILT_DIR)/ucrypto/ucrypto.jar $(JAR_DESTFILE)
4597N/A
4597N/A
4597N/A # =====================================================
4597N/A # Support routines.
4597N/A #
4597N/A clobber clean::
4597N/A $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
4597N/A $(RM) -r $(UCRYPTO_CFG_BUILD)
4597N/A
4597N/A .PHONY: build-jar jar sign release install-prebuilt
4597N/A
4597N/A endif #ifneq ($(PLATFORM), solaris)
4597N/Aendif #ifndef OPENJDK