author | wetmore |
Sun, 06 Apr 2008 10:15:03 -0700 | |
changeset 300 | d4f77ff718fd |
parent 2 | 90ce3da70b43 |
child 916 | 867515b155b5 |
permissions | -rw-r--r-- |
2 | 1 |
# |
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
2 |
# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
# |
|
25 |
||
26 |
# |
|
27 |
# Makefile for building sunmscapi.jar and native libraries. |
|
28 |
# |
|
29 |
# This file was derived from make/com/sun/crypto/provider/Makefile. |
|
30 |
# |
|
31 |
||
32 |
# |
|
33 |
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds |
|
34 |
# respectively.) |
|
35 |
# |
|
36 |
# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE |
|
37 |
# jar files do not require signing, but those for JDK do. If an unsigned |
|
38 |
# jar file is installed into JDK, things will break when the crypto |
|
39 |
# routines are called. |
|
40 |
# |
|
41 |
# This Makefile does the "real" build of the JCE files. For OpenJDK, |
|
42 |
# the jar files built here are installed directly into the OpenJDK. |
|
43 |
# |
|
44 |
# For JDK, the binaries use pre-built/pre-signed binary files stored in |
|
45 |
# the closed workspace that are not shipped in the OpenJDK workspaces. |
|
46 |
# We still build the JDK files here to verify the files compile, and in |
|
47 |
# preparation for possible signing. Developers working on JCE in JDK |
|
48 |
# must sign the JCE files before testing. The JCE signing key is kept |
|
49 |
# separate from the JDK workspace to prevent its disclosure. |
|
50 |
# |
|
51 |
# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually |
|
52 |
# be built, signed, and then the resulting jar files MUST BE CHECKED |
|
53 |
# INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT |
|
54 |
# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be |
|
55 |
# reflected in the shipped binaries. The "release" target should be |
|
56 |
# used to generate the required files. |
|
57 |
# |
|
58 |
# There are a number of targets to help both JDK/OpenJDK developers. |
|
59 |
# |
|
60 |
# Main Targets (JDK/OPENJDK): |
|
61 |
# |
|
62 |
# all/clobber/clean The usual, plus the native libraries. |
|
63 |
# If OpenJDK, installs sunmscapi.jar. |
|
64 |
# If JDK, installs prebuilt |
|
65 |
# sunmscapi.jar. |
|
66 |
# |
|
67 |
# jar Builds/installs sunmscapi.jar |
|
68 |
# If OpenJDK, does not sign. |
|
69 |
# If JDK, tries to sign. |
|
70 |
# |
|
71 |
# Other lesser-used Targets (JDK/OPENJDK): |
|
72 |
# |
|
73 |
# build-jar Builds sunmscapi.jar |
|
74 |
# (does not sign/install) |
|
75 |
# |
|
76 |
# install-jar Alias for "jar" above. |
|
77 |
# |
|
78 |
# Other targets (JDK only): |
|
79 |
# |
|
80 |
# sign Alias for sign-jar |
|
81 |
# sign-jar Builds/signs sunmscapi.jar (no install) |
|
82 |
# |
|
83 |
# release Builds all targets in preparation |
|
84 |
# for workspace integration. |
|
85 |
# |
|
86 |
# install-prebuilt Installs the pre-built jar files |
|
87 |
# |
|
88 |
# This makefile was written to support parallel target execution. |
|
89 |
# |
|
90 |
||
91 |
BUILDDIR = ../../.. |
|
92 |
PACKAGE = sun.security.mscapi |
|
93 |
LIBRARY = sunmscapi |
|
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 |
|
2 | 113 |
include $(BUILDDIR)/common/Defs.gmk |
114 |
||
115 |
CPLUSPLUSLIBRARY=true |
|
116 |
||
117 |
# |
|
118 |
# C++ and Java Files |
|
119 |
# |
|
120 |
include FILES_cpp.gmk |
|
121 |
||
122 |
AUTO_FILES_JAVA_DIRS = sun/security/mscapi |
|
123 |
||
124 |
# |
|
125 |
# Java files that define native methods |
|
126 |
# |
|
127 |
FILES_export = \ |
|
128 |
sun/security/mscapi/KeyStore.java \ |
|
129 |
sun/security/mscapi/Key.java \ |
|
130 |
sun/security/mscapi/PRNG.java \ |
|
131 |
sun/security/mscapi/RSACipher.java \ |
|
132 |
sun/security/mscapi/RSAPublicKey.java \ |
|
133 |
sun/security/mscapi/RSASignature.java \ |
|
134 |
sun/security/mscapi/RSAKeyPairGenerator.java |
|
135 |
||
136 |
# |
|
137 |
# Find native code |
|
138 |
# |
|
139 |
vpath %.cpp \ |
|
140 |
$(PLATFORM_SRC)/native/sun/security/mscapi |
|
141 |
||
142 |
# |
|
143 |
# Find include files |
|
144 |
# |
|
145 |
OTHER_INCLUDES += \ |
|
146 |
-I$(PLATFORM_SRC)/native/sun/security/mscapi |
|
147 |
||
148 |
# |
|
149 |
# Rules |
|
150 |
# |
|
151 |
CLASSDESTDIR = $(TEMPDIR)/classes |
|
152 |
||
153 |
include $(BUILDDIR)/common/Mapfile-vers.gmk |
|
154 |
||
155 |
include $(BUILDDIR)/common/Library.gmk |
|
156 |
||
157 |
# |
|
158 |
# Libraries to link |
|
159 |
# |
|
160 |
ifeq ($(PLATFORM), windows) |
|
161 |
OTHER_LDLIBS += $(JVMLIB) Crypt32.Lib |
|
162 |
endif |
|
163 |
||
164 |
# |
|
165 |
# We use a variety of subdirectories in the $(TEMPDIR) depending on what |
|
166 |
# part of the build we're doing. Both OPENJDK/JDK builds are initially |
|
167 |
# done in the unsigned area. When files are signed in JDK, |
|
168 |
# they will be placed in the appropriate area. |
|
169 |
# |
|
170 |
UNSIGNED_DIR = $(TEMPDIR)/unsigned |
|
171 |
||
172 |
# |
|
173 |
# Rules |
|
174 |
# |
|
175 |
||
176 |
ifdef OPENJDK |
|
177 |
all: build-jar install-jar |
|
178 |
else |
|
179 |
all: build-jar install-prebuilt |
|
180 |
$(build-warning) |
|
181 |
endif |
|
182 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
183 |
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
|
184 |
|
2 | 185 |
|
186 |
# ===================================================== |
|
187 |
# Build the unsigned sunmscapi.jar file. |
|
188 |
# |
|
189 |
||
190 |
JAR_DESTFILE = $(EXTDIR)/sunmscapi.jar |
|
191 |
||
192 |
# |
|
193 |
# The sunmscapi.jar needs to be in the extension class directory, |
|
194 |
# therefore none of its classes can appear in $(CLASSBINDIR). |
|
195 |
# Currently no one is using any of the MSCAPI internals, so these files |
|
196 |
# should not have been built. |
|
197 |
# |
|
198 |
||
199 |
# |
|
200 |
# Since the -C option to jar is used below, each directory entry must be |
|
201 |
# preceded with the appropriate directory to "cd" into. |
|
202 |
# |
|
203 |
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS)) |
|
204 |
||
205 |
build-jar: $(UNSIGNED_DIR)/sunmscapi.jar |
|
206 |
||
207 |
# |
|
208 |
# Build sunmscapi.jar. |
|
209 |
# |
|
210 |
$(UNSIGNED_DIR)/sunmscapi.jar: build |
|
211 |
$(prep-target) |
|
212 |
$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \ |
|
213 |
$(JAR_JFLAGS) |
|
214 |
@$(java-vm-cleanup) |
|
215 |
||
216 |
||
217 |
ifndef OPENJDK |
|
218 |
# ===================================================== |
|
219 |
# Sign the provider jar file. Not needed for OpenJDK. |
|
220 |
# |
|
221 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
222 |
SIGNED_DIR = $(JCE_BUILD_DIR)/signed |
2 | 223 |
|
224 |
sign: sign-jar |
|
225 |
||
226 |
sign-jar: $(SIGNED_DIR)/sunmscapi.jar |
|
227 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
228 |
ifndef ALT_JCE_BUILD_DIR |
2 | 229 |
$(SIGNED_DIR)/sunmscapi.jar: $(UNSIGNED_DIR)/sunmscapi.jar |
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
230 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
231 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
232 |
# 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
|
233 |
# 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
|
234 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
235 |
$(SIGNED_DIR)/sunmscapi.jar: |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
236 |
@if [ ! -r $(UNSIGNED_DIR)/sunmscapi.jar ] ; then \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
237 |
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunmscapi.jar"; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
238 |
exit 1; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
239 |
fi |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
240 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
241 |
$(call sign-file, $(UNSIGNED_DIR)/sunmscapi.jar) |
2 | 242 |
|
243 |
||
244 |
# ===================================================== |
|
245 |
# Create the Release Engineering files. Signed builds, etc. |
|
246 |
# |
|
247 |
||
248 |
release: $(SIGNED_DIR)/sunmscapi.jar |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
249 |
$(RM) $(JCE_BUILD_DIR)/release/sunmscapi.jar |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
250 |
$(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
|
251 |
$(CP) $(SIGNED_DIR)/sunmscapi.jar $(JCE_BUILD_DIR)/release |
2 | 252 |
$(release-warning) |
253 |
||
254 |
endif # OPENJDK |
|
255 |
||
256 |
||
257 |
# ===================================================== |
|
258 |
# Install routines. |
|
259 |
# |
|
260 |
||
261 |
# |
|
262 |
# Install sunmscapi.jar, depending on which type is requested. |
|
263 |
# |
|
264 |
install-jar jar: $(JAR_DESTFILE) |
|
265 |
ifndef OPENJDK |
|
266 |
$(release-warning) |
|
267 |
endif |
|
268 |
||
269 |
ifdef OPENJDK |
|
270 |
$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunmscapi.jar |
|
271 |
else |
|
272 |
$(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar |
|
273 |
endif |
|
274 |
$(install-file) |
|
275 |
||
276 |
ifndef OPENJDK |
|
277 |
install-prebuilt: |
|
278 |
@$(ECHO) "\n>>>Installing prebuilt SunMSCAPI provider..." |
|
279 |
$(RM) $(JAR_DESTFILE) |
|
280 |
$(CP) $(PREBUILT_DIR)/mscapi/sunmscapi.jar $(JAR_DESTFILE) |
|
281 |
endif |
|
282 |
||
283 |
||
284 |
# ===================================================== |
|
285 |
# Support routines. |
|
286 |
# |
|
287 |
||
288 |
clobber clean:: |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
289 |
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR) |
2 | 290 |
|
291 |
.PHONY: build-jar jar install-jar |
|
292 |
ifndef OPENJDK |
|
293 |
.PHONY: sign sign-jar release install-prebuilt |
|
294 |
endif |