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