source: trunk/openjdk/jdk/make/Makefile@ 4

Last change on this file since 4 was 2, checked in by dmik, 15 years ago

Imported OpenJDK 6 b19 sources from Oracle.

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