Makefile revision 180:412712f77af6
1160814Ssimon#
2160814Ssimon# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
3160814Ssimon# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4160814Ssimon#
5160814Ssimon# This code is free software; you can redistribute it and/or modify it
6160814Ssimon# under the terms of the GNU General Public License version 2 only, as
7160814Ssimon# published by the Free Software Foundation.  Oracle designates this
8160814Ssimon# particular file as subject to the "Classpath" exception as provided
9160814Ssimon# by Oracle in the LICENSE file that accompanied this code.
10160814Ssimon#
11160814Ssimon# This code is distributed in the hope that it will be useful, but WITHOUT
12160814Ssimon# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13280297Sjkim# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14160814Ssimon# version 2 for more details (a copy is included in the LICENSE file that
15160814Ssimon# accompanied this code).
16160814Ssimon#
17160814Ssimon# You should have received a copy of the GNU General Public License version
18160814Ssimon# 2 along with this work; if not, write to the Free Software Foundation,
19160814Ssimon# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20160814Ssimon#
21160814Ssimon# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22160814Ssimon# or visit www.oracle.com if you need additional information or have any
23160814Ssimon# questions.
24160814Ssimon#
25160814Ssimon
26160814SsimonBUILD_PARENT_DIRECTORY=.
27160814Ssimon
28160814Ssimonifndef TOPDIR
29160814Ssimon  TOPDIR:=.
30160814Ssimonendif
31160814Ssimon
32160814Ssimonifndef CONTROL_TOPDIR
33160814Ssimon  CONTROL_TOPDIR=$(TOPDIR)
34160814Ssimonendif
35160814Ssimon
36160814Ssimon# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
37160814SsimonOPENJDK_SOURCETREE=$(TOPDIR)/openjdk
38160814SsimonOPENJDK_BUILDDIR:=$(shell \
39160814Ssimon  if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
40160814Ssimon    echo "$(OPENJDK_SOURCETREE)"; \
41160814Ssimon  else \
42160814Ssimon    echo "."; \
43160814Ssimon  fi)
44160814Ssimon
45160814Ssimonifndef JDK_TOPDIR
46160814Ssimon  JDK_TOPDIR=$(TOPDIR)/jdk
47160814Ssimonendif
48160814Ssimonifndef JDK_MAKE_SHARED_DIR
49160814Ssimon  JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
50160814Ssimonendif
51160814Ssimon
52160814Ssimon# For start and finish echo lines
53160814SsimonTITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
54160814SsimonDATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
55160814SsimonSTART_ECHO  = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
56160814SsimonFINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
57160814Ssimon
58160814Ssimondefault: all
59160814Ssimon
60160814Ssimoninclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
61280297Sjkiminclude ./make/Defs-internal.gmk
62160814Ssimoninclude ./make/sanity-rules.gmk
63160814Ssimoninclude ./make/hotspot-rules.gmk
64160814Ssimoninclude ./make/langtools-rules.gmk
65160814Ssimoninclude ./make/corba-rules.gmk
66160814Ssimoninclude ./make/jaxp-rules.gmk
67280297Sjkiminclude ./make/jaxws-rules.gmk
68160814Ssimoninclude ./make/jdk-rules.gmk
69160814Ssimoninclude ./make/install-rules.gmk
70160814Ssimoninclude ./make/sponsors-rules.gmk
71160814Ssimoninclude ./make/deploy-rules.gmk
72160814Ssimon
73160814Ssimon# What "all" means
74280297Sjkimall::
75280297Sjkim	@$(START_ECHO)
76280297Sjkim
77280297Sjkimall:: openjdk_check sanity
78280297Sjkim
79280297Sjkimifeq ($(SKIP_FASTDEBUG_BUILD), false)
80280297Sjkim  all:: fastdebug_build
81280297Sjkimendif
82280297Sjkim
83280297Sjkimifeq ($(SKIP_DEBUG_BUILD), false)
84280297Sjkim  all:: debug_build
85280297Sjkimendif
86160814Ssimon
87280297Sjkimifneq ($(SKIP_OPENJDK_BUILD), true)
88280297Sjkim  all:: openjdk_build
89160814Ssimonendif
90280297Sjkim
91280297Sjkimall:: all_product_build 
92160814Ssimon
93160814Ssimonall:: 
94160814Ssimon	@$(FINISH_ECHO)
95160814Ssimon
96160814Ssimon# Everything for a full product build
97160814Ssimonall_product_build::
98160814Ssimon	@$(START_ECHO)
99160814Ssimon
100160814Ssimonifeq ($(SKIP_PRODUCT_BUILD), false)
101280297Sjkim  
102160814Ssimon  all_product_build:: product_build
103160814Ssimon
104160814Ssimon  ifeq ($(BUILD_INSTALL), true)
105160814Ssimon    all_product_build:: $(INSTALL)
106160814Ssimon    clobber:: install-clobber
107160814Ssimon  endif
108160814Ssimon  
109264278Sjkim  ifeq ($(BUILD_SPONSORS), true)
110160814Ssimon    all_product_build:: $(SPONSORS)
111160814Ssimon    clobber:: sponsors-clobber
112160814Ssimon  endif
113160814Ssimon  
114160814Ssimon  ifneq ($(SKIP_COMPARE_IMAGES), true)
115280297Sjkim    all_product_build:: compare-image
116280297Sjkim  endif
117160814Ssimon
118160814Ssimonendif
119160814Ssimon
120160814Ssimonall_product_build:: 
121280297Sjkim	@$(FINISH_ECHO)
122280297Sjkim
123280297Sjkim# Generis build of basic repo series
124280297Sjkimgeneric_build_repo_series::
125280297Sjkim	$(MKDIR) -p $(OUTPUTDIR)
126280297Sjkim	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
127280297Sjkim
128280297Sjkimifeq ($(BUILD_LANGTOOLS), true)
129280297Sjkim  generic_build_repo_series:: langtools
130280297Sjkim  clobber:: langtools-clobber
131280297Sjkimendif
132280297Sjkim
133280297Sjkimifeq ($(BUILD_CORBA), true)
134314125Sdelphij  generic_build_repo_series:: corba
135160814Ssimon  clobber:: corba-clobber
136280297Sjkimendif
137280297Sjkim
138280297Sjkimifeq ($(BUILD_JAXP), true)
139160814Ssimon  generic_build_repo_series:: jaxp
140280297Sjkim  clobber:: jaxp-clobber
141160814Ssimonendif
142280297Sjkim
143280297Sjkimifeq ($(BUILD_JAXWS), true)
144280297Sjkim  generic_build_repo_series:: jaxws
145160814Ssimon  clobber:: jaxws-clobber
146280297Sjkimendif
147280297Sjkim
148160814Ssimonifeq ($(BUILD_HOTSPOT), true)
149280297Sjkim  generic_build_repo_series:: $(HOTSPOT) 
150280297Sjkim  clobber:: hotspot-clobber
151160814Ssimonendif
152280297Sjkim
153280297Sjkimifeq ($(BUILD_JDK), true)
154280297Sjkim  generic_build_repo_series:: $(JDK_JAVA_EXE)
155280297Sjkim  clobber:: jdk-clobber
156280297Sjkimendif
157280297Sjkim
158280297Sjkimifeq ($(BUILD_DEPLOY), true)
159280297Sjkim  generic_build_repo_series:: $(DEPLOY)
160280297Sjkim  clobber:: deploy-clobber
161280297Sjkimendif
162280297Sjkim
163280297Sjkimifeq ($(BUILD_JDK), true)
164280297Sjkim  ifeq ($(BUNDLE_RULES_AVAILABLE), true)
165280297Sjkim    generic_build_repo_series:: openjdk-binary-plugs-bundles
166280297Sjkim  endif
167280297Sjkimendif
168280297Sjkim
169280297Sjkim# The debug build, fastdebug or debug. Needs special handling.
170280297Sjkim#  Note that debug builds do NOT do INSTALL steps, but must be done
171280297Sjkim#  after the product build and before the INSTALL step of the product build.
172280297Sjkim#
173280297Sjkim#   DEBUG_NAME is fastdebug or debug
174280297Sjkim#   ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
175280297Sjkim#   The resulting j2sdk-image is used by the install makefiles to create a
176280297Sjkim#     debug install bundle jdk-*-debug-** bundle (tar or zip) 
177280297Sjkim#     which will install in the debug or fastdebug subdirectory of the
178280297Sjkim#     normal product install area.
179280297Sjkim#     The install process needs to know what the DEBUG_NAME is, so
180280297Sjkim#     look for INSTALL_DEBUG_NAME in the install rules.
181280297Sjkim#
182280297Sjkim
183280297Sjkim# Location of fresh bootdir output
184280297SjkimABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
185280297SjkimFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
186280297SjkimFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
187280297Sjkim  
188280297Sjkimcreate_fresh_product_bootdir: FRC
189280297Sjkim	@$(START_ECHO)
190280297Sjkim	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
191280297Sjkim		GENERATE_DOCS=false \
192280297Sjkim		BOOT_CYCLE_SETTINGS= \
193280297Sjkim		build_product_image
194280297Sjkim	@$(FINISH_ECHO)
195280297Sjkim
196280297Sjkimcreate_fresh_debug_bootdir: FRC
197280297Sjkim	@$(START_ECHO)
198280297Sjkim	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
199280297Sjkim		GENERATE_DOCS=false \
200280297Sjkim		BOOT_CYCLE_DEBUG_SETTINGS= \
201280297Sjkim		build_debug_image
202280297Sjkim	@$(FINISH_ECHO)
203280297Sjkim
204280297Sjkimcreate_fresh_fastdebug_bootdir: FRC
205280297Sjkim	@$(START_ECHO)
206280297Sjkim	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
207280297Sjkim		GENERATE_DOCS=false \
208280297Sjkim		BOOT_CYCLE_DEBUG_SETTINGS= \
209280297Sjkim		build_fastdebug_image
210280297Sjkim	@$(FINISH_ECHO)
211280297Sjkim
212280297Sjkim# Create boot image?
213280297Sjkimifeq ($(SKIP_BOOT_CYCLE),false)
214280297Sjkim  ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
215280297Sjkim    DO_BOOT_CYCLE=true
216280297Sjkim  endif
217280297Sjkimendif
218280297Sjkim
219280297Sjkimifeq ($(DO_BOOT_CYCLE),true)
220280297Sjkim  
221280297Sjkim  # Create the bootdir to use in the build
222280297Sjkim  product_build:: create_fresh_product_bootdir
223280297Sjkim  debug_build:: create_fresh_debug_bootdir
224280297Sjkim  fastdebug_build:: create_fresh_fastdebug_bootdir
225280297Sjkim
226280297Sjkim  # Define variables to be used now for the boot jdk
227280297Sjkim  BOOT_CYCLE_SETTINGS= \
228280297Sjkim     ALT_BOOTDIR=$(FRESH_BOOTDIR) \
229280297Sjkim     ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
230280297Sjkim  BOOT_CYCLE_DEBUG_SETTINGS= \
231280297Sjkim     ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
232160814Ssimon     ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
233280297Sjkim
234280297Sjkimelse
235280297Sjkim
236280297Sjkim  # Use the supplied ALT_BOOTDIR as the boot
237280297Sjkim  BOOT_CYCLE_SETTINGS=
238280297Sjkim  BOOT_CYCLE_DEBUG_SETTINGS=
239280297Sjkim
240280297Sjkimendif
241280297Sjkim
242280297Sjkimbuild_product_image:
243280297Sjkim	@$(START_ECHO)
244280297Sjkim	$(MAKE) \
245280297Sjkim	        SKIP_FASTDEBUG_BUILD=true \
246280297Sjkim	        SKIP_DEBUG_BUILD=true \
247280297Sjkim	        $(BOOT_CYCLE_SETTINGS) \
248280297Sjkim	        generic_build_repo_series
249280297Sjkim	@$(FINISH_ECHO)
250280297Sjkim
251280297Sjkimgeneric_debug_build:
252280297Sjkim	@$(START_ECHO)
253280297Sjkim	$(MAKE) \
254280297Sjkim		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
255280297Sjkim	        DEBUG_NAME=$(DEBUG_NAME) \
256280297Sjkim		GENERATE_DOCS=false \
257280297Sjkim	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
258280297Sjkim		generic_build_repo_series
259280297Sjkim	@$(FINISH_ECHO)
260280297Sjkim
261280297Sjkimbuild_debug_image:
262280297Sjkim	$(MAKE) DEBUG_NAME=debug generic_debug_build
263280297Sjkim
264280297Sjkimbuild_fastdebug_image:
265280297Sjkim	$(MAKE) DEBUG_NAME=fastdebug generic_debug_build
266280297Sjkim
267280297Sjkim# Build final image
268280297Sjkimproduct_build:: build_product_image
269280297Sjkimdebug_build:: build_debug_image
270280297Sjkimfastdebug_build:: build_fastdebug_image
271280297Sjkim
272280297Sjkim# Check on whether we really can build the openjdk, need source etc.
273280297Sjkimopenjdk_check: FRC
274280297Sjkimifneq ($(SKIP_OPENJDK_BUILD), true)
275280297Sjkim	@$(ECHO) " "
276280297Sjkim	@$(ECHO) "================================================="
277280297Sjkim	@if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
278280297Sjkim	    $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
279280297Sjkim	    exit 1; \
280280297Sjkim	else \
281280297Sjkim	    $(ECHO) "OpenJDK will be built after JDK is built"; \
282160814Ssimon	    $(ECHO) "  OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
283280297Sjkim	fi
284160814Ssimon	@$(ECHO) "================================================="
285280297Sjkim	@$(ECHO) " "
286280297Sjkimendif
287280297Sjkim
288280297Sjkim# If we have bundle rules, we have a chance here to do a complete cycle
289280297Sjkim#   build, of production and open build.
290280297Sjkim# FIXUP: We should create the openjdk source bundle and build that?
291160814Ssimon#   But how do we reliable create or get at a formal openjdk source tree?
292280297Sjkim#   The one we have needs to be trimmed of built bits and closed dirs.
293280297Sjkim#   The repositories might not be available.
294280297Sjkim#   The openjdk source bundle is probably not available.
295280297Sjkim
296280297Sjkimifneq ($(SKIP_OPENJDK_BUILD), true)
297280297Sjkim  ifeq ($(BUILD_JDK), true)
298280297Sjkim    ifeq ($(BUNDLE_RULES_AVAILABLE), true)
299280297Sjkim
300280297SjkimOPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
301280297SjkimOPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
302280297SjkimOPENJDK_BUILD_NAME \
303280297Sjkim  = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
304280297SjkimOPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
305280297SjkimBUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image
306280297Sjkimifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
307280297Sjkim  OPENJDK_BOOTDIR=$(BOOTDIR)
308280297Sjkim  OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH)
309280297Sjkimelse
310280297Sjkim  OPENJDK_BOOTDIR=$(BUILT_IMAGE)
311280297Sjkim  OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
312280297Sjkimendif
313280297Sjkim
314160814Ssimonopenjdk_build:
315314125Sdelphij	@$(START_ECHO)
316160814Ssimon	@$(ECHO) " "
317280297Sjkim	@$(ECHO) "================================================="
318280297Sjkim	@$(ECHO) "Starting openjdk build"
319280297Sjkim	@$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
320280297Sjkim	@$(ECHO) "================================================="
321160814Ssimon	@$(ECHO) " "
322280297Sjkim	$(RM) -r $(OPENJDK_OUTPUTDIR)
323160814Ssimon	$(MKDIR) -p $(OPENJDK_OUTPUTDIR)
324280297Sjkim	($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
325160814Ssimon	  OPENJDK=true \
326280297Sjkim	  GENERATE_DOCS=false \
327280297Sjkim	  ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
328160814Ssimon	  ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
329280297Sjkim	  ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \
330280297Sjkim	  ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
331280297Sjkim	  ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
332280297Sjkim		product_build )
333160814Ssimon	$(RM) $(OPENJDK_BUILD_BINARY_ZIP)
334280297Sjkim	( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
335280297Sjkim	  $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
336280297Sjkim	$(RM) -r $(OPENJDK_OUTPUTDIR)
337280297Sjkim	@$(ECHO) " "
338280297Sjkim	@$(ECHO) "================================================="
339280297Sjkim	@$(ECHO) "Finished openjdk build"
340280297Sjkim	@$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
341280297Sjkim	@$(ECHO) "================================================="
342280297Sjkim	@$(ECHO) " "
343160814Ssimon	@$(FINISH_ECHO)
344280297Sjkim    
345280297Sjkim    endif
346280297Sjkim  endif
347160814Ssimonendif
348280297Sjkim
349280297Sjkimclobber::
350280297Sjkim	$(RM) -r $(OUTPUTDIR)/*
351280297Sjkim	$(RM) -r $(OUTPUTDIR)-debug/*
352160814Ssimon	$(RM) -r $(OUTPUTDIR)-fastdebug/*
353280297Sjkim	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
354280297Sjkim
355160814Ssimonclean: clobber
356280297Sjkim
357280297Sjkim#
358280297Sjkim# Dev builds
359280297Sjkim#
360280297Sjkim
361280297Sjkimdev : dev-build
362280297Sjkim
363280297Sjkimdev-build:
364280297Sjkim	$(MAKE) DEV_ONLY=true all
365280297Sjkimdev-sanity:
366280297Sjkim	$(MAKE) DEV_ONLY=true sanity
367280297Sjkimdev-clobber:
368280297Sjkim	$(MAKE) DEV_ONLY=true clobber
369280297Sjkim
370280297Sjkim#
371160814Ssimon# Quick jdk verification build
372290207Sjkim#
373290207Sjkimjdk_only:
374290207Sjkim	$(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
375280297Sjkim
376280297Sjkim
377280297Sjkim#
378280297Sjkim# Quick jdk verification fastdebug build
379160814Ssimon#
380280297Sjkimjdk_fastdebug_only:
381280297Sjkim	$(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
382280297Sjkim	    BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
383280297Sjkim
384280297Sjkim#
385280297Sjkim# Quick deploy verification fastdebug build
386280297Sjkim#
387280297Sjkimdeploy_fastdebug_only:
388280297Sjkim	$(MAKE) \
389280297Sjkim	    DEBUG_NAME=fastdebug \
390280297Sjkim	    BUILD_HOTSPOT=false \
391280297Sjkim	    BUILD_JDK=false \
392280297Sjkim	    BUILD_LANGTOOLS=false \
393280297Sjkim	    BUILD_CORBA=false \
394280297Sjkim	    BUILD_JAXP=false \
395160814Ssimon	    BUILD_JAXWS=false \
396280297Sjkim	    BUILD_INSTALL=false \
397280297Sjkim	    BUILD_SPONSORS=false \
398280297Sjkim	    generic_debug_build
399280297Sjkim
400280297Sjkim#
401160814Ssimon# Product build (skip debug builds)
402280297Sjkim#
403280297Sjkimproduct_only:
404160814Ssimon	$(MAKE) SKIP_FASTDEBUG_BUILD=true all
405280297Sjkim
406280297Sjkim#
407160814Ssimon# Check target
408280297Sjkim#
409280297Sjkim
410280297Sjkimcheck: variable_check
411160814Ssimon
412280297Sjkim#
413280297Sjkim# Help target
414280297Sjkim#
415280297Sjkimhelp: intro_help target_help variable_help notes_help examples_help
416160814Ssimon
417280297Sjkim# Intro help message
418280297Sjkimintro_help:
419280297Sjkim	@$(ECHO) "\
420280297SjkimMakefile for the JDK builds (all the JDK). \n\
421280297Sjkim"
422291719Sjkim
423291719Sjkim# Target help
424291719Sjkimtarget_help:
425160814Ssimon	@$(ECHO) "\
426280297Sjkim--- Common Targets ---  \n\
427160814Ssimonall               -- build the core JDK (default target) \n\
428280297Sjkimhelp              -- Print out help information \n\
429280297Sjkimcheck             -- Check make variable values for correctness \n\
430280297Sjkimsanity            -- Perform detailed sanity checks on system and settings \n\
431280297Sjkimfastdebug_build   -- build the core JDK in 'fastdebug' mode (-g -O) \n\
432280297Sjkimdebug_build       -- build the core JDK in 'debug' mode (-g) \n\
433160814Ssimonclean             -- remove all built and imported files \n\
434280297Sjkimclobber           -- same as clean \n\
435280297Sjkim"
436280297Sjkim
437280297Sjkim# Variable help (only common ones used by this Makefile)
438280297Sjkimvariable_help: variable_help_intro variable_list variable_help_end
439280297Sjkimvariable_help_intro:
440280297Sjkim	@$(ECHO) "--- Common Variables ---"
441160814Ssimonvariable_help_end:
442280297Sjkim	@$(ECHO) " "
443160814Ssimon
444280297Sjkim# One line descriptions for the variables
445280297SjkimOUTPUTDIR.desc             = Output directory
446280297SjkimPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
447280297SjkimSLASH_JAVA.desc            = Root of all build tools, e.g. /java or J:
448280297SjkimBOOTDIR.desc               = JDK used to boot the build
449280297SjkimJDK_IMPORT_PATH.desc       = JDK used to import components of the build
450280297SjkimCOMPILER_PATH.desc         = Compiler install directory
451160814SsimonCACERTS_FILE.desc          = Location of certificates file
452280297SjkimDEVTOOLS_PATH.desc         = Directory containing zip and gnumake
453280297SjkimCUPS_HEADERS_PATH.desc     = Include directory location for CUPS header files
454280297SjkimDXSDK_PATH.desc            = Root directory of DirectX SDK
455280297SjkimMSDEVTOOLS_PATH.desc       = Root directory of VC++ tools (e.g. rc.exe)
456280297SjkimMSVCRT_DLL_PATH.desc       = Directory containing mscvrt.dll
457280297Sjkim
458280297Sjkim# Make variables to print out (description and value)
459280297SjkimVARIABLE_PRINTVAL_LIST +=       \
460280297Sjkim    OUTPUTDIR                   \
461280297Sjkim    PARALLEL_COMPILE_JOBS       \
462160814Ssimon    SLASH_JAVA                  \
463280297Sjkim    BOOTDIR                     \
464280297Sjkim    JDK_IMPORT_PATH             \
465160814Ssimon    COMPILER_PATH               \
466280297Sjkim    CACERTS_FILE                \
467160814Ssimon    DEVTOOLS_PATH
468280297Sjkim
469280297Sjkim# Make variables that should refer to directories that exist
470280297SjkimVARIABLE_CHECKDIR_LIST +=       \
471280297Sjkim    SLASH_JAVA                  \
472280297Sjkim    BOOTDIR                     \
473280297Sjkim    JDK_IMPORT_PATH             \
474280297Sjkim    COMPILER_PATH               \
475280297Sjkim    DEVTOOLS_PATH 
476280297Sjkim
477280297Sjkim# Make variables that should refer to files that exist
478280297SjkimVARIABLE_CHECKFIL_LIST +=       \
479280297Sjkim    CACERTS_FILE
480160814Ssimon
481280297Sjkim# Some are windows specific
482160814Ssimonifeq ($(PLATFORM), windows)
483280297Sjkim
484280297SjkimVARIABLE_PRINTVAL_LIST +=       \
485280297Sjkim    DXSDK_PATH                  \
486280297Sjkim    MSDEVTOOLS_PATH             \
487160814Ssimon    MSVCRT_DLL_PATH
488280297Sjkim
489280297SjkimVARIABLE_CHECKDIR_LIST +=       \
490280297Sjkim    DXSDK_PATH                  \
491280297Sjkim    MSDEVTOOLS_PATH             \
492280297Sjkim    MSVCRT_DLL_PATH
493280297Sjkim
494160814Ssimonendif
495280297Sjkim
496160814Ssimon# For pattern rules below, so all are treated the same
497280297SjkimDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
498280297SjkimDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
499280297SjkimDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
500280297Sjkim
501280297Sjkim# Complete variable check
502280297Sjkimvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
503280297Sjkimvariable_list: $(DO_PRINTVAL_LIST) variable_check
504280297Sjkim
505280297Sjkim# Pattern rule for printing out a variable
506280297Sjkim%.printval:
507280297Sjkim	@$(ECHO) "  ALT_$* - $($*.desc)"
508280297Sjkim	@$(ECHO) "  \t $*=$($*)"
509280297Sjkim
510280297Sjkim# Pattern rule for checking to see if a variable with a directory exists
511280297Sjkim%.checkdir:
512280297Sjkim	@if [ ! -d $($*) ] ; then \
513280297Sjkim	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
514280297Sjkim	fi
515280297Sjkim
516280297Sjkim# Pattern rule for checking to see if a variable with a file exists
517280297Sjkim%.checkfil:
518280297Sjkim	@if [ ! -f $($*) ] ; then \
519280297Sjkim	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
520280297Sjkim	fi
521280297Sjkim
522280297Sjkim# Misc notes on help
523280297Sjkimnotes_help:
524280297Sjkim	@$(ECHO) "\
525280297Sjkim--- Notes --- \n\
526280297Sjkim- All builds use same output directory unless overridden with \n\
527280297Sjkim \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
528280297Sjkim \t to use the clean target first. \n\
529280297Sjkim- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
530280297Sjkim \t builds or previous release JDK builds will work. \n\
531280297Sjkim- The fastest builds have been when the sources and the BOOTDIR are on \n\
532280297Sjkim \t local disk. \n\
533280297Sjkim"
534280297Sjkim
535280297Sjkimexamples_help:
536280297Sjkim	@$(ECHO) "\
537280297Sjkim--- Examples --- \n\
538280297Sjkim  $(MAKE) fastdebug_build \n\
539280297Sjkim  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
540280297Sjkim  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
541280297Sjkim  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
542280297Sjkim  $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
543280297Sjkim  $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
544280297Sjkim"
545280297Sjkim
546280297Sjkim################################################################
547280297Sjkim# Source and binary plug bundling
548160814Ssimon################################################################
549280297Sjkimifeq ($(BUNDLE_RULES_AVAILABLE), true)
550280297Sjkim  include $(BUNDLE_RULES)
551280297Sjkimendif
552280297Sjkim
553280297Sjkim################################################################
554280297Sjkim# JPRT rule to build
555280297Sjkim################################################################
556280297Sjkim
557280297Sjkiminclude ./make/jprt.gmk
558280297Sjkim
559280297Sjkim################################################################
560280297Sjkim#  PHONY
561280297Sjkim################################################################
562280297Sjkim
563280297Sjkim.PHONY: all \
564280297Sjkim	generic_build_repo_series \
565280297Sjkim	what clobber insane \
566160814Ssimon        dev dev-build dev-sanity dev-clobber \
567280297Sjkim        product_build \
568280297Sjkim        fastdebug_build \
569280297Sjkim        debug_build  \
570280297Sjkim        build_product_image  \
571280297Sjkim        build_debug_image  \
572280297Sjkim        build_fastdebug_image \
573160814Ssimon        create_fresh_product_bootdir \
574280297Sjkim        create_fresh_debug_bootdir \
575280297Sjkim        create_fresh_fastdebug_bootdir \
576160814Ssimon        generic_debug_build
577280297Sjkim
578280297Sjkim# Force target
579160814SsimonFRC:
580280297Sjkim
581280297Sjkim