author | ohair |
Wed, 06 Aug 2008 15:02:15 -0700 | |
changeset 916 | 867515b155b5 |
parent 300 | d4f77ff718fd |
child 3332 | b9c68d909f98 |
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 2007-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 jce.jar and the various cryptographic strength |
|
28 |
# policy jar files. |
|
29 |
# |
|
30 |
||
31 |
# |
|
32 |
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds |
|
33 |
# respectively.) |
|
34 |
# |
|
35 |
# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE |
|
36 |
# jar files do not require signing, but those for JDK do. If an unsigned |
|
37 |
# jar file is installed into JDK, things will break when the crypto |
|
38 |
# routines are called. |
|
39 |
# |
|
40 |
# This Makefile does the "real" build of the JCE files. There are some |
|
41 |
# javac options currently specific to JCE, so we recompile now to make |
|
42 |
# sure any implicit compilations didn't use any incorrect flags. |
|
43 |
# |
|
44 |
# For OpenJDK, the jar files built here are installed directly into the |
|
45 |
# OpenJDK. |
|
46 |
# |
|
47 |
# For JDK, the binaries use pre-built/pre-signed/pre-obfuscated binary |
|
48 |
# files stored in the closed workspace that are not shipped in the |
|
49 |
# OpenJDK workspaces. We still build the JDK files here to verify the |
|
50 |
# files compile, and in preparation for possible signing and |
|
51 |
# obfuscation. Developers working on JCE in JDK must sign the JCE files |
|
52 |
# before testing: obfuscation is optional during development. The JCE |
|
53 |
# signing key is kept separate from the JDK workspace to prevent its |
|
54 |
# disclosure. The obfuscation tool has not been licensed for general |
|
55 |
# usage. |
|
56 |
# |
|
57 |
# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually |
|
58 |
# be built, obfuscated, signed, and the resulting jar files *MUST BE |
|
59 |
# CHECKED INTO THE CLOSED PART OF THE WORKSPACE*. This separate step |
|
60 |
# *MUST NOT BE FORGOTTEN*, otherwise a bug fixed in the source code will |
|
61 |
# not be reflected in the shipped binaries. The "release" target should |
|
62 |
# be used to generate the required files. |
|
63 |
# |
|
64 |
# There are a number of targets to help both JDK/OpenJDK developers. |
|
65 |
# |
|
66 |
# Main Targets (JDK/OPENJDK): |
|
67 |
# |
|
68 |
# all/clobber/clean The usual. |
|
69 |
# If OpenJDK, installs |
|
70 |
# jce.jar/limited policy files. |
|
71 |
# If JDK, installs prebuilt |
|
72 |
# jce.jar/limited policy files. |
|
73 |
# |
|
74 |
# jar Builds/installs jce.jar |
|
75 |
# If OpenJDK, does not sign |
|
76 |
# If JDK, tries to sign |
|
77 |
# |
|
78 |
# Other lesser-used Targets (JDK/OPENJDK): |
|
79 |
# |
|
80 |
# build-jar Builds jce.jar (does not sign/install) |
|
81 |
# |
|
82 |
# build-policy Builds policy files (does not sign/install) |
|
83 |
# |
|
84 |
# install-jar Alias for "jar" above |
|
85 |
# |
|
86 |
# install-limited Builds/installs limited policy files |
|
87 |
# If OpenJDK, does not sign |
|
88 |
# If JDK, tries to sign |
|
89 |
# install-unlimited Builds/nstalls unlimited policy files |
|
90 |
# If OpenJDK, does not sign |
|
91 |
# If JDK, tries to sign |
|
92 |
# |
|
93 |
# Other targets (JDK only): |
|
94 |
# |
|
95 |
# sign Alias for sign-jar and sign-policy |
|
96 |
# sign-jar Builds/signs jce.jar file (no install) |
|
97 |
# sign-policy Builds/signs policy files (no install) |
|
98 |
# |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
99 |
# obfus Builds/obfuscates/signs jce.jar |
2 | 100 |
# |
101 |
# release Builds all targets in preparation |
|
102 |
# for workspace integration. |
|
103 |
# |
|
104 |
# install-prebuilt Installs the pre-built jar files |
|
105 |
# |
|
106 |
# This makefile was written to support parallel target execution. |
|
107 |
# |
|
108 |
||
109 |
BUILDDIR = ../.. |
|
110 |
PACKAGE = javax.crypto |
|
111 |
PRODUCT = sun |
|
112 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
113 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
114 |
# 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
|
115 |
# (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
|
116 |
# 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
|
117 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
118 |
ifndef OPENJDK |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
119 |
ifdef ALT_JCE_BUILD_DIR |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
120 |
# ===================================================== |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
121 |
# 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
|
122 |
# 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
|
123 |
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
|
124 |
IGNORE_WRITABLE_OUTPUTDIR_TEST=true |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
125 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
126 |
JCE_BUILD_DIR=${TEMPDIR} |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
127 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
128 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
129 |
|
2 | 130 |
include $(BUILDDIR)/common/Defs.gmk |
131 |
||
132 |
# |
|
133 |
# Location for the newly built classfiles. |
|
134 |
# |
|
135 |
CLASSDESTDIR = $(TEMPDIR)/classes |
|
136 |
||
137 |
# |
|
138 |
# Subdirectories of these are automatically included. |
|
139 |
# |
|
140 |
AUTO_FILES_JAVA_DIRS = \ |
|
141 |
javax/crypto \ |
|
142 |
sun/security/internal/interfaces \ |
|
143 |
sun/security/internal/spec |
|
144 |
||
145 |
include $(BUILDDIR)/common/Classes.gmk |
|
146 |
||
147 |
# |
|
148 |
# Rules |
|
149 |
# |
|
150 |
||
151 |
# |
|
152 |
# Some licensees do not get the security sources, but we still need to |
|
153 |
# be able to build "all" for them. Check here to see if the sources were |
|
154 |
# available. If not, then we don't need to continue this rule. |
|
155 |
# |
|
156 |
||
157 |
ifdef OPENJDK |
|
158 |
all: build-jar install-jar build-policy install-limited |
|
159 |
else # OPENJDK |
|
160 |
ifeq ($(strip $(FILES_java)),) |
|
161 |
all: |
|
162 |
$(no-source-warning) |
|
163 |
else # FILES_java/policy files available |
|
164 |
all: build-jar build-policy |
|
165 |
$(build-warning) |
|
166 |
endif # $(FILES_java)/policy files available |
|
167 |
endif # OPENJDK |
|
168 |
||
169 |
# |
|
170 |
# We use a variety of subdirectories in the $(TEMPDIR) depending on what |
|
171 |
# part of the build we're doing. Both OPENJDK/JDK builds are initially |
|
172 |
# done in the unsigned area. When files are signed or obfuscated in JDK, |
|
173 |
# they will be placed in the appropriate areas. |
|
174 |
# |
|
175 |
UNSIGNED_DIR = $(TEMPDIR)/unsigned |
|
176 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
177 |
include Defs-jce.gmk |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
178 |
|
2 | 179 |
|
180 |
# ===================================================== |
|
181 |
# Build the unsigned jce.jar file. Signing/obfuscation comes later. |
|
182 |
# |
|
183 |
||
184 |
JAR_DESTFILE = $(LIBDIR)/jce.jar |
|
185 |
||
186 |
# |
|
187 |
# JCE building is somewhat involved. |
|
188 |
# |
|
189 |
# OpenJDK: Since we do not ship prebuilt JCE files, previous compiles |
|
190 |
# in the build may have needed JCE class signatures. There were then |
|
191 |
# implicitly built by javac (likely using the boot javac). While using |
|
192 |
# those class files was fine for signatures, we need to rebuild using |
|
193 |
# the right compiler. |
|
194 |
# |
|
195 |
# JDK: Even through the jce.jar was previously installed, since the |
|
196 |
# source files are accessible in the source directories, they will |
|
197 |
# always be "newer" than the prebuilt files inside the jar, and thus |
|
198 |
# make will always rebuild them. (We could "hide" the JCE source in a |
|
199 |
# separate directory, but that would make the build logic for JDK and |
|
200 |
# OpenJDK more complicated.) |
|
201 |
# |
|
202 |
# Thus in either situation, we shouldn't use these files. |
|
203 |
# |
|
204 |
# To make sure the classes were built with the right compiler options, |
|
205 |
# delete the existing files in $(CLASSBINDIR), rebuild the right way in a |
|
206 |
# directory under $(TEMPDIR), then copy the files back to |
|
207 |
# $(CLASSBINDIR). Building in $(TEMPDIR) allows us to use our make |
|
208 |
# infrastructure without modification: .classes.list, macros, etc. |
|
209 |
# |
|
210 |
||
211 |
# |
|
212 |
# The list of directories that will be remade from scratch, using the |
|
213 |
# right compilers/options. |
|
214 |
# |
|
215 |
DELETE_DIRS = $(patsubst %, $(CLASSBINDIR)/%, $(AUTO_FILES_JAVA_DIRS)) |
|
216 |
||
217 |
# |
|
218 |
# Since the -C option to jar is used below, each directory entry must be |
|
219 |
# preceded with the appropriate directory to "cd" into. |
|
220 |
# |
|
221 |
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS)) |
|
222 |
||
223 |
build-jar: $(UNSIGNED_DIR)/jce.jar |
|
224 |
||
225 |
# |
|
226 |
# Build jce.jar, then replace the previously built JCE files in the |
|
227 |
# classes directory with these. This ensures we have consistently built |
|
228 |
# files throughout the workspaces. |
|
229 |
# |
|
230 |
$(UNSIGNED_DIR)/jce.jar: prebuild build $(JCE_MANIFEST_FILE) |
|
231 |
$(prep-target) |
|
232 |
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
233 |
$(BOOT_JAR_JFLAGS) |
2 | 234 |
$(CP) -r $(CLASSDESTDIR)/* $(CLASSBINDIR) |
235 |
@$(java-vm-cleanup) |
|
236 |
||
237 |
build: prebuild |
|
238 |
||
239 |
prebuild: |
|
240 |
$(RM) -r $(DELETE_DIRS) |
|
241 |
||
242 |
||
243 |
# ===================================================== |
|
244 |
# Build the unsigned policy files. |
|
245 |
# |
|
246 |
# Given the current state of world export/import policies, |
|
247 |
# these settings work for Sun's situation. This note is not |
|
248 |
# legal guidance, you must still resolve any export/import issues |
|
249 |
# applicable for your situation. Contact your export/import |
|
250 |
# counsel for more information. |
|
251 |
# |
|
252 |
||
253 |
POLICY_DESTDIR = $(LIBDIR)/security |
|
254 |
UNSIGNED_POLICY_BUILDDIR = $(UNSIGNED_DIR)/policy |
|
255 |
||
256 |
build-policy: unlimited limited |
|
257 |
||
258 |
# |
|
259 |
# Build the unsigned unlimited policy files. |
|
260 |
# |
|
261 |
unlimited: \ |
|
262 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \ |
|
263 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar |
|
264 |
||
265 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \ |
|
266 |
policy/unlimited/default_US_export.policy \ |
|
267 |
policy/unlimited/UNLIMITED |
|
268 |
$(prep-target) |
|
269 |
$(BOOT_JAR_CMD) cmf policy/unlimited/UNLIMITED $@ \ |
|
270 |
-C policy/unlimited default_US_export.policy \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
271 |
$(BOOT_JAR_JFLAGS) |
2 | 272 |
@$(java-vm-cleanup) |
273 |
||
274 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \ |
|
275 |
policy/unlimited/default_local.policy \ |
|
276 |
policy/unlimited/UNLIMITED |
|
277 |
$(prep-target) |
|
278 |
$(BOOT_JAR_CMD) cmf policy/unlimited/UNLIMITED $@ \ |
|
279 |
-C policy/unlimited default_local.policy \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
280 |
$(BOOT_JAR_JFLAGS) |
2 | 281 |
@$(java-vm-cleanup) |
282 |
||
283 |
# |
|
284 |
# Build the unsigned limited policy files. |
|
285 |
# |
|
286 |
# NOTE: We currently do not place restrictions on our limited export |
|
287 |
# policy. This was not a typo. |
|
288 |
# |
|
289 |
limited: \ |
|
290 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \ |
|
291 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar |
|
292 |
||
293 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \ |
|
294 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar |
|
295 |
$(install-file) |
|
296 |
||
297 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \ |
|
298 |
policy/limited/default_local.policy \ |
|
299 |
policy/limited/exempt_local.policy \ |
|
300 |
policy/limited/LIMITED |
|
301 |
$(prep-target) |
|
302 |
$(BOOT_JAR_CMD) cmf policy/limited/LIMITED $@ \ |
|
303 |
-C policy/limited default_local.policy \ |
|
304 |
-C policy/limited exempt_local.policy \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
305 |
$(BOOT_JAR_JFLAGS) |
2 | 306 |
@$(java-vm-cleanup) |
307 |
||
308 |
UNSIGNED_POLICY_FILES = \ |
|
309 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \ |
|
310 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \ |
|
311 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \ |
|
312 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \ |
|
313 |
||
314 |
||
315 |
ifndef OPENJDK |
|
316 |
# ===================================================== |
|
317 |
# Sign the various jar files. Not needed for OpenJDK. |
|
318 |
# |
|
319 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
320 |
SIGNED_DIR = $(JCE_BUILD_DIR)/signed |
2 | 321 |
SIGNED_POLICY_BUILDDIR = $(SIGNED_DIR)/policy |
322 |
||
323 |
SIGNED_POLICY_FILES = \ |
|
324 |
$(patsubst $(UNSIGNED_POLICY_BUILDDIR)/%,$(SIGNED_POLICY_BUILDDIR)/%, \ |
|
325 |
$(UNSIGNED_POLICY_FILES)) |
|
326 |
||
327 |
sign: sign-jar sign-policy |
|
328 |
||
329 |
sign-jar: $(SIGNED_DIR)/jce.jar |
|
330 |
||
331 |
sign-policy: $(SIGNED_POLICY_FILES) |
|
332 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
333 |
ifndef ALT_JCE_BUILD_DIR |
2 | 334 |
$(SIGNED_DIR)/jce.jar: $(UNSIGNED_DIR)/jce.jar |
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
335 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
336 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
337 |
# 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
|
338 |
# 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
|
339 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
340 |
$(SIGNED_DIR)/jce.jar: |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
341 |
@if [ ! -r $(UNSIGNED_DIR)/jce.jar ] ; then \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
342 |
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/jce.jar"; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
343 |
exit 1; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
344 |
fi |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
345 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
346 |
$(call sign-file, $(UNSIGNED_DIR)/jce.jar) |
2 | 347 |
|
348 |
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
349 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
350 |
$(call sign-file, $<) |
2 | 351 |
|
352 |
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
353 |
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
354 |
$(call sign-file, $<) |
2 | 355 |
|
356 |
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
357 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
358 |
$(call sign-file, $<) |
2 | 359 |
|
360 |
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
361 |
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
362 |
$(call sign-file, $<) |
2 | 363 |
|
364 |
||
365 |
# ===================================================== |
|
366 |
# Obfuscate/sign/install the JDK build. Not needed for OpenJDK. |
|
367 |
# |
|
368 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
369 |
OBFUS_DIR = $(JCE_BUILD_DIR)/obfus/jce |
2 | 370 |
|
371 |
CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto |
|
372 |
||
373 |
obfus: $(OBFUS_DIR)/jce.jar |
|
374 |
$(release-warning) |
|
375 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
376 |
ifndef ALT_JCE_BUILD_DIR |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
377 |
$(OBFUS_DIR)/jce.jar: build-jar $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
378 |
else |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
379 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
380 |
# 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
|
381 |
# 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
|
382 |
# |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
383 |
$(OBFUS_DIR)/jce.jar: $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
384 |
@if [ ! -d $(CLASSDESTDIR) ] ; then \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
385 |
$(ECHO) "Couldn't find $(CLASSDESTDIR)"; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
386 |
exit 1; \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
387 |
fi |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
388 |
endif |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
389 |
@$(ECHO) ">>>Obfuscating JCE framework..." |
2 | 390 |
$(presign) |
391 |
$(preobfus) |
|
392 |
$(prep-target) |
|
393 |
$(CD) $(OBFUS_DIR); \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
394 |
$(OBFUSCATOR) -fv framework.dox |
2 | 395 |
@$(CD) $(OBFUS_DIR); $(java-vm-cleanup) |
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
396 |
@# |
2 | 397 |
@# The sun.security.internal classes are currently not obfuscated |
398 |
@# due to an obfus problem. Manually copy them to the build directory |
|
399 |
@# so that they are included in the jce.jar file. |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
400 |
@# |
2 | 401 |
$(CP) -r $(CLASSDESTDIR)/sun $(OBFUS_DIR)/build |
402 |
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \ |
|
403 |
-C $(OBFUS_DIR)/build javax \ |
|
404 |
-C $(OBFUS_DIR)/build sun \ |
|
916
867515b155b5
6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents:
300
diff
changeset
|
405 |
$(BOOT_JAR_JFLAGS) |
2 | 406 |
$(sign-target) |
407 |
@$(java-vm-cleanup) |
|
408 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
409 |
$(OBFUS_DIR)/framework.dox: $(CLOSED_DIR)/obfus/framework.dox |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
410 |
@$(ECHO) ">>>Creating framework.dox" |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
411 |
$(prep-target) |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
412 |
$(SED) "s:@@TEMPDIR@@:$(ABS_TEMPDIR):" $< > $@ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
413 |
|
2 | 414 |
# |
415 |
# The current obfuscator has a limitation in that it currently only |
|
416 |
# supports up to v49 class file format. Force v49 classfiles in our |
|
417 |
# builds for now. |
|
418 |
# |
|
419 |
TARGET_CLASS_VERSION = 5 |
|
420 |
||
421 |
||
422 |
# ===================================================== |
|
423 |
# Create the Release Engineering files. Obfuscated builds, |
|
424 |
# unlimited policy file distribution, etc. |
|
425 |
# |
|
426 |
||
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
427 |
release: $(OBFUS_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
428 |
$(CLOSED_DIR)/doc/README.txt |
2 | 429 |
$(RM) -r \ |
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
430 |
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
431 |
$(JCE_BUILD_DIR)/release/jce.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
432 |
$(JCE_BUILD_DIR)/release/US_export_policy.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
433 |
$(JCE_BUILD_DIR)/release/local_policy.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
434 |
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy.zip |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
435 |
$(MKDIR) -p $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
436 |
$(CP) $(OBFUS_DIR)/jce.jar $(JCE_BUILD_DIR)/release |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
437 |
$(CP) \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
438 |
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
439 |
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
440 |
$(JCE_BUILD_DIR)/release |
2 | 441 |
$(CP) \ |
442 |
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
443 |
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
444 |
$(CLOSED_DIR)/doc/COPYRIGHT.html \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
445 |
$(CLOSED_DIR)/doc/README.txt \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
446 |
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
447 |
cd $(JCE_BUILD_DIR)/release ; \ |
2 | 448 |
$(ZIPEXE) -qr UnlimitedJCEPolicy.zip UnlimitedJCEPolicy |
449 |
$(release-warning) |
|
450 |
||
451 |
endif # OPENJDK |
|
452 |
||
453 |
||
454 |
# ===================================================== |
|
455 |
# Install routines. |
|
456 |
# |
|
457 |
||
458 |
# |
|
459 |
# Install jce.jar, depending on which type is requested. |
|
460 |
# |
|
461 |
install-jar jar: $(JAR_DESTFILE) |
|
462 |
ifndef OPENJDK |
|
463 |
$(release-warning) |
|
464 |
endif |
|
465 |
||
466 |
ifdef OPENJDK |
|
467 |
$(JAR_DESTFILE): $(UNSIGNED_DIR)/jce.jar |
|
468 |
else |
|
469 |
$(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar |
|
470 |
endif |
|
471 |
$(install-file) |
|
472 |
||
473 |
# |
|
474 |
# Install the appropriate policy file, depending on the type of build. |
|
475 |
# |
|
476 |
ifdef OPENJDK |
|
477 |
INSTALL_POLICYDIR = $(UNSIGNED_POLICY_BUILDDIR) |
|
478 |
else |
|
479 |
INSTALL_POLICYDIR = $(SIGNED_POLICY_BUILDDIR) |
|
480 |
endif |
|
481 |
||
482 |
install-limited: \ |
|
483 |
$(INSTALL_POLICYDIR)/limited/US_export_policy.jar \ |
|
484 |
$(INSTALL_POLICYDIR)/limited/local_policy.jar |
|
485 |
$(MKDIR) -p $(POLICY_DESTDIR) |
|
486 |
$(RM) \ |
|
487 |
$(POLICY_DESTDIR)/US_export_policy.jar \ |
|
488 |
$(POLICY_DESTDIR)/local_policy.jar |
|
489 |
$(CP) $^ $(POLICY_DESTDIR) |
|
490 |
ifndef OPENJDK |
|
491 |
$(release-warning) |
|
492 |
endif |
|
493 |
||
494 |
install-unlimited: \ |
|
495 |
$(INSTALL_POLICYDIR)/unlimited/US_export_policy.jar \ |
|
496 |
$(INSTALL_POLICYDIR)/unlimited/local_policy.jar |
|
497 |
$(MKDIR) -p $(POLICY_DESTDIR) |
|
498 |
$(RM) \ |
|
499 |
$(POLICY_DESTDIR)/US_export_policy.jar \ |
|
500 |
$(POLICY_DESTDIR)/local_policy.jar |
|
501 |
$(CP) $^ $(POLICY_DESTDIR) |
|
502 |
ifndef OPENJDK |
|
503 |
$(release-warning) |
|
504 |
endif |
|
505 |
||
506 |
ifndef OPENJDK |
|
507 |
install-prebuilt: |
|
508 |
@$(ECHO) "\n>>>Installing prebuilt JCE framework..." |
|
509 |
$(RM) $(JAR_DESTFILE) \ |
|
510 |
$(POLICY_DESTDIR)/US_export_policy.jar \ |
|
511 |
$(POLICY_DESTDIR)/local_policy.jar |
|
512 |
$(CP) $(PREBUILT_DIR)/jce/jce.jar $(JAR_DESTFILE) |
|
513 |
$(CP) \ |
|
514 |
$(PREBUILT_DIR)/jce/US_export_policy.jar \ |
|
515 |
$(PREBUILT_DIR)/jce/local_policy.jar \ |
|
516 |
$(POLICY_DESTDIR) |
|
517 |
endif |
|
518 |
||
519 |
||
520 |
# ===================================================== |
|
521 |
# Support routines. |
|
522 |
# |
|
523 |
||
524 |
clobber clean:: |
|
525 |
$(RM) -r $(JAR_DESTFILE) $(POLICY_DESTDIR)/US_export_policy.jar \ |
|
300
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
526 |
$(POLICY_DESTDIR)/local_policy.jar $(DELETE_DIRS) $(TEMPDIR) \ |
d4f77ff718fd
6683078: Update JCE framework and provider builds to work on read-only filesystems
wetmore
parents:
2
diff
changeset
|
527 |
$(JCE_BUILD_DIR) |
2 | 528 |
|
529 |
.PHONY: build-jar jar build-policy unlimited limited install-jar \ |
|
530 |
install-limited install-unlimited |
|
531 |
ifndef OPENJDK |
|
532 |
.PHONY: sign sign-jar sign-policy obfus release install-prebuilt |
|
533 |
endif |