Makefile revision 5482
15256N/A# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 14045N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10819N/A# This code is free software; you can redistribute it and/or modify it 10819N/A# under the terms of the GNU General Public License version 2 only, as 10819N/A# published by the Free Software Foundation. Oracle designates this 10819N/A# particular file as subject to the "Classpath" exception as provided 10828N/A# by Oracle in the LICENSE file that accompanied this code. 10819N/A# This code is distributed in the hope that it will be useful, but WITHOUT 10819N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10819N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 10819N/A# version 2 for more details (a copy is included in the LICENSE file that 15256N/A# You should have received a copy of the GNU General Public License version 15256N/A# 2 along with this work; if not, write to the Free Software Foundation, 14045N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 10828N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 10819N/A# Makefile for building jce.jar and the various cryptographic strength 14045N/A# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds 14045N/A# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE 10819N/A# jar files do not require signing, but those for JDK do. If an unsigned 10819N/A# jar file is installed into JDK, things will break when the crypto 10819N/A# This Makefile does the "real" build of the JCE files. There are some 10819N/A# javac options currently specific to JCE, so we recompile now to make 10819N/A# sure any implicit compilations didn't use any incorrect flags. 10819N/A# For OpenJDK, the jar files built here are installed directly into the 10819N/A# the closed workspace that are not shipped in the OpenJDK workspaces. 10819N/A# We still build the JDK files here to verify the files compile, and in 10819N/A# preparation for possible signing. Developers working on JCE in JDK 14045N/A# must sign the JCE files before testing. The JCE signing key is kept 10819N/A# separate from the JDK workspace to prevent its disclosure. 14045N/A# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually 12239N/A# be built and signed, and the resulting jar files *MUST BE CHECKED INTO 12239N/A# THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT BE 12239N/A# FORGOTTEN*, otherwise a bug fixed in the source code will not be 12239N/A# reflected in the shipped binaries. The "release" target should be 12239N/A# used to generate the required files. 12239N/A# If JDK: builds but does not install. 12239N/A# limited policy files are copied 12239N/A# If you are working in this directory 12239N/A# and want to install the prebuilts, 12239N/A# use the "install-prebuilt" target. 10819N/A# install-jar Alias for "jar" above 10819N/A# sign Alias for sign-jar and sign-policy 10819N/A# release Builds all targets in preparation 10819N/A# install-prebuilt Installs the pre-built jar files 10819N/A# This makefile was written to support parallel target execution. 10819N/A# The following is for when we need to do postprocessing 10819N/A# (signing) against a read-only build. If the OUTPUTDIR 10819N/A# isn't writable, the build currently crashes out. 10819N/A # ===================================================== 10819N/A # Where to place the output, in case we're building from a read-only 10819N/A # build area. (e.g. a release engineering build.) 10819N/A# Location for the newly built classfiles. 10819N/A# Subdirectories of these are automatically included. 12752N/A# Some licensees do not get the security sources, but we still need to 10819N/A# be able to build "all" for them. Check here to see if the sources were 10819N/A# available. If not, then we don't need to continue this rule. 10819N/A# We use a variety of subdirectories in the $(TEMPDIR) depending on what 10819N/A# done in the unsigned area. When files are signed in JDK, they will be 10819N/A# placed in the appropriate areas. 10819N/A# ===================================================== 10819N/A# JCE building is somewhat involved. 10819N/A# OpenJDK: Since we do not ship prebuilt JCE files, previous compiles 10819N/A# in the build may have needed JCE class signatures. There were then 10819N/A# implicitly built by javac (likely using the boot javac). While using 10819N/A# those class files was fine for signatures, we need to rebuild using 10819N/A# JDK: Even through the jce.jar was previously installed, since the 10819N/A# source files are accessible in the source directories, they will 10819N/A# always be "newer" than the prebuilt files inside the jar, and thus 10819N/A# make will always rebuild them. (We could "hide" the JCE source in a 10819N/A# separate directory, but that would make the build logic for JDK and 10819N/A# Thus in either situation, we shouldn't use these files. 10819N/A# To make sure the classes were built with the right compiler options, 10819N/A# delete the existing files in $(CLASSBINDIR), rebuild the right way in a 10819N/A# directory under $(TEMPDIR), then copy the files back to 10819N/A# $(CLASSBINDIR). Building in $(TEMPDIR) allows us to use our make 10819N/A# The list of directories that will be remade from scratch, using the 10819N/A# Since the -C option to jar is used below, each directory entry must be 10819N/A# preceded with the appropriate directory to "cd" into. 10819N/A# Build jce.jar, then replace the previously built JCE files in the 10819N/A# classes directory with these. This ensures we have consistently built 10819N/A# files throughout the workspaces. 10819N/A# ===================================================== 10819N/A# Build the unsigned policy files. 10819N/A# these settings work for Sun's situation. This note is not 10819N/A# Build the unsigned unlimited policy files. 10819N/A# Build the unsigned limited policy files. 10819N/A# NOTE: We currently do not place restrictions on our limited export 10819N/A# ===================================================== 10819N/A# Sign the various jar files. Not needed for OpenJDK. 10819N/A# We have to remove the build dependency, otherwise, we'll try to rebuild it 10819N/A# which we can't do on a read-only filesystem. 10819N/A# ===================================================== 10819N/A# Create the Release Engineering files. Signed builds, 10819N/A# unlimited policy file distribution, etc. 10819N/A# ===================================================== 10819N/A# Install the appropriate policy file, depending on the type of build. 10819N/A @
$(ECHO) "\n>>>Installing prebuilt JCE framework..." 10819N/A# =====================================================