make/linux/makefiles/top.make

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # top.make is included in the Makefile in the build directories.
aoqi@0 26 # It DOES NOT include the vm dependency info in order to be faster.
aoqi@0 27 # Its main job is to implement the incremental form of make lists.
aoqi@0 28 # It also:
aoqi@0 29 # -builds and runs adlc via adlc.make
aoqi@0 30 # -generates JVMTI source and docs via jvmti.make (JSR-163)
aoqi@0 31 # -generate sa-jdi.jar (JDI binding to core files)
aoqi@0 32
aoqi@0 33 # It assumes the following flags are set:
aoqi@0 34 # CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
aoqi@0 35
aoqi@0 36 # -- D. Ungar (5/97) from a file by Bill Bush
aoqi@0 37
aoqi@0 38 # Don't override the built-in $(MAKE).
aoqi@0 39 # Instead, use "gmake" (or "gnumake") from the command line. --Rose
aoqi@0 40 #MAKE = gmake
aoqi@0 41
aoqi@0 42 include $(GAMMADIR)/make/altsrc.make
aoqi@0 43
aoqi@0 44 TOPDIR = $(shell echo `pwd`)
aoqi@0 45 GENERATED = $(TOPDIR)/../generated
aoqi@0 46 VM = $(GAMMADIR)/src/share/vm
aoqi@0 47 Plat_File = $(Platform_file)
aoqi@0 48 CDG = cd $(GENERATED);
aoqi@0 49
aoqi@0 50 ifneq ($(USE_PRECOMPILED_HEADER),0)
aoqi@0 51 UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS)
aoqi@0 52 else
aoqi@0 53 UpdatePCH = \# precompiled header is not used
aoqi@0 54 endif
aoqi@0 55
aoqi@0 56 Cached_plat = $(GENERATED)/platform.current
aoqi@0 57
aoqi@0 58 AD_Dir = $(GENERATED)/adfiles
aoqi@0 59 ADLC = $(AD_Dir)/adlc
aoqi@0 60 AD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad)
aoqi@0 61 AD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc)
aoqi@0 62 AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp
aoqi@0 63 AD_Files = $(AD_Names:%=$(AD_Dir)/%)
aoqi@0 64
aoqi@0 65 # AD_Files_If_Required/COMPILER1 = ad_stuff
aoqi@0 66 AD_Files_If_Required/COMPILER2 = ad_stuff
aoqi@0 67 AD_Files_If_Required/TIERED = ad_stuff
aoqi@0 68 AD_Files_If_Required = $(AD_Files_If_Required/$(TYPE))
aoqi@0 69
aoqi@0 70 # Wierd argument adjustment for "gnumake -j..."
aoqi@0 71 adjust-mflags = $(GENERATED)/adjust-mflags
aoqi@0 72 MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
aoqi@0 73
aoqi@0 74
aoqi@0 75 # default target: update lists, make vm
aoqi@0 76 # done in stages to force sequential order with parallel make
aoqi@0 77 #
aoqi@0 78
aoqi@0 79 default: vm_build_preliminaries the_vm
aoqi@0 80 @echo All done.
aoqi@0 81
aoqi@0 82 # This is an explicit dependency for the sake of parallel makes.
aoqi@0 83 vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff
aoqi@0 84 @# We need a null action here, so implicit rules don't get consulted.
aoqi@0 85
aoqi@0 86 $(Cached_plat): $(Plat_File)
aoqi@0 87 $(CDG) cp $(Plat_File) $(Cached_plat)
aoqi@0 88
aoqi@0 89 # make AD files as necessary
aoqi@0 90 ad_stuff: $(Cached_plat) $(adjust-mflags)
aoqi@0 91 @$(MAKE) -f adlc.make $(MFLAGS-adjusted)
aoqi@0 92
aoqi@0 93 # generate JVMTI files from the spec
aoqi@0 94 jvmti_stuff: $(Cached_plat) $(adjust-mflags)
aoqi@0 95 @$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
aoqi@0 96
aoqi@0 97 # generate trace files
aoqi@0 98 trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
aoqi@0 99 @$(MAKE) -f trace.make $(MFLAGS-adjusted)
aoqi@0 100
aoqi@0 101 # generate SA jar files and native header
aoqi@0 102 sa_stuff:
aoqi@0 103 @$(MAKE) -f sa.make $(MFLAGS-adjusted)
aoqi@0 104
aoqi@0 105 # and the VM: must use other makefile with dependencies included
aoqi@0 106
aoqi@0 107 # We have to go to great lengths to get control over the -jN argument
aoqi@0 108 # to the recursive invocation of vm.make. The problem is that gnumake
aoqi@0 109 # resets -jN to -j1 for recursive runs. (How helpful.)
aoqi@0 110 # Note that the user must specify the desired parallelism level via a
aoqi@0 111 # command-line or environment variable name HOTSPOT_BUILD_JOBS.
aoqi@0 112 $(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags.sh
aoqi@0 113 @+rm -f $@ $@+
aoqi@0 114 @+cat $< > $@+
aoqi@0 115 @+chmod +x $@+
aoqi@0 116 @+mv $@+ $@
aoqi@0 117
aoqi@0 118 the_vm: vm_build_preliminaries $(adjust-mflags)
aoqi@0 119 @$(UpdatePCH)
aoqi@0 120 @$(MAKE) -f vm.make $(MFLAGS-adjusted)
aoqi@0 121
aoqi@0 122 install gamma: the_vm
aoqi@0 123 @$(MAKE) -f vm.make $@
aoqi@0 124
aoqi@0 125 # next rules support "make foo.[ois]"
aoqi@0 126
aoqi@0 127 %.o %.i %.s:
aoqi@0 128 $(UpdatePCH)
aoqi@0 129 $(MAKE) -f vm.make $(MFLAGS) $@
aoqi@0 130 #$(MAKE) -f vm.make $@
aoqi@0 131
aoqi@0 132 # this should force everything to be rebuilt
aoqi@0 133 clean:
aoqi@0 134 rm -f $(GENERATED)/*.class
aoqi@0 135 $(MAKE) -f vm.make $(MFLAGS) clean
aoqi@0 136
aoqi@0 137 # just in case it doesn't, this should do it
aoqi@0 138 realclean:
aoqi@0 139 $(MAKE) -f vm.make $(MFLAGS) clean
aoqi@0 140 rm -fr $(GENERATED)
aoqi@0 141
aoqi@0 142 .PHONY: default vm_build_preliminaries
aoqi@0 143 .PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
aoqi@0 144 .PHONY: checks check_os_version install

mercurial