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 #
95 # but lower level directories can be named without fear of collision.
96 # ALWAYS excludes are excluded at any level in the directory tree.
97 #
98
99 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
100
101 ifeq ($(VARIANT),tiered)
102 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
103 else
104 ifeq ($(VARIANT),compiler2)
105 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
106 else
107 # compiler1 and core use the same exclude list
108 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
109 endif
110 endif
111
112 # Get things from the platform file.
113 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
114
115 SIMPLE_DIRS = \
116 $(PLATFORM_DIR)/generated/dependencies \
117 $(PLATFORM_DIR)/generated/adfiles \
118 $(PLATFORM_DIR)/generated/jvmtifiles \
119 $(PLATFORM_DIR)/generated/tracefiles \
120 $(PLATFORM_DIR)/generated/extensions
121
122 TARGETS = debug fastdebug optimized product
123 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
124
125 # For dependencies and recursive makes.
126 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
127
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)
139 endif
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
|
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 #
95 # but lower level directories can be named without fear of collision.
96 # ALWAYS excludes are excluded at any level in the directory tree.
97 #
98
99 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
100
101 ifeq ($(VARIANT),tiered)
102 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
103 else
104 ifeq ($(VARIANT),compiler2)
105 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
106 else
107 # compiler1 and core use the same exclude list
108 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
109 endif
110 endif
111
112 # Get things from the platform file.
113 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
114
115 SIMPLE_DIRS = \
116 $(PLATFORM_DIR)/generated/dependencies \
117 $(PLATFORM_DIR)/generated/adfiles \
118 $(PLATFORM_DIR)/generated/jvmtifiles \
119 $(PLATFORM_DIR)/generated/tracefiles \
120 $(PLATFORM_DIR)/generated/extensions
121
122 TARGETS = debug fastdebug optimized product
123 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
124
125 # For dependencies and recursive makes.
126 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
127
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)
139 endif
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
|