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\
|
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 |
|
|
243 |
SUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
|
|
244 |
all build::
|
|
245 |
$(SUBDIRS-loop)
|
|
246 |
|
|
247 |
clean clobber::
|
|
248 |
$(RM) -r $(OUTPUTDIR)
|
|
249 |
|
|
250 |
#
|
|
251 |
# Docs
|
|
252 |
#
|
|
253 |
OTHERSUBDIRS = docs
|
|
254 |
docs:: sanity-docs post-sanity-docs
|
|
255 |
$(OTHERSUBDIRS-loop)
|
|
256 |
|
|
257 |
#
|
|
258 |
# Release engineering targets.
|
|
259 |
#
|
|
260 |
include $(BUILDDIR)/common/Release.gmk
|
4524
|
261 |
include $(BUILDDIR)/common/Modules.gmk
|
2
|
262 |
|
|
263 |
#
|
|
264 |
# Cscope targets.
|
|
265 |
#
|
|
266 |
include $(BUILDDIR)/common/Cscope.gmk
|
|
267 |
|
|
268 |
#
|
|
269 |
# Sanity checks.
|
|
270 |
#
|
|
271 |
include $(BUILDDIR)/common/Sanity.gmk
|
|
272 |
|
|
273 |
$(OUTPUTDIR) $(TEMPDIR):
|
|
274 |
$(MKDIR) -p $@
|
|
275 |
|
|
276 |
# cleanup everything. If the workspace is not being built by the control
|
|
277 |
# workspace, and if it is a Teamware workspace, then see if there are
|
|
278 |
# any files which are not under SCCS control.
|
|
279 |
clean clobber::
|
|
280 |
ifndef EXTERNALSANITYCONTROL
|
|
281 |
@if [ -d $(TOPDIR)/Codemgr_wsdata ]; then \
|
|
282 |
$(ECHO) '\nPerforming workspace scan for remnant files.\n' \
|
|
283 |
' Any files listed below are not under SCCS control in the workspace\n' \
|
|
284 |
' and you should review them and possibly remove them manually:' ; \
|
|
285 |
$(FIND) $(TOPDIR)/make $(TOPDIR)/src -type f | \
|
|
286 |
$(SED) 's+SCCS/[ps]\.++' | $(SORT) | $(UNIQ) -c | $(NAWK) '$$1<2 {print $$2;}' ; \
|
|
287 |
$(ECHO) 'End of workspace scan.' ; \
|
|
288 |
fi
|
|
289 |
endif
|
|
290 |
|
|
291 |
# this should be the last rule in this file:
|
|
292 |
all::
|
|
293 |
@if [ -r $(WARNING_FILE) ]; then \
|
|
294 |
$(CAT) $(WARNING_FILE) ; \
|
|
295 |
fi
|
|
296 |
@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M')
|
|
297 |
|
|
298 |
#
|
|
299 |
# Developer rule that links 32 and 64 bit builds on Solaris by creating
|
|
300 |
# softlinks in the 32bit outputdir to the 64bit outputdir.
|
|
301 |
#
|
|
302 |
ifeq ($(PLATFORM), solaris)
|
|
303 |
ifeq ($(ARCH_FAMILY), sparc)
|
|
304 |
ARCH32 = sparc
|
|
305 |
ARCH64 = sparcv9
|
|
306 |
else
|
|
307 |
ARCH32 = i586
|
|
308 |
ARCH64 = amd64
|
|
309 |
endif
|
|
310 |
OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32)
|
|
311 |
OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64)
|
|
312 |
endif
|
|
313 |
|
|
314 |
create_links:
|
|
315 |
ifeq ($(PLATFORM), solaris)
|
|
316 |
@if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \
|
|
317 |
dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \
|
|
318 |
for sd in $$dirlist ; do \
|
|
319 |
pdir=`$(DIRNAME) $$sd`; \
|
|
320 |
if [ -d $(OUTPUTDIR32)/$$pdir ] ; then \
|
|
321 |
echo "Creating link for $$sd"; \
|
|
322 |
(cd $(OUTPUTDIR32)/$$pdir; $(RM) $(ARCH64); \
|
|
323 |
$(LN) -s $(OUTPUTDIR64)/$$sd ); \
|
|
324 |
fi; \
|
|
325 |
done; \
|
|
326 |
else \
|
|
327 |
$(ECHO) "Build both 32 and 64 bit versions first"; \
|
|
328 |
fi
|
|
329 |
else
|
|
330 |
$(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)"
|
|
331 |
endif
|
|
332 |
|
|
333 |
#
|
2302
|
334 |
# Binary Plug rules and macros
|
|
335 |
#
|
|
336 |
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
|
|
337 |
|
|
338 |
#
|
2
|
339 |
# Get top level sccs_get rule
|
|
340 |
#
|
|
341 |
include $(BUILDDIR)/common/Rules-SCCS.gmk
|
|
342 |
|
|
343 |
# JPRT rules
|
|
344 |
include jprt.gmk
|
|
345 |
|
|
346 |
#
|
|
347 |
# Phonies to avoid accidents.
|
|
348 |
#
|
|
349 |
.PHONY: all build clean clobber optimized debug fastdebug create_links \
|
|
350 |
import import_product import_fastdebug import_debug
|
|
351 |
|