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