1 #
2 # Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
35 # LIBARCH - the corresponding directory in JDK/JRE
36 # GAMMADIR - top of workspace
37 # OS_FAMILY - operating system
38 # VARIANT - core, compiler1, compiler2, or tiered
39 # VERSION_STRING - the JDK version string as specified by JEP-223
40 # HOTSPOT_VERSION_STRING - the same as VERSION_STRING, unless overridden by a standalone build
41 #
42 # Builds the directory trees with makefiles plus some convenience files in
43 # each directory:
44 #
45 # Makefile - for "make foo"
46 # flags.make - with macro settings
47 # vm.make - to support making "$(MAKE) -v vm.make" in makefiles
48 # adlc.make -
49 # trace.make - generate tracing event and type definitions
50 # jvmti.make - generate JVMTI bindings from the spec (JSR-163)
51 #
52 # The makefiles are split this way so that "make foo" will run faster by not
53 # having to read the dependency files for the vm.
54
55 # needs to be set here since this Makefile doesn't include defs.make
56 OS_VENDOR:=$(shell uname -s)
57
58 -include $(SPEC)
59 include $(GAMMADIR)/make/scm.make
60 include $(GAMMADIR)/make/defs.make
61 include $(GAMMADIR)/make/altsrc.make
62
63
64 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
65 QUIETLY$(MAKE_VERBOSE) = @
66
67 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
68 PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
69 else
70 ifdef USE_SUNCC
71 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
72 else
73 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
74 endif
75 endif
76
77 # Allow overriding of the arch part of the directory but default
97 # ALWAYS excludes are excluded at any level in the directory tree.
98 #
99
100 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
101
102 ifeq ($(VARIANT),tiered)
103 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
104 else
105 ifeq ($(VARIANT),compiler2)
106 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
107 else
108 # compiler1 and core use the same exclude list
109 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
110 endif
111 endif
112
113 # Get things from the platform file.
114 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
115
116 # dtracefiles is used on BSD versions that implement Dtrace (like MacOS X)
117 SIMPLE_DIRS = \
118 $(PLATFORM_DIR)/generated/dependencies \
119 $(PLATFORM_DIR)/generated/adfiles \
120 $(PLATFORM_DIR)/generated/jvmtifiles \
121 $(PLATFORM_DIR)/generated/tracefiles \
122 $(PLATFORM_DIR)/generated/dtracefiles
123
124 TARGETS = debug fastdebug optimized product
125 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
126
127 # For dependencies and recursive makes.
128 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
129
130 # dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
131 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make dtrace.make
132
133 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
134 SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
135
136 # Define variables to be set in flags.make.
137 # Default values are set in make/defs.make.
138
139 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami)
140 ifndef HOTSPOT_BUILD_USER
141 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
150 include $(GAMMADIR)/make/hotspot_distro
151 else
152 include $(GAMMADIR)/make/openjdk_distro
153 endif
154 endif
155
156 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
157 ifndef OPENJDK
158 ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
159 OPENJDK=true
160 endif
161 endif
162
163 BUILDTREE_VARS += HOTSPOT_VERSION_STRING=$(HOTSPOT_VERSION_STRING) VERSION_STRING=$(VERSION_STRING)
164
165 BUILDTREE = \
166 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS)
167
168 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)"
169
170 all: $(SUBMAKE_DIRS)
171
172 # Run make in each subdirectory recursively.
173 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE
174 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; }
175 +$(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F)
176 $(QUIETLY) touch $@
177
178 $(SIMPLE_DIRS):
179 $(QUIETLY) mkdir -p $@
180
181 # Convenience macro which takes a source relative path, applies $(1) to the
182 # absolute path, and then replaces $(GAMMADIR) in the result with a
183 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.
184 gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
185
186 # This bit is needed to enable local rebuilds.
187 # Unless the makefile itself sets LP64, any environmental
188 # setting of LP64 will interfere with the build.
189 LP64_SETTING/32 = LP64 = \#empty
190 LP64_SETTING/64 = LP64 = 1
|
1 #
2 # Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
35 # LIBARCH - the corresponding directory in JDK/JRE
36 # GAMMADIR - top of workspace
37 # OS_FAMILY - operating system
38 # VARIANT - core, compiler1, compiler2, or tiered
39 # VERSION_STRING - the JDK version string as specified by JEP-223
40 # HOTSPOT_VERSION_STRING - the same as VERSION_STRING, unless overridden by a standalone build
41 #
42 # Builds the directory trees with makefiles plus some convenience files in
43 # each directory:
44 #
45 # Makefile - for "make foo"
46 # flags.make - with macro settings
47 # vm.make - to support making "$(MAKE) -v vm.make" in makefiles
48 # adlc.make -
49 # trace.make - generate tracing event and type definitions
50 # jvmti.make - generate JVMTI bindings from the spec (JSR-163)
51 #
52 # The makefiles are split this way so that "make foo" will run faster by not
53 # having to read the dependency files for the vm.
54
55 -include $(SPEC)
56 include $(GAMMADIR)/make/scm.make
57 include $(GAMMADIR)/make/defs.make
58 include $(GAMMADIR)/make/altsrc.make
59
60
61 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
62 QUIETLY$(MAKE_VERBOSE) = @
63
64 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
65 PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
66 else
67 ifdef USE_SUNCC
68 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
69 else
70 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
71 endif
72 endif
73
74 # Allow overriding of the arch part of the directory but default
94 # ALWAYS excludes are excluded at any level in the directory tree.
95 #
96
97 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
98
99 ifeq ($(VARIANT),tiered)
100 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
101 else
102 ifeq ($(VARIANT),compiler2)
103 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
104 else
105 # compiler1 and core use the same exclude list
106 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
107 endif
108 endif
109
110 # Get things from the platform file.
111 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
112
113 # dtracefiles is used on BSD versions that implement Dtrace (like MacOS X)
114 SIMPLE_DIRS = \
115 $(PLATFORM_DIR)/generated/dependencies \
116 $(PLATFORM_DIR)/generated/adfiles \
117 $(PLATFORM_DIR)/generated/jvmtifiles \
118 $(PLATFORM_DIR)/generated/tracefiles \
119 $(PLATFORM_DIR)/generated/dtracefiles
120
121 TARGETS = debug fastdebug optimized product
122 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
123
124 # For dependencies and recursive makes.
125 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
126
127 # dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
128 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make dtrace.make
129
130 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
131 SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
132
133 # Define variables to be set in flags.make.
134 # Default values are set in make/defs.make.
135
136 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami)
137 ifndef HOTSPOT_BUILD_USER
138 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
147 include $(GAMMADIR)/make/hotspot_distro
148 else
149 include $(GAMMADIR)/make/openjdk_distro
150 endif
151 endif
152
153 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
154 ifndef OPENJDK
155 ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
156 OPENJDK=true
157 endif
158 endif
159
160 BUILDTREE_VARS += HOTSPOT_VERSION_STRING=$(HOTSPOT_VERSION_STRING) VERSION_STRING=$(VERSION_STRING)
161
162 BUILDTREE = \
163 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS)
164
165 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)"
166
167 all: $(SUBMAKE_DIRS)
168
169 # Run make in each subdirectory recursively.
170 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE
171 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; }
172 +$(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F)
173 $(QUIETLY) touch $@
174
175 $(SIMPLE_DIRS):
176 $(QUIETLY) mkdir -p $@
177
178 # Convenience macro which takes a source relative path, applies $(1) to the
179 # absolute path, and then replaces $(GAMMADIR) in the result with a
180 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.
181 gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
182
183 # This bit is needed to enable local rebuilds.
184 # Unless the makefile itself sets LP64, any environmental
185 # setting of LP64 will interfere with the build.
186 LP64_SETTING/32 = LP64 = \#empty
187 LP64_SETTING/64 = LP64 = 1
|