Makefile revision 4337
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# This code is free software; you can redistribute it and/or modify it
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# under the terms of the GNU General Public License version 2 only, as
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# published by the Free Software Foundation. Oracle designates this
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# particular file as subject to the "Classpath" exception as provided
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# by Oracle in the LICENSE file that accompanied this code.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# This code is distributed in the hope that it will be useful, but WITHOUT
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# accompanied this code).
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# You should have received a copy of the GNU General Public License version
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f41405d21249e11c1636301b1324ac1937b455aaMark Andrews# or visit www.oracle.com if you need additional information or have any
a050fc374c925e0a8ac35e5b32e1a8f2a526e180Mark Andrews# questions.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Makefile for building jce.jar and the various cryptographic strength
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# policy jar files.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews# respectively.)
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# jar files do not require signing, but those for JDK do. If an unsigned
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# jar file is installed into JDK, things will break when the crypto
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# routines are called.
33518843817dd9cf127eb09c5952227f1972af55Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# This Makefile does the "real" build of the JCE files. There are some
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# javac options currently specific to JCE, so we recompile now to make
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# sure any implicit compilations didn't use any incorrect flags.
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# For OpenJDK, the jar files built here are installed directly into the
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# OpenJDK.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# For JDK, the binaries use pre-built/pre-signed binary files stored in
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# the closed workspace that are not shipped in the OpenJDK workspaces.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# We still build the JDK files here to verify the files compile, and in
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# preparation for possible signing. Developers working on JCE in JDK
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# must sign the JCE files before testing. The JCE signing key is kept
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# separate from the JDK workspace to prevent its disclosure.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# be built and signed, and the resulting jar files *MUST BE CHECKED INTO
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence# THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT BE
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence# FORGOTTEN*, otherwise a bug fixed in the source code will not be
105f5a65b1f680f4cb6f897b8b0f7ee7e09e41ebDavid Lawrence# reflected in the shipped binaries. The "release" target should be
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# used to generate the required files.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
88b3bc12b5570aae77e5963204e9111a2875915eAndreas Gustafsson# There are a number of targets to help both JDK/OpenJDK developers.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Main Targets (JDK/OPENJDK):
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews# all/clobber/clean The usual.
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews# If OpenJDK: builds/installs the
1c9200af084f2b6f1d28eccf91525676c158cfa3Mark Andrews# jce.jar/limited policy files.
ff8fd4d1b6abb0490b5aaf2b1d86555750ae0818Mark Andrews# If JDK: builds but does not install.
9463feb3cb002df10b053f71e21540607c7a48e8Tatuya JINMEI 神明達哉# During full tops-down builds,
c05a979fda35c83d7fba16fee7859644e98a7450Mark Andrews# prebuilt/presigned jce.jar &
2a313f56e78e19ae6dc2315bb53bd32fad13ae29Mark Andrews# limited policy files are copied
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark Andrews# in by make/java/redist/Makefile.
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews# If you are working in this directory
60c2c8814f838f503333da5b2fd7e6792ca39c14Mark Andrews# and want to install the prebuilts,
c58088e3a0fd9e553db750cd4b08d3e621d0ded4Mark Andrews# use the "install-prebuilt" target.
b9858c2efcee324745a1b8d7b099baf540bc695bMark Andrews#
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# jar Builds/installs jce.jar
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# If OpenJDK, does not sign
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# If JDK, tries to sign
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews#
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews# Other lesser-used Targets (JDK/OPENJDK):
a69a77ddfef58e93036cf6173dc7f91ed864d103Mark Andrews#
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# build-jar Builds jce.jar (does not sign/install)
f4545143206d918a7f6ee53cd4fb9788c534c0c7Mark Andrews#
09233633dadbd7878e60dd383a814e24e5eda1c6Mark Andrews# build-policy Builds policy files (does not sign/install)
09233633dadbd7878e60dd383a814e24e5eda1c6Mark Andrews#
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews# install-jar Alias for "jar" above
ea37c1a7780311cc7076ff54f09774b2296aebe5Mark Andrews#
de90c0b2efac159580365beaa761a14bdb74330cMark Andrews# install-limited Builds/installs limited policy files
49aa1303a7cf1ec2a06cde11e46a039dddfca8feMark Andrews# If OpenJDK, does not sign
e20eae14fc554bae394f535067e80884b59d0684Mark Andrews# If JDK, tries to sign
e03d4ecce3b62bb0a02d2f5e2cc1a9549df08498Mark Andrews# install-unlimited Builds/nstalls unlimited policy files
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews# If OpenJDK, does not sign
1c8c1aa1c6a103a6495109069cca518c9f475f39Mark Andrews# If JDK, tries to sign
d4ae7d9200ebad7700e8e85886cabe93ab24afd8Mark Andrews#
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews# Other targets (JDK only):
b6f837397dadf6b296ee1825c95e90235ee5b5ffMark Andrews#
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews# sign Alias for sign-jar and sign-policy
d4cefad19e32879e6847df043e62ad8f9cbfa06bMark Andrews# sign-jar Builds/signs jce.jar file (no install)
2984f8f7bf213642e47affe710851ff0d6580083Mark Andrews# sign-policy Builds/signs policy files (no install)
666bae3ccc9d50d840dd6b7b13731f7653f74e77Mark Andrews#
a14a8a963a407d636f76e223704f62440bd10176Mark Andrews# release Builds all targets in preparation
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews# for workspace integration.
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews#
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews# install-prebuilt Installs the pre-built jar files
cb6fe566ff051ade7b99f5ca9fca897193d1bd4fMark Andrews#
d3e93aac7a6a647b1a2905bfdbdd5ce1b9e46a73Mark Andrews# This makefile was written to support parallel target execution.
245bce4ef1e9b3e7e802141dba7c2ca878e4768bMark Andrews#
00b872e4f76587584a2359e9001e9cf08b195ccfMark Andrews
fad04ffe23de26d42bae77b69a983bd964a01883Mark AndrewsBUILDDIR = ../..
fad04ffe23de26d42bae77b69a983bd964a01883Mark AndrewsPACKAGE = javax.crypto
aacfb65e0ae7087bdb4f76fb72b7ee3b46893440Mark AndrewsPRODUCT = sun
85f5fe1a722626b33eb9a490def709d02a35e65dMark Andrews
b26014a1945864a54464b413279faad7dad6d772Mark Andrews#
886fff19f145c93c64967a87e1ff5a9ce18503a6Mark Andrews# The following is for when we need to do postprocessing
bda34793bb9f407390fd54cef8e5846c357e55c6Mark Andrews# (signing) against a read-only build. If the OUTPUTDIR
bda34793bb9f407390fd54cef8e5846c357e55c6Mark Andrews# isn't writable, the build currently crashes out.
2b59366035cf1add576318ab336e6b4bdf170e0fMark Andrews#
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrewsifndef OPENJDK
fad04ffe23de26d42bae77b69a983bd964a01883Mark Andrews ifdef ALT_JCE_BUILD_DIR
8a655e59bc1db9927b3b418f5064ae58347b11eaMark Andrews # =====================================================
cdd28dc017ce03d208cdfbe7d55fb76377c85accMark Andrews # Where to place the output, in case we're building from a read-only
10f35749cf81005668548374a378b7c8ac2a350cMark Andrews # build area. (e.g. a release engineering build.)
c1c9e72292db84ebf69093f38a2d1a4a60aeebabMark Andrews JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
209b1d150ce0b5d8963b1ba39664e80256929011Mark Andrews IGNORE_WRITABLE_OUTPUTDIR_TEST=true
fad04ffe23de26d42bae77b69a983bd964a01883Mark Andrews else
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews JCE_BUILD_DIR=${TEMPDIR}
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews endif
f7ba2cb04297a7babf9787fb22591addb1f1fe73Mark Andrewsendif
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrewsinclude $(BUILDDIR)/common/Defs.gmk
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews
d90f3a24c725704732b106380cfc2f3dab88bb3eMark Andrews#
024383c7cfdcb1d06779c10949ab413c98a5983eMark Andrews# Location for the newly built classfiles.
eccf8cc404a04ffc465a6947ed4351703dfbadafEvan Hunt#
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark AndrewsCLASSDESTDIR = $(TEMPDIR)/classes
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews
1e18f761a7f406c5c472ddefea9513c80a67efacMark Andrews#
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews# Subdirectories of these are automatically included.
4c53f98dbda8fc3e2093a6d685f5701e908573fbMark Andrews#
4c53f98dbda8fc3e2093a6d685f5701e908573fbMark AndrewsAUTO_FILES_JAVA_DIRS = \
b24b6ddab719d78f1494fea3075cf44200fa827eMark Andrews javax/crypto \
b24b6ddab719d78f1494fea3075cf44200fa827eMark Andrews sun/security/internal/interfaces \
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews sun/security/internal/spec
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewsinclude $(BUILDDIR)/common/Classes.gmk
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews#
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# Rules
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews#
9b97400166683a5b80bb28e95425237261af1e0fMark Andrews
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews#
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# Some licensees do not get the security sources, but we still need to
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# be able to build "all" for them. Check here to see if the sources were
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# available. If not, then we don't need to continue this rule.
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewsifdef OPENJDK
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewsall: build-jar install-jar build-policy install-limited
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewselse # OPENJDK
483f1611fcc53d0f9eafee85b885a0c0bfedf418Mark Andrewsifeq ($(strip $(FILES_java)),)
bc98d5a4c6601bb72cd9cde7926e896b23382e26Mark Andrewsall:
8f20f6c9d7ce5a0f0af6ee4c5361832d97b1c5d4Mark Andrews $(no-source-warning)
f6e45a5c54b7af4b1c303e8d3ff3b7d78622df9eMark Andrewselse # FILES_java/policy files available
8f20f6c9d7ce5a0f0af6ee4c5361832d97b1c5d4Mark Andrewsall: build-jar build-policy
bf4fe7ca1b9c313200aaefec18ac165ce9efc16bMark Andrews $(build-warning)
endif # $(FILES_java)/policy files available
endif # OPENJDK
#
# We use a variety of subdirectories in the $(TEMPDIR) depending on what
# part of the build we're doing. Both OPENJDK/JDK builds are initially
# done in the unsigned area. When files are signed in JDK, they will be
# placed in the appropriate areas.
#
UNSIGNED_DIR = $(TEMPDIR)/unsigned
include Defs-jce.gmk
# =====================================================
# Build the unsigned jce.jar file. Signing comes later.
#
JAR_DESTFILE = $(LIBDIR)/jce.jar
#
# JCE building is somewhat involved.
#
# OpenJDK: Since we do not ship prebuilt JCE files, previous compiles
# in the build may have needed JCE class signatures. There were then
# implicitly built by javac (likely using the boot javac). While using
# those class files was fine for signatures, we need to rebuild using
# the right compiler.
#
# JDK: Even through the jce.jar was previously installed, since the
# source files are accessible in the source directories, they will
# always be "newer" than the prebuilt files inside the jar, and thus
# make will always rebuild them. (We could "hide" the JCE source in a
# separate directory, but that would make the build logic for JDK and
# OpenJDK more complicated.)
#
# Thus in either situation, we shouldn't use these files.
#
# To make sure the classes were built with the right compiler options,
# delete the existing files in $(CLASSBINDIR), rebuild the right way in a
# directory under $(TEMPDIR), then copy the files back to
# $(CLASSBINDIR). Building in $(TEMPDIR) allows us to use our make
# infrastructure without modification: .classes.list, macros, etc.
#
#
# The list of directories that will be remade from scratch, using the
# right compilers/options.
#
DELETE_DIRS = $(patsubst %, $(CLASSBINDIR)/%, $(AUTO_FILES_JAVA_DIRS))
#
# Since the -C option to jar is used below, each directory entry must be
# preceded with the appropriate directory to "cd" into.
#
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
build-jar: $(UNSIGNED_DIR)/jce.jar
#
# Build jce.jar, then replace the previously built JCE files in the
# classes directory with these. This ensures we have consistently built
# files throughout the workspaces.
#
$(UNSIGNED_DIR)/jce.jar: prebuild build $(JCE_MANIFEST_FILE)
$(prep-target)
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \
$(BOOT_JAR_JFLAGS)
$(CP) -r $(CLASSDESTDIR)/* $(CLASSBINDIR)
@$(java-vm-cleanup)
build: prebuild
prebuild:
$(RM) -r $(DELETE_DIRS)
# =====================================================
# Build the unsigned policy files.
#
# Given the current state of world export/import policies,
# these settings work for Sun's situation. This note is not
# legal guidance, you must still resolve any export/import issues
# applicable for your situation. Contact your export/import
# counsel for more information.
#
POLICY_DESTDIR = $(LIBDIR)/security
UNSIGNED_POLICY_BUILDDIR = $(UNSIGNED_DIR)/policy
build-policy: unlimited limited
#
# Build the unsigned unlimited policy files.
#
unlimited: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \
policy/unlimited/default_US_export.policy \
policy/unlimited/UNLIMITED
$(prep-target)
$(BOOT_JAR_CMD) cmf policy/unlimited/UNLIMITED $@ \
-C policy/unlimited default_US_export.policy \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \
policy/unlimited/default_local.policy \
policy/unlimited/UNLIMITED
$(prep-target)
$(BOOT_JAR_CMD) cmf policy/unlimited/UNLIMITED $@ \
-C policy/unlimited default_local.policy \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
#
# Build the unsigned limited policy files.
#
# NOTE: We currently do not place restrictions on our limited export
# policy. This was not a typo.
#
limited: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
$(install-file)
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \
policy/limited/default_local.policy \
policy/limited/exempt_local.policy \
policy/limited/LIMITED
$(prep-target)
$(BOOT_JAR_CMD) cmf policy/limited/LIMITED $@ \
-C policy/limited default_local.policy \
-C policy/limited exempt_local.policy \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
UNSIGNED_POLICY_FILES = \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \
ifndef OPENJDK
# =====================================================
# Sign the various jar files. Not needed for OpenJDK.
#
SIGNED_DIR = $(JCE_BUILD_DIR)/signed
SIGNED_POLICY_BUILDDIR = $(SIGNED_DIR)/policy
SIGNED_POLICY_FILES = \
$(patsubst $(UNSIGNED_POLICY_BUILDDIR)/%,$(SIGNED_POLICY_BUILDDIR)/%, \
$(UNSIGNED_POLICY_FILES))
sign: sign-jar sign-policy
sign-jar: $(SIGNED_DIR)/jce.jar
sign-policy: $(SIGNED_POLICY_FILES)
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/jce.jar: $(UNSIGNED_DIR)/jce.jar
else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/jce.jar:
@if [ ! -r $(UNSIGNED_DIR)/jce.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/jce.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/jce.jar)
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
$(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar
$(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar
$(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar
$(call sign-file, $<)
# =====================================================
# Create the Release Engineering files. Signed builds,
# unlimited policy file distribution, etc.
#
CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto
release: $(SIGNED_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/README.txt
$(RM) -r \
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy \
$(JCE_BUILD_DIR)/release/jce.jar \
$(JCE_BUILD_DIR)/release/US_export_policy.jar \
$(JCE_BUILD_DIR)/release/local_policy.jar \
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy.zip
$(MKDIR) -p $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
$(CP) $(SIGNED_DIR)/jce.jar $(JCE_BUILD_DIR)/release
$(CP) \
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \
$(JCE_BUILD_DIR)/release
$(CP) \
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \
$(CLOSED_DIR)/doc/README.txt \
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
cd $(JCE_BUILD_DIR)/release ; \
$(ZIPEXE) -qr UnlimitedJCEPolicy.zip UnlimitedJCEPolicy
$(release-warning)
endif # OPENJDK
# =====================================================
# Install routines.
#
#
# Install jce.jar, depending on which type is requested.
#
install-jar jar: $(JAR_DESTFILE)
ifndef OPENJDK
$(release-warning)
endif
ifdef OPENJDK
$(JAR_DESTFILE): $(UNSIGNED_DIR)/jce.jar
else
$(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar
endif
$(install-file)
#
# Install the appropriate policy file, depending on the type of build.
#
ifdef OPENJDK
INSTALL_POLICYDIR = $(UNSIGNED_POLICY_BUILDDIR)
else
INSTALL_POLICYDIR = $(SIGNED_POLICY_BUILDDIR)
endif
install-limited-jars: \
$(INSTALL_POLICYDIR)/limited/US_export_policy.jar \
$(INSTALL_POLICYDIR)/limited/local_policy.jar
$(MKDIR) -p $(POLICY_DESTDIR)
$(RM) \
$(POLICY_DESTDIR)/US_export_policy.jar \
$(POLICY_DESTDIR)/local_policy.jar
$(CP) $^ $(POLICY_DESTDIR)
install-limited: install-limited-jars
ifndef OPENJDK
$(release-warning)
endif
install-unlimited-jars: \
$(INSTALL_POLICYDIR)/unlimited/US_export_policy.jar \
$(INSTALL_POLICYDIR)/unlimited/local_policy.jar
$(MKDIR) -p $(POLICY_DESTDIR)
$(RM) \
$(POLICY_DESTDIR)/US_export_policy.jar \
$(POLICY_DESTDIR)/local_policy.jar
$(CP) $^ $(POLICY_DESTDIR)
install-unlimited: install-unlimited-jars
ifndef OPENJDK
$(release-warning)
endif
ifndef OPENJDK
install-prebuilt-jars:
@$(ECHO) "\n>>>Installing prebuilt JCE framework..."
$(RM) $(JAR_DESTFILE) \
$(POLICY_DESTDIR)/US_export_policy.jar \
$(POLICY_DESTDIR)/local_policy.jar
$(CP) $(PREBUILT_DIR)/jce/jce.jar $(JAR_DESTFILE)
$(CP) \
$(PREBUILT_DIR)/jce/US_export_policy.jar \
$(PREBUILT_DIR)/jce/local_policy.jar \
$(POLICY_DESTDIR)
install-prebuilt: install-prebuilt-jars
endif
# =====================================================
# Support routines.
#
clobber clean::
$(RM) -r $(JAR_DESTFILE) $(POLICY_DESTDIR)/US_export_policy.jar \
$(POLICY_DESTDIR)/local_policy.jar $(DELETE_DIRS) $(TEMPDIR) \
$(JCE_BUILD_DIR)
.PHONY: build-jar jar build-policy unlimited limited install-jar \
install-limited install-unlimited
ifndef OPENJDK
.PHONY: sign sign-jar sign-policy release install-prebuilt
endif