source: trunk/openjdk/jdk/make/Makefile

Last change on this file was 310, checked in by dmik, 14 years ago

Tailor makefiles for the new Odin 8.x build layout.

File size: 11.1 KB
Line 
1#
2# Copyright (c) 1995, 2010, Oracle and/or its affiliates. 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. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle 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 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.
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
108ODINSDK_HEADERS_PATH.desc = Include directory of Odin32 SDK (OS/2)
109ODINSDK_LIB_PATH.desc = Library directory of Odin32 SDK (OS/2)
110ODINSDK_DBGLIB_PATH.desc = Debug Library directory of Odin32 SDK (OS/2, optional)
111
112# Make variables to print out (description and value)
113VARIABLE_PRINTVAL_LIST += \
114 OUTPUTDIR \
115 PARALLEL_COMPILE_JOBS \
116 SLASH_JAVA \
117 BOOTDIR \
118 LANGTOOLS_DIST \
119 JAXWS_DIST \
120 CORBA_DIST \
121 JAXP_DIST \
122 JDK_IMPORT_PATH \
123 COMPILER_PATH \
124 CACERTS_FILE \
125 DEVTOOLS_PATH \
126 MOTIF_DIR
127
128# Make variables that should refer to directories that exist
129VARIABLE_CHECKDIR_LIST += \
130 SLASH_JAVA \
131 BOOTDIR \
132 JDK_IMPORT_PATH \
133 COMPILER_PATH \
134 DEVTOOLS_PATH
135
136# Make variables that should refer to files that exist
137VARIABLE_CHECKFIL_LIST += \
138 CACERTS_FILE
139
140# Some are windows specific
141ifeq ($(PLATFORM), windows)
142
143VARIABLE_PRINTVAL_LIST += \
144 DXSDK_PATH \
145 MSDEVTOOLS_PATH \
146 MSVCRT_DLL_PATH \
147 UNICOWS_DLL_PATH \
148 UNICOWS_LIB_PATH
149
150VARIABLE_CHECKDIR_LIST += \
151 DXSDK_PATH \
152 MSDEVTOOLS_PATH \
153 MSVCRT_DLL_PATH \
154 UNICOWS_DLL_PATH \
155 UNICOWS_LIB_PATH
156
157endif
158
159# Some are OS/2 specific
160ifeq ($(PLATFORM), os2)
161
162VARIABLE_PRINTVAL_LIST += \
163 ODINSDK_HEADERS_PATH \
164 ODINSDK_LIB_PATH
165
166VARIABLE_CHECKDIR_LIST += \
167 ODINSDK_HEADERS_PATH \
168 ODINSDK_LIB_PATH
169
170endif
171
172# For pattern rules below, so all are treated the same
173DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
174DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
175DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
176
177# Complete variable check
178variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
179variable_list: $(DO_PRINTVAL_LIST) variable_check
180
181# Pattern rule for printing out a variable
182%.printval:
183 @$(ECHO) " ALT_$* - $($*.desc)"
184 @$(ECHO) " \t $*=$($*)"
185
186# Pattern rule for checking to see if a variable with a directory exists
187%.checkdir:
188 @if [ ! -d $($*) ] ; then \
189 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
190 fi
191
192# Pattern rule for checking to see if a variable with a file exists
193%.checkfil:
194 @if [ ! -f $($*) ] ; then \
195 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
196 fi
197
198# Misc notes on help
199notes_help:
200 @$(ECHO) "\
201--- Notes --- \n\
202- All builds use same output directory unless overridden with \n\
203 \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
204 \t to use the clean target first. \n\
205- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\
206- CORBA_DIST must refer to a corba dist area. \n\
207- JAXP_DIST must refer to a jaxp dist area. \n\
208- JAXWS_DIST must refer to a jaxws dist area. \n\
209- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
210 \t builds or previous release JDK builds will work. \n\
211- The 'debug' target and 'import_debug' only works when a debug promoted \n\
212 \t build is available, and they currently are not. \n\
213- The fastest builds have been when the workspace and the BOOTDIR are on \n\
214 \t local disk. \n\
215"
216
217examples_help:
218 @$(ECHO) "\
219--- Examples --- \n\
220 $(MAKE) fastdebug \n\
221 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
222 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\
223 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\
224 $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.6.0 \n\
225 $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\
226"
227
228#
229# 'all' target intro
230#
231all::
232 @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
233
234# Just in case anyone uses this old name, same as 'build'
235optimized: build
236
237openjdk:
238 $(MAKE) OPENJDK=true all
239
240#
241# Special debug rules (You may also want to set ALT_OUTPUTDIR)
242#
243debug:
244 $(MAKE) VARIANT=DBG all
245fastdebug:
246 $(MAKE) VARIANT=DBG FASTDEBUG=true all
247
248#
249# Rules to re-import VM and other JDK files
250#
251import:
252 $(CD) java/redist; $(MAKE) clean all
253
254import_fastdebug:
255 $(MAKE) VARIANT=DBG FASTDEBUG=true import
256
257import_product:
258 $(MAKE) VARIANT=OPT FASTDEBUG=false import
259
260#
261# Core.
262#
263
264all build:: sanity-all post-sanity-all
265
266SUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
267all build::
268 $(SUBDIRS-loop)
269
270clean clobber::
271 $(RM) -r $(OUTPUTDIR)
272
273#
274# Docs
275#
276OTHERSUBDIRS = docs
277docs:: sanity-docs post-sanity-docs
278 $(OTHERSUBDIRS-loop)
279
280#
281# Release engineering targets.
282#
283include $(BUILDDIR)/common/Release.gmk
284
285#
286# Cscope targets.
287#
288include $(BUILDDIR)/common/Cscope.gmk
289
290#
291# Sanity checks.
292#
293include $(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.
301clean clobber::
302ifndef 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
311endif
312
313# this should be the last rule in this file:
314all::
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#
324ifeq ($(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)
334endif
335
336create_links:
337ifeq ($(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
351else
352 $(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)"
353endif
354
355# JPRT rules
356include jprt.gmk
357
358#
359# Phonies to avoid accidents.
360#
361.PHONY: all build clean clobber optimized debug fastdebug create_links \
362 import import_product import_fastdebug import_debug
363
Note: See TracBrowser for help on using the repository browser.