author | prr |
Tue, 29 Jun 2010 16:34:17 -0700 | |
changeset 5818 | 1f5b65b3624c |
parent 5506 | 202f599c92aa |
child 7668 | d4a77089c587 |
permissions | -rw-r--r-- |
2 | 1 |
# |
5506 | 2 |
# Copyright (c) 2005, 2009, Oracle and/or its affiliates. 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 |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 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 |
# |
|
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
62 |
# all/clobber/clean The usual, plus the native libraries. |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
63 |
# If OpenJDK, installs sunmscapi.jar. |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
64 |
# If JDK, installs prebuilt |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
65 |
# sunmscapi.jar. |
2 | 66 |
# |
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
67 |
# jar Builds/installs sunmscapi.jar |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
68 |
# If OpenJDK, does not sign. |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
69 |
# If JDK, tries to sign. |
2 | 70 |
# |
71 |
# Other lesser-used Targets (JDK/OPENJDK): |
|
72 |
# |
|
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
73 |
# build-jar Builds sunmscapi.jar |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
74 |
# (does not sign/install) |
2 | 75 |
# |
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
76 |
# install-jar Alias for "jar" above. |
2 | 77 |
# |
78 |
# Other targets (JDK only): |
|
79 |
# |
|
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
80 |
# sign Alias for sign-jar |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
81 |
# sign-jar Builds/signs sunmscapi.jar (no install) |
2 | 82 |
# |
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
83 |
# release Builds all targets in preparation |
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
84 |
# for workspace integration. |
2 | 85 |
# |
3353
ddbd63234844
6647452: Remove obfuscation, framework and provider self-verification checking
wetmore
parents:
916
diff
changeset
|
86 |
# install-prebuilt Installs the pre-built jar files |
2 | 87 |
# |
88 |
# This makefile was written to support parallel target execution. |
|
89 |
# |
|
90 |
||
91 |
BUILDDIR = ../../.. |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
3353
diff
changeset
|
92 |
MODULE = security-sunmscapi |
2 | 93 |
PACKAGE = sun.security.mscapi |
94 |
LIBRARY = sunmscapi |
|
95 |
PRODUCT = sun |
|
300
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 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
98 |
# 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
|
99 |
# (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
|
100 |
# 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
|
101 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
102 |
ifndef OPENJDK |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
103 |
ifdef ALT_JCE_BUILD_DIR |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
104 |
# ===================================================== |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
105 |
# 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
|
106 |
# 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
|
107 |
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
|
108 |
IGNORE_WRITABLE_OUTPUTDIR_TEST=true |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
109 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
110 |
JCE_BUILD_DIR=${TEMPDIR} |
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 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
113 |
|
2 | 114 |
include $(BUILDDIR)/common/Defs.gmk |
115 |
||
116 |
CPLUSPLUSLIBRARY=true |
|
117 |
||
118 |
# |
|
119 |
# C++ and Java Files |
|
120 |
# |
|
121 |
include FILES_cpp.gmk |
|
122 |
||
123 |
AUTO_FILES_JAVA_DIRS = sun/security/mscapi |
|
124 |
||
125 |
# |
|
126 |
# Java files that define native methods |
|
127 |
# |
|
128 |
FILES_export = \ |
|
129 |
sun/security/mscapi/KeyStore.java \ |
|
130 |
sun/security/mscapi/Key.java \ |
|
131 |
sun/security/mscapi/PRNG.java \ |
|
132 |
sun/security/mscapi/RSACipher.java \ |
|
133 |
sun/security/mscapi/RSAPublicKey.java \ |
|
134 |
sun/security/mscapi/RSASignature.java \ |
|
135 |
sun/security/mscapi/RSAKeyPairGenerator.java |
|
136 |
||
137 |
# |
|
138 |
# Find native code |
|
139 |
# |
|
140 |
vpath %.cpp \ |
|
141 |
$(PLATFORM_SRC)/native/sun/security/mscapi |
|
142 |
||
143 |
# |
|
144 |
# Find include files |
|
145 |
# |
|
146 |
OTHER_INCLUDES += \ |
|
147 |
-I$(PLATFORM_SRC)/native/sun/security/mscapi |
|
148 |
||
149 |
# |
|
150 |
# Rules |
|
151 |
# |
|
152 |
CLASSDESTDIR = $(TEMPDIR)/classes |
|
5818
1f5b65b3624c
6964882: 32 bit JDK does not build on 64 bit Windows platforms
prr
parents:
5506
diff
changeset
|
153 |
JAVAHFLAGS += -classpath $(CLASSDESTDIR) |
2 | 154 |
|
155 |
include $(BUILDDIR)/common/Mapfile-vers.gmk |
|
156 |
||
157 |
include $(BUILDDIR)/common/Library.gmk |
|
158 |
||
159 |
# |
|
160 |
# Libraries to link |
|
161 |
# |
|
162 |
ifeq ($(PLATFORM), windows) |
|
163 |
OTHER_LDLIBS += $(JVMLIB) Crypt32.Lib |
|
164 |
endif |
|
165 |
||
166 |
# |
|
167 |
# We use a variety of subdirectories in the $(TEMPDIR) depending on what |
|
168 |
# part of the build we're doing. Both OPENJDK/JDK builds are initially |
|
169 |
# done in the unsigned area. When files are signed in JDK, |
|
170 |
# they will be placed in the appropriate area. |
|
171 |
# |
|
172 |
UNSIGNED_DIR = $(TEMPDIR)/unsigned |
|
173 |
||
174 |
# |
|
175 |
# Rules |
|
176 |
# |
|
177 |
||
178 |
ifdef OPENJDK |
|
179 |
all: build-jar install-jar |
|
180 |
else |
|
181 |
all: build-jar install-prebuilt |
|
182 |
$(build-warning) |
|
183 |
endif |
|
184 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
185 |
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
|
186 |
|
2 | 187 |
|
188 |
# ===================================================== |
|
189 |
# Build the unsigned sunmscapi.jar file. |
|
190 |
# |
|
191 |
||
192 |
JAR_DESTFILE = $(EXTDIR)/sunmscapi.jar |
|
193 |
||
194 |
# |
|
195 |
# The sunmscapi.jar needs to be in the extension class directory, |
|
196 |
# therefore none of its classes can appear in $(CLASSBINDIR). |
|
197 |
# Currently no one is using any of the MSCAPI internals, so these files |
|
198 |
# should not have been built. |
|
199 |
# |
|
200 |
||
201 |
# |
|
202 |
# Since the -C option to jar is used below, each directory entry must be |
|
203 |
# preceded with the appropriate directory to "cd" into. |
|
204 |
# |
|
205 |
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS)) |
|
206 |
||
207 |
build-jar: $(UNSIGNED_DIR)/sunmscapi.jar |
|
208 |
||
209 |
# |
|
210 |
# Build sunmscapi.jar. |
|
211 |
# |
|
212 |
$(UNSIGNED_DIR)/sunmscapi.jar: build |
|
213 |
$(prep-target) |
|
214 |
$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
215 |
$(BOOT_JAR_JFLAGS) |
2 | 216 |
@$(java-vm-cleanup) |
217 |
||
218 |
||
219 |
ifndef OPENJDK |
|
220 |
# ===================================================== |
|
221 |
# Sign the provider jar file. Not needed for OpenJDK. |
|
222 |
# |
|
223 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
224 |
SIGNED_DIR = $(JCE_BUILD_DIR)/signed |
2 | 225 |
|
226 |
sign: sign-jar |
|
227 |
||
228 |
sign-jar: $(SIGNED_DIR)/sunmscapi.jar |
|
229 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
230 |
ifndef ALT_JCE_BUILD_DIR |
2 | 231 |
$(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
|
232 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
233 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
234 |
# 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
|
235 |
# 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
|
236 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
237 |
$(SIGNED_DIR)/sunmscapi.jar: |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
238 |
@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
|
239 |
$(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
|
240 |
exit 1; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
241 |
fi |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
242 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
243 |
$(call sign-file, $(UNSIGNED_DIR)/sunmscapi.jar) |
2 | 244 |
|
245 |
||
246 |
# ===================================================== |
|
247 |
# Create the Release Engineering files. Signed builds, etc. |
|
248 |
# |
|
249 |
||
250 |
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
|
251 |
$(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
|
252 |
$(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
|
253 |
$(CP) $(SIGNED_DIR)/sunmscapi.jar $(JCE_BUILD_DIR)/release |
2 | 254 |
$(release-warning) |
255 |
||
256 |
endif # OPENJDK |
|
257 |
||
258 |
||
259 |
# ===================================================== |
|
260 |
# Install routines. |
|
261 |
# |
|
262 |
||
263 |
# |
|
264 |
# Install sunmscapi.jar, depending on which type is requested. |
|
265 |
# |
|
266 |
install-jar jar: $(JAR_DESTFILE) |
|
267 |
ifndef OPENJDK |
|
268 |
$(release-warning) |
|
269 |
endif |
|
270 |
||
271 |
ifdef OPENJDK |
|
272 |
$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunmscapi.jar |
|
273 |
else |
|
274 |
$(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar |
|
275 |
endif |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
3353
diff
changeset
|
276 |
$(install-non-module-file) |
2 | 277 |
|
278 |
ifndef OPENJDK |
|
279 |
install-prebuilt: |
|
280 |
@$(ECHO) "\n>>>Installing prebuilt SunMSCAPI provider..." |
|
281 |
$(RM) $(JAR_DESTFILE) |
|
282 |
$(CP) $(PREBUILT_DIR)/mscapi/sunmscapi.jar $(JAR_DESTFILE) |
|
283 |
endif |
|
284 |
||
285 |
||
286 |
# ===================================================== |
|
287 |
# Support routines. |
|
288 |
# |
|
289 |
||
290 |
clobber clean:: |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
291 |
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR) |
2 | 292 |
|
293 |
.PHONY: build-jar jar install-jar |
|
294 |
ifndef OPENJDK |
|
295 |
.PHONY: sign sign-jar release install-prebuilt |
|
296 |
endif |