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