top.make revision 971
0N/A#
196N/A# Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A#
0N/A
0N/A# top.make is included in the Makefile in the build directories.
0N/A# It DOES NOT include the vm dependency info in order to be faster.
971N/A# Its main job is to implement the incremental form of make lists.
0N/A# It also:
0N/A# -builds and runs adlc via adlc.make
0N/A# -generates JVMTI source and docs via jvmti.make (JSR-163)
0N/A# -generate sa-jdi.jar (JDI binding to core files)
0N/A
0N/A# It assumes the following flags are set:
0N/A# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files
0N/A
0N/A# -- D. Ungar (5/97) from a file by Bill Bush
0N/A
0N/A# Don't override the built-in $(MAKE).
0N/A# Instead, use "gmake" (or "gnumake") from the command line. --Rose
0N/A#MAKE = gmake
0N/A
0N/ATOPDIR = $(shell echo `pwd`)
0N/AGENERATED = $(TOPDIR)/../generated
0N/AVM = $(GAMMADIR)/src/share/vm
0N/APlat_File = $(Platform_file)
0N/ACDG = cd $(GENERATED);
0N/A
0N/A# Pick up MakeDeps' sources and definitions
91N/Ainclude $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
0N/AMakeDepsClass = MakeDeps.class
0N/A
0N/Aifdef USE_PRECOMPILED_HEADER
0N/APrecompiledOption = -DUSE_PRECOMPILED_HEADER
0N/AUpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS)
0N/Aelse
0N/AUpdatePCH = \# precompiled header is not used
0N/APrecompiledOption =
0N/Aendif
0N/A
0N/AMakeDeps = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps
0N/A
0N/AInclude_DBs/GC = $(VM)/includeDB_gc \
0N/A $(VM)/includeDB_gc_parallel \
0N/A $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
0N/A $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
0N/A $(VM)/gc_implementation/includeDB_gc_parNew \
342N/A $(VM)/gc_implementation/includeDB_gc_g1 \
0N/A $(VM)/gc_implementation/includeDB_gc_serial \
0N/A $(VM)/gc_implementation/includeDB_gc_shared
0N/A
0N/AInclude_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \
0N/A $(VM)/includeDB_jvmti \
0N/A $(VM)/includeDB_features
0N/AInclude_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
0N/AInclude_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
0N/AInclude_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
0N/AInclude_DBs = $(Include_DBs/$(TYPE))
0N/A
0N/ACached_plat = $(GENERATED)/platform.current
0N/ACached_db = $(GENERATED)/includeDB.current
0N/A
0N/AIncremental_Lists = $(Cached_db)
0N/A# list generation also creates $(GENERATED)/$(Cached_plat)
0N/A
0N/A
0N/AAD_Dir = $(GENERATED)/adfiles
0N/AADLC = $(AD_Dir)/adlc
433N/AAD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad
0N/AAD_Src = $(GAMMADIR)/src/share/vm/adlc
433N/AAD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp
0N/AAD_Files = $(AD_Names:%=$(AD_Dir)/%)
0N/A
0N/A# AD_Files_If_Required/COMPILER1 = ad_stuff
0N/AAD_Files_If_Required/COMPILER2 = ad_stuff
0N/AAD_Files_If_Required/TIERED = ad_stuff
0N/AAD_Files_If_Required = $(AD_Files_If_Required/$(TYPE))
0N/A
0N/A# Wierd argument adjustment for "gnumake -j..."
0N/Aadjust-mflags = $(GENERATED)/adjust-mflags
0N/AMFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
0N/A
0N/A
0N/A# default target: make makeDeps, update lists, make vm
0N/A# done in stages to force sequential order with parallel make
0N/A#
0N/A
0N/Adefault: vm_build_preliminaries the_vm
0N/A @echo All done.
0N/A
0N/A# This is an explicit dependency for the sake of parallel makes.
0N/Avm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
0N/A @# We need a null action here, so implicit rules don't get consulted.
0N/A
0N/A# make makeDeps: (and zap the cached db files to force a nonincremental run)
0N/A
0N/A$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
971N/A @$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
0N/A @echo Removing $(Incremental_Lists) to force regeneration.
0N/A @rm -f $(Incremental_Lists)
0N/A @$(CDG) echo >$(Cached_plat)
0N/A
0N/A# make incremental_lists, if cached files out of date, run makeDeps
0N/A
0N/A$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
0N/A $(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB
0N/A $(CDG) if [ ! -r incls ] ; then \
0N/A mkdir incls ; \
0N/A fi
0N/A $(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh
0N/A $(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh
0N/A $(CDG) cp includeDB $(Cached_db)
0N/A $(CDG) cp $(Plat_File) $(Cached_plat)
0N/A
0N/A# symbolic target for command lines
0N/Alists: $(Incremental_Lists)
0N/A @: lists are now up to date
0N/A
0N/A# make AD files as necessary
0N/Aad_stuff: $(Incremental_Lists) $(adjust-mflags)
0N/A @$(MAKE) -f adlc.make $(MFLAGS-adjusted)
0N/A
0N/A# generate JVMTI files from the spec
0N/Ajvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
0N/A @$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
0N/A
0N/A# generate SA jar files and native header
0N/Asa_stuff:
0N/A @$(MAKE) -f sa.make $(MFLAGS-adjusted)
0N/A
0N/A# and the VM: must use other makefile with dependencies included
0N/A
0N/A# We have to go to great lengths to get control over the -jN argument
0N/A# to the recursive invocation of vm.make. The problem is that gnumake
0N/A# resets -jN to -j1 for recursive runs. (How helpful.)
0N/A# Note that the user must specify the desired parallelism level via a
0N/A# command-line or environment variable name HOTSPOT_BUILD_JOBS.
91N/A$(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags.sh
0N/A @+rm -f $@ $@+
0N/A @+cat $< > $@+
0N/A @+chmod +x $@+
0N/A @+mv $@+ $@
0N/A
0N/Athe_vm: vm_build_preliminaries $(adjust-mflags)
0N/A @$(UpdatePCH)
0N/A @$(MAKE) -f vm.make $(MFLAGS-adjusted)
0N/A
0N/Ainstall: the_vm
0N/A @$(MAKE) -f vm.make install
0N/A
0N/A# next rules support "make foo.[oi]"
0N/A
0N/A%.o %.i %.s:
0N/A $(UpdatePCH)
0N/A $(MAKE) -f vm.make $(MFLAGS) $@
0N/A #$(MAKE) -f vm.make $@
0N/A
0N/A# this should force everything to be rebuilt
0N/Aclean:
0N/A rm -f $(GENERATED)/*.class
0N/A $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
0N/A $(MAKE) -f vm.make $(MFLAGS) clean
0N/A
0N/A# just in case it doesn't, this should do it
0N/Arealclean:
0N/A $(MAKE) -f vm.make $(MFLAGS) clean
0N/A rm -fr $(GENERATED)
0N/A
0N/A.PHONY: default vm_build_preliminaries
0N/A.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
0N/A.PHONY: checks check_os_version install