author | never |
Mon, 12 Jul 2010 22:27:18 -0700 | |
changeset 5926 | a36f90d986b6 |
parent 5506 | 202f599c92aa |
child 6681 | e721d11e4826 |
permissions | -rw-r--r-- |
2 | 1 |
# |
5506 | 2 |
# Copyright (c) 1995, 2007, 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 and packaging all of the JDK and the JRE. See |
|
28 |
# also included files. |
|
29 |
# |
|
30 |
||
31 |
BUILDDIR=. |
|
32 |
include $(BUILDDIR)/common/Defs.gmk |
|
33 |
||
34 |
# |
|
35 |
# Make sure we are clear what the default target is |
|
36 |
# |
|
37 |
default_target: all |
|
38 |
||
39 |
# |
|
40 |
# Check target |
|
41 |
# |
|
42 |
||
43 |
check: variable_check |
|
44 |
||
45 |
# |
|
46 |
# Help target |
|
47 |
# |
|
48 |
help: intro_help target_help variable_help notes_help examples_help |
|
49 |
||
50 |
# Intro help message |
|
51 |
intro_help: |
|
52 |
@$(ECHO) "\ |
|
53 |
Makefile for the main JDK workspace. \n\ |
|
54 |
Default behavior is to use the BOOTDIR javac to bootstrap the build and \n\ |
|
55 |
import in pre-built components like the VM from the JDK_IMPORT_PATH. \n\ |
|
56 |
" |
|
57 |
||
58 |
# Target help |
|
59 |
target_help: |
|
60 |
@$(ECHO) "\ |
|
61 |
--- Common Targets --- \n\ |
|
62 |
all -- build the core JDK (default target) \n\ |
|
63 |
help -- Print out help information \n\ |
|
64 |
check -- Check make variable values for correctness \n\ |
|
65 |
sanity -- Perform detailed sanity checks on system and settings \n\ |
|
66 |
openjdk -- synonym for 'OPENJDK=true all' \n\ |
|
67 |
fastdebug -- build the core JDK in 'fastdebug' mode (-g -O) \n\ |
|
68 |
debug -- build the core JDK in 'debug' mode (-g) \n\ |
|
69 |
clean -- remove all built and imported files \n\ |
|
70 |
clobber -- same as clean \n\ |
|
71 |
docs -- run javadoc to generate the JDK documentation \n\ |
|
72 |
images -- build the jdk and jre image directories \n\ |
|
73 |
import -- copy in the pre-built components (e.g. VM) \n\ |
|
74 |
import_product -- copy in the product components \n\ |
|
75 |
import_fastdebug -- copy in the fastdebug components \n\ |
|
76 |
import_debug -- copy in the debug components \n\ |
|
4524 | 77 |
modules -- build the jdk and jre module images (experimental) \n\ |
2 | 78 |
sccs_get -- make sure all SCCS files are up-to-date (need SCCS) \n\ |
79 |
create_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\ |
|
80 |
" |
|
81 |
||
82 |
# Variable help (only common ones used by this workspace) |
|
83 |
variable_help: variable_help_intro variable_list variable_help_end |
|
84 |
variable_help_intro: |
|
85 |
@$(ECHO) "--- Common Variables ---" |
|
86 |
variable_help_end: |
|
87 |
@$(ECHO) " " |
|
88 |
||
89 |
# One line descriptions for the variables |
|
90 |
OUTPUTDIR.desc = Output directory |
|
91 |
PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count |
|
92 |
SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: |
|
93 |
BOOTDIR.desc = JDK used to boot the build |
|
94 |
LANGTOOLS_DIST.desc = langtools dist area used to build |
|
95 |
CORBA_DIST.desc = corba dist area |
|
96 |
JAXP_DIST.desc = jaxp dist area |
|
97 |
JAXWS_DIST.desc = jaxws dist area |
|
98 |
JDK_IMPORT_PATH.desc = JDK used to import components of the build |
|
99 |
COMPILER_PATH.desc = Compiler install directory |
|
100 |
CACERTS_FILE.desc = Location of certificates file |
|
101 |
DEVTOOLS_PATH.desc = Directory containing zip and unzip |
|
102 |
CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files |
|
103 |
DXSDK_PATH.desc = Root directory of DirectX SDK |
|
104 |
MSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe) |
|
105 |
MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll |
|
106 |
||
107 |
# Make variables to print out (description and value) |
|
108 |
VARIABLE_PRINTVAL_LIST += \ |
|
109 |
OUTPUTDIR \ |
|
110 |
PARALLEL_COMPILE_JOBS \ |
|
111 |
SLASH_JAVA \ |
|
112 |
BOOTDIR \ |
|
113 |
LANGTOOLS_DIST \ |
|
114 |
JAXWS_DIST \ |
|
115 |
CORBA_DIST \ |
|
116 |
JAXP_DIST \ |
|
117 |
JDK_IMPORT_PATH \ |
|
118 |
COMPILER_PATH \ |
|
119 |
CACERTS_FILE \ |
|
120 |
DEVTOOLS_PATH |
|
121 |
||
122 |
# Make variables that should refer to directories that exist |
|
123 |
VARIABLE_CHECKDIR_LIST += \ |
|
124 |
SLASH_JAVA \ |
|
125 |
BOOTDIR \ |
|
126 |
JDK_IMPORT_PATH \ |
|
127 |
COMPILER_PATH \ |
|
128 |
DEVTOOLS_PATH |
|
129 |
||
130 |
# Make variables that should refer to files that exist |
|
131 |
VARIABLE_CHECKFIL_LIST += \ |
|
132 |
CACERTS_FILE |
|
133 |
||
134 |
# Some are windows specific |
|
135 |
ifeq ($(PLATFORM), windows) |
|
136 |
||
137 |
VARIABLE_PRINTVAL_LIST += \ |
|
138 |
DXSDK_PATH \ |
|
139 |
MSDEVTOOLS_PATH \ |
|
140 |
MSVCRT_DLL_PATH |
|
141 |
||
142 |
VARIABLE_CHECKDIR_LIST += \ |
|
143 |
DXSDK_PATH \ |
|
144 |
MSDEVTOOLS_PATH \ |
|
145 |
MSVCRT_DLL_PATH |
|
146 |
||
147 |
endif |
|
148 |
||
149 |
# For pattern rules below, so all are treated the same |
|
150 |
DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval) |
|
151 |
DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir) |
|
152 |
DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil) |
|
153 |
||
154 |
# Complete variable check |
|
155 |
variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST) |
|
156 |
variable_list: $(DO_PRINTVAL_LIST) variable_check |
|
157 |
||
158 |
# Pattern rule for printing out a variable |
|
159 |
%.printval: |
|
160 |
@$(ECHO) " ALT_$* - $($*.desc)" |
|
161 |
@$(ECHO) " \t $*=$($*)" |
|
162 |
||
163 |
# Pattern rule for checking to see if a variable with a directory exists |
|
164 |
%.checkdir: |
|
165 |
@if [ ! -d $($*) ] ; then \ |
|
166 |
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
|
167 |
fi |
|
168 |
||
169 |
# Pattern rule for checking to see if a variable with a file exists |
|
170 |
%.checkfil: |
|
171 |
@if [ ! -f $($*) ] ; then \ |
|
172 |
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
|
173 |
fi |
|
174 |
||
175 |
# Misc notes on help |
|
176 |
notes_help: |
|
177 |
@$(ECHO) "\ |
|
178 |
--- Notes --- \n\ |
|
179 |
- All builds use same output directory unless overridden with \n\ |
|
180 |
\t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\ |
|
181 |
\t to use the clean target first. \n\ |
|
182 |
- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\ |
|
183 |
- CORBA_DIST must refer to a corba dist area. \n\ |
|
184 |
- JAXP_DIST must refer to a jaxp dist area. \n\ |
|
185 |
- JAXWS_DIST must refer to a jaxws dist area. \n\ |
|
186 |
- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\ |
|
187 |
\t builds or previous release JDK builds will work. \n\ |
|
188 |
- The 'debug' target and 'import_debug' only works when a debug promoted \n\ |
|
189 |
\t build is available, and they currently are not. \n\ |
|
190 |
- The fastest builds have been when the workspace and the BOOTDIR are on \n\ |
|
191 |
\t local disk. \n\ |
|
192 |
" |
|
193 |
||
194 |
examples_help: |
|
195 |
@$(ECHO) "\ |
|
196 |
--- Examples --- \n\ |
|
197 |
$(MAKE) fastdebug \n\ |
|
198 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
|
199 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\ |
|
200 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\ |
|
201 |
$(MAKE) ALT_BOOTDIR=/opt/java/jdk1.6.0 \n\ |
|
202 |
$(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\ |
|
203 |
" |
|
204 |
||
205 |
# |
|
206 |
# 'all' target intro |
|
207 |
# |
|
208 |
all:: |
|
209 |
@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M') |
|
210 |
||
211 |
# Just in case anyone uses this old name, same as 'build' |
|
212 |
optimized: build |
|
213 |
||
214 |
openjdk: |
|
215 |
$(MAKE) OPENJDK=true all |
|
216 |
||
217 |
# |
|
218 |
# Special debug rules (You may also want to set ALT_OUTPUTDIR) |
|
219 |
# |
|
220 |
debug: |
|
221 |
$(MAKE) VARIANT=DBG all |
|
222 |
fastdebug: |
|
223 |
$(MAKE) VARIANT=DBG FASTDEBUG=true all |
|
224 |
||
225 |
# |
|
226 |
# Rules to re-import VM and other JDK files |
|
227 |
# |
|
228 |
import: |
|
229 |
$(CD) java/redist; $(MAKE) clean all |
|
230 |
||
231 |
import_fastdebug: |
|
232 |
$(MAKE) VARIANT=DBG FASTDEBUG=true import |
|
233 |
||
234 |
import_product: |
|
235 |
$(MAKE) VARIANT=OPT FASTDEBUG=false import |
|
236 |
||
237 |
# |
|
238 |
# Core. |
|
239 |
# |
|
240 |
||
241 |
all build:: sanity-all post-sanity-all |
|
242 |
||
4917
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
243 |
SUBDIRS = tools java javax sun com |
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
244 |
SUBDIRS_tools = launchers |
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
245 |
SUBDIRS_misc = org sunw jpda mkdemo mksample |
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
246 |
|
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
247 |
include $(BUILDDIR)/common/Subdirs.gmk |
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
248 |
|
2 | 249 |
all build:: |
250 |
$(SUBDIRS-loop) |
|
251 |
||
252 |
clean clobber:: |
|
253 |
$(RM) -r $(OUTPUTDIR) |
|
254 |
||
255 |
# |
|
256 |
# Docs |
|
257 |
# |
|
258 |
OTHERSUBDIRS = docs |
|
259 |
docs:: sanity-docs post-sanity-docs |
|
260 |
$(OTHERSUBDIRS-loop) |
|
261 |
||
262 |
# |
|
263 |
# Release engineering targets. |
|
264 |
# |
|
265 |
include $(BUILDDIR)/common/Release.gmk |
|
4524 | 266 |
include $(BUILDDIR)/common/Modules.gmk |
2 | 267 |
|
268 |
# |
|
269 |
# Cscope targets. |
|
270 |
# |
|
271 |
include $(BUILDDIR)/common/Cscope.gmk |
|
272 |
||
273 |
# |
|
274 |
# Sanity checks. |
|
275 |
# |
|
276 |
include $(BUILDDIR)/common/Sanity.gmk |
|
277 |
||
278 |
$(OUTPUTDIR) $(TEMPDIR): |
|
279 |
$(MKDIR) -p $@ |
|
280 |
||
281 |
# cleanup everything. If the workspace is not being built by the control |
|
282 |
# workspace, and if it is a Teamware workspace, then see if there are |
|
283 |
# any files which are not under SCCS control. |
|
284 |
clean clobber:: |
|
285 |
ifndef EXTERNALSANITYCONTROL |
|
286 |
@if [ -d $(TOPDIR)/Codemgr_wsdata ]; then \ |
|
287 |
$(ECHO) '\nPerforming workspace scan for remnant files.\n' \ |
|
288 |
' Any files listed below are not under SCCS control in the workspace\n' \ |
|
289 |
' and you should review them and possibly remove them manually:' ; \ |
|
290 |
$(FIND) $(TOPDIR)/make $(TOPDIR)/src -type f | \ |
|
291 |
$(SED) 's+SCCS/[ps]\.++' | $(SORT) | $(UNIQ) -c | $(NAWK) '$$1<2 {print $$2;}' ; \ |
|
292 |
$(ECHO) 'End of workspace scan.' ; \ |
|
293 |
fi |
|
294 |
endif |
|
295 |
||
296 |
# this should be the last rule in this file: |
|
297 |
all:: |
|
298 |
@if [ -r $(WARNING_FILE) ]; then \ |
|
299 |
$(CAT) $(WARNING_FILE) ; \ |
|
300 |
fi |
|
301 |
@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M') |
|
302 |
||
303 |
# |
|
304 |
# Developer rule that links 32 and 64 bit builds on Solaris by creating |
|
305 |
# softlinks in the 32bit outputdir to the 64bit outputdir. |
|
306 |
# |
|
307 |
ifeq ($(PLATFORM), solaris) |
|
308 |
ifeq ($(ARCH_FAMILY), sparc) |
|
309 |
ARCH32 = sparc |
|
310 |
ARCH64 = sparcv9 |
|
311 |
else |
|
312 |
ARCH32 = i586 |
|
313 |
ARCH64 = amd64 |
|
314 |
endif |
|
315 |
OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32) |
|
316 |
OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64) |
|
317 |
endif |
|
318 |
||
319 |
create_links: |
|
320 |
ifeq ($(PLATFORM), solaris) |
|
321 |
@if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \ |
|
322 |
dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \ |
|
323 |
for sd in $$dirlist ; do \ |
|
324 |
pdir=`$(DIRNAME) $$sd`; \ |
|
325 |
if [ -d $(OUTPUTDIR32)/$$pdir ] ; then \ |
|
326 |
echo "Creating link for $$sd"; \ |
|
327 |
(cd $(OUTPUTDIR32)/$$pdir; $(RM) $(ARCH64); \ |
|
328 |
$(LN) -s $(OUTPUTDIR64)/$$sd ); \ |
|
329 |
fi; \ |
|
330 |
done; \ |
|
331 |
else \ |
|
332 |
$(ECHO) "Build both 32 and 64 bit versions first"; \ |
|
333 |
fi |
|
334 |
else |
|
335 |
$(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)" |
|
336 |
endif |
|
337 |
||
338 |
# |
|
2302 | 339 |
# Binary Plug rules and macros |
340 |
# |
|
341 |
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk |
|
342 |
||
343 |
# |
|
2 | 344 |
# Get top level sccs_get rule |
345 |
# |
|
346 |
include $(BUILDDIR)/common/Rules-SCCS.gmk |
|
347 |
||
348 |
# JPRT rules |
|
349 |
include jprt.gmk |
|
350 |
||
351 |
# |
|
352 |
# Phonies to avoid accidents. |
|
353 |
# |
|
354 |
.PHONY: all build clean clobber optimized debug fastdebug create_links \ |
|
355 |
import import_product import_fastdebug import_debug |
|
356 |