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

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

jdk/make: Enabled packaging security classes.

File size: 11.1 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
108ODINSDK_PATH.desc = Root directory of Odin32 SDK (OS/2)
109
110# Make variables to print out (description and value)
111VARIABLE_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
127VARIABLE_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
135VARIABLE_CHECKFIL_LIST += \
136 CACERTS_FILE
137
138# Some are windows specific
139ifeq ($(PLATFORM), windows)
140
141VARIABLE_PRINTVAL_LIST += \
142 DXSDK_PATH \
143 MSDEVTOOLS_PATH \
144 MSVCRT_DLL_PATH \
145 UNICOWS_DLL_PATH \
146 UNICOWS_LIB_PATH
147
148VARIABLE_CHECKDIR_LIST += \
149 DXSDK_PATH \
150 MSDEVTOOLS_PATH \
151 MSVCRT_DLL_PATH \
152 UNICOWS_DLL_PATH \
153 UNICOWS_LIB_PATH
154
155endif
156
157# Some are OS/2 specific
158ifeq ($(PLATFORM), os2)
159
160VARIABLE_PRINTVAL_LIST += \
161 ODINSDK_PATH
162
163VARIABLE_CHECKDIR_LIST += \
164 ODINSDK_PATH
165
166endif
167
168# For pattern rules below, so all are treated the same
169DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
170DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
171DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
172
173# Complete variable check
174variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
175variable_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
195notes_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
213examples_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#
227all::
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'
231optimized: build
232
233openjdk:
234 $(MAKE) OPENJDK=true all
235
236#
237# Special debug rules (You may also want to set ALT_OUTPUTDIR)
238#
239debug:
240 $(MAKE) VARIANT=DBG all
241fastdebug:
242 $(MAKE) VARIANT=DBG FASTDEBUG=true all
243
244#
245# Rules to re-import VM and other JDK files
246#
247import:
248 $(CD) java/redist; $(MAKE) clean all
249
250import_fastdebug:
251 $(MAKE) VARIANT=DBG FASTDEBUG=true import
252
253import_product:
254 $(MAKE) VARIANT=OPT FASTDEBUG=false import
255
256#
257# Core.
258#
259
260all build:: sanity-all post-sanity-all
261
262ifndef OS2_TEMP
263SUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
264else # disable various stuff
265SUBDIRS = tools java org sun sunw com launchers
266endif
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#
356# Binary Plug rules and macros
357#
358include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
359
360#
361# Get top level sccs_get rule
362#
363include $(BUILDDIR)/common/Rules-SCCS.gmk
364
365# JPRT rules
366include 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
Note: See TracBrowser for help on using the repository browser.