top.make revision 2273
1583N/A#
1583N/A# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
1583N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1583N/A#
1583N/A# This code is free software; you can redistribute it and/or modify it
1583N/A# under the terms of the GNU General Public License version 2 only, as
1583N/A# published by the Free Software Foundation.
1583N/A#
1583N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1583N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1583N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1583N/A# version 2 for more details (a copy is included in the LICENSE file that
1583N/A# accompanied this code).
1583N/A#
1583N/A# You should have received a copy of the GNU General Public License version
1583N/A# 2 along with this work; if not, write to the Free Software Foundation,
1583N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1583N/A#
1583N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1583N/A# or visit www.oracle.com if you need additional information or have any
1583N/A# questions.
1583N/A#
1583N/A#
1583N/A
1583N/A# top.make is included in the Makefile in the build directories.
1583N/A# It DOES NOT include the vm dependency info in order to be faster.
1583N/A# Its main job is to implement the incremental form of make lists.
1583N/A# It also:
1583N/A# -builds and runs adlc via adlc.make
1583N/A# -generates JVMTI source and docs via jvmti.make (JSR-163)
1583N/A# -generate sa-jdi.jar (JDI binding to core files)
1583N/A
1583N/A# It assumes the following flags are set:
1583N/A# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files
1583N/A
1583N/A# -- D. Ungar (5/97) from a file by Bill Bush
1583N/A
1583N/A# Don't override the built-in $(MAKE).
1583N/A# Instead, use "gmake" (or "gnumake") from the command line. --Rose
1583N/A#MAKE = gmake
1583N/A
1583N/Ainclude $(GAMMADIR)/make/altsrc.make
1583N/A
1583N/AGENERATED = ../generated
1583N/AVM = $(GAMMADIR)/src/share/vm
1583N/APlat_File = $(Platform_file)
1583N/ACDG = cd $(GENERATED);
1583N/A
1583N/ACached_plat = $(GENERATED)/platform.current
1583N/A
1583N/AAD_Dir = $(GENERATED)/adfiles
1583N/AADLC = $(AD_Dir)/adlc
1583N/AAD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad)
1583N/AAD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc)
1583N/AAD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp
1583N/AAD_Files = $(AD_Names:%=$(AD_Dir)/%)
1583N/A
1583N/A# AD_Files_If_Required/COMPILER1 = ad_stuff
1583N/AAD_Files_If_Required/COMPILER2 = ad_stuff
1583N/AAD_Files_If_Required/TIERED = ad_stuff
1583N/AAD_Files_If_Required = $(AD_Files_If_Required/$(TYPE))
1583N/A
1583N/A# Wierd argument adjustment for "gnumake -j..."
1583N/Aadjust-mflags = $(GENERATED)/adjust-mflags
1583N/AMFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
# default target: update lists, make vm
# done in stages to force sequential order with parallel make
#
default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
$(CDG) cp $(Plat_File) $(Cached_plat)
# make AD files as necessary
ad_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
# generate JVMTI files from the spec
jvmti_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
# generate SA jar files and native header
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
# and the VM: must use other makefile with dependencies included
# We have to go to great lengths to get control over the -jN argument
# to the recursive invocation of vm.make. The problem is that gnumake
# resets -jN to -j1 for recursive runs. (How helpful.)
# Note that the user must specify the desired parallelism level via a
# command-line or environment variable name HOTSPOT_BUILD_JOBS.
$(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags.sh
@+rm -f $@ $@+
@+cat $< > $@+
@+chmod +x $@+
@+mv $@+ $@
the_vm: vm_build_preliminaries $(adjust-mflags)
@$(MAKE) -f vm.make $(MFLAGS-adjusted)
install: the_vm
@$(MAKE) -f vm.make install
# next rules support "make foo.[oi]"
%.o %.i %.s:
$(MAKE) -f vm.make $(MFLAGS) $@
#$(MAKE) -f vm.make $@
# this should force everything to be rebuilt
clean:
rm -f $(GENERATED)/*.class
$(MAKE) -f vm.make $(MFLAGS) clean
# just in case it doesn't, this should do it
realclean:
$(MAKE) -f vm.make $(MFLAGS) clean
rm -fr $(GENERATED)
.PHONY: default vm_build_preliminaries
.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
.PHONY: checks check_os_version install