Makefile revision 4337
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# 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# 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# 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# 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
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Makefile for building jce.jar and the various cryptographic strength
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# policy jar files.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews# respectively.)
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.
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.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# For OpenJDK, the jar files built here are installed directly into the
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# 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.
88b3bc12b5570aae77e5963204e9111a2875915eAndreas Gustafsson# There are a number of targets to help both JDK/OpenJDK developers.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Main Targets (JDK/OPENJDK):
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,
2a313f56e78e19ae6dc2315bb53bd32fad13ae29Mark Andrews# limited policy files are copied
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews# If you are working in this directory
60c2c8814f838f503333da5b2fd7e6792ca39c14Mark Andrews# and want to install the prebuilts,
c58088e3a0fd9e553db750cd4b08d3e621d0ded4Mark Andrews# use the "install-prebuilt" target.
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# If OpenJDK, does not sign
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# If JDK, tries to sign
58e0b35a3bbb50d154c36749096f7463dab75a7aMark Andrews# Other lesser-used Targets (JDK/OPENJDK):
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrews# build-jar Builds jce.jar (does not sign/install)
09233633dadbd7878e60dd383a814e24e5eda1c6Mark Andrews# build-policy Builds policy files (does not sign/install)
7ecbfb6c0f566894fb7050e021cded6822771789Mark Andrews# install-jar Alias for "jar" above
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
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews# Other targets (JDK only):
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)
a14a8a963a407d636f76e223704f62440bd10176Mark Andrews# release Builds all targets in preparation
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews# for workspace integration.
fd6574dbc551faac89ae2ce6f3549fed51c24e49Mark Andrews# install-prebuilt Installs the pre-built jar files
d3e93aac7a6a647b1a2905bfdbdd5ce1b9e46a73Mark Andrews# This makefile was written to support parallel target execution.
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.
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.)
024383c7cfdcb1d06779c10949ab413c98a5983eMark Andrews# Location for the newly built classfiles.
f7e3edb15a73e285f34147b0092c63546c5dfbeaMark Andrews# Subdirectories of these are automatically included.
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.
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewsall: build-jar install-jar build-policy install-limited
362a13ce42fcebc41a092d8da4642d360e85eb12Mark Andrewselse # OPENJDK
f6e45a5c54b7af4b1c303e8d3ff3b7d78622df9eMark Andrewselse # FILES_java/policy files available
# Build the unsigned jce.jar file. Signing comes later.
# JDK: Even through the jce.jar was previously installed, since the
# infrastructure without modification: .classes.list, macros, etc.
# Build jce.jar, then replace the previously built JCE files in the
unlimited: \
limited: \
$(RM) -r \
$(CP) \
$(CP) \
# Install jce.jar, depending on which type is requested.
$(RM) \
$(RM) \
$(CP) \