1 # 2 # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 # Copyright 2012, 2013 SAP AG. All rights reserved. 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 # 6 # This code is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 only, as 8 # published by the Free Software Foundation. 9 # 10 # This code is distributed in the hope that it will be useful, but WITHOUT 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 # version 2 for more details (a copy is included in the LICENSE file that 14 # accompanied this code). 15 # 16 # You should have received a copy of the GNU General Public License version 17 # 2 along with this work; if not, write to the Free Software Foundation, 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 # 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 # or visit www.oracle.com if you need additional information or have any 22 # questions. 23 # 24 # 25 26 # Usage: 27 # 28 # $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch 29 # GAMMADIR=dir OS_FAMILY=os VARIANT=variant 30 # 31 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the 32 # environment or on the command-line: 33 # 34 # ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory 35 # BUILDARCH - build directory 36 # LIBARCH - the corresponding directory in JDK/JRE 37 # GAMMADIR - top of workspace 38 # OS_FAMILY - operating system 39 # VARIANT - core, compiler1, compiler2, or tiered 40 # HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>] 41 # HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty 42 # JRE_RELEASE_VERSION - <major>.<minor>.<micro> (1.7.0) 43 # 44 # Builds the directory trees with makefiles plus some convenience files in 45 # each directory: 46 # 47 # Makefile - for "make foo" 48 # flags.make - with macro settings 49 # vm.make - to support making "$(MAKE) -v vm.make" in makefiles 50 # adlc.make - 51 # trace.make - generate tracing event and type definitions 52 # jvmti.make - generate JVMTI bindings from the spec (JSR-163) 53 # sa.make - generate SA jar file and natives 54 # 55 # The makefiles are split this way so that "make foo" will run faster by not 56 # having to read the dependency files for the vm. 57 58 -include $(SPEC) 59 include $(GAMMADIR)/make/scm.make 60 include $(GAMMADIR)/make/defs.make 61 include $(GAMMADIR)/make/altsrc.make 62 115 116 SIMPLE_DIRS = \ 117 $(PLATFORM_DIR)/generated/dependencies \ 118 $(PLATFORM_DIR)/generated/adfiles \ 119 $(PLATFORM_DIR)/generated/jvmtifiles \ 120 $(PLATFORM_DIR)/generated/tracefiles 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 sa.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 ifeq ($(HOTSPOT_BUILD_VERSION),) 136 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION) 137 else 138 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) 139 endif 140 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami) 141 ifndef HOTSPOT_BUILD_USER 142 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME) 143 endif 144 ifndef HOTSPOT_BUILD_USER 145 HOTSPOT_BUILD_USER := $(shell whoami) 146 endif 147 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 148 # or make/hotspot_distro. 149 ifndef HOTSPOT_VM_DISTRO 150 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 151 include $(GAMMADIR)/make/hotspot_distro 152 else 153 include $(GAMMADIR)/make/openjdk_distro 154 endif 155 endif 156 157 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK 158 ifndef OPENJDK 159 ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 160 OPENJDK=true 161 endif 162 endif 163 164 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 165 166 BUILDTREE = \ 167 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS) 168 169 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)" 170 171 all: $(SUBMAKE_DIRS) 172 173 # Run make in each subdirectory recursively. 174 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE 175 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; } 176 +$(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F) 177 $(QUIETLY) touch $@ 178 179 $(SIMPLE_DIRS): 180 $(QUIETLY) mkdir -p $@ 181 182 # Convenience macro which takes a source relative path, applies $(1) to the 183 # absolute path, and then replaces $(GAMMADIR) in the result with a 184 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. 193 DATA_MODE/ppc64 = 64 194 195 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) 196 197 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 198 @echo $(LOG_INFO) Creating $@ ... 199 $(QUIETLY) ( \ 200 $(BUILDTREE_COMMENT); \ 201 echo; \ 202 echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ 203 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ 204 echo; \ 205 echo "GAMMADIR = $(GAMMADIR)"; \ 206 echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ 207 echo "OSNAME = $(OSNAME)"; \ 208 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ 209 echo "SRCARCH = $(SRCARCH)"; \ 210 echo "BUILDARCH = $(BUILDARCH)"; \ 211 echo "LIBARCH = $(LIBARCH)"; \ 212 echo "TARGET = $(TARGET)"; \ 213 echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \ 214 echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \ 215 echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \ 216 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ 217 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ 218 echo "OPENJDK = $(OPENJDK)"; \ 219 echo "$(LP64_SETTING/$(DATA_MODE))"; \ 220 echo; \ 221 echo "# Used for platform dispatching"; \ 222 echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ 223 echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ 224 echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ 225 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ 226 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ 227 echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ 228 echo "CFLAGS += \$$(TARGET_DEFINES)"; \ 229 echo; \ 230 echo "Src_Dirs_V = \\"; \ 231 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 232 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 233 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 234 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 235 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | 1 # 2 # Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. 3 # Copyright 2012, 2013 SAP AG. All rights reserved. 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 # 6 # This code is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 only, as 8 # published by the Free Software Foundation. 9 # 10 # This code is distributed in the hope that it will be useful, but WITHOUT 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 # version 2 for more details (a copy is included in the LICENSE file that 14 # accompanied this code). 15 # 16 # You should have received a copy of the GNU General Public License version 17 # 2 along with this work; if not, write to the Free Software Foundation, 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 # 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 # or visit www.oracle.com if you need additional information or have any 22 # questions. 23 # 24 # 25 26 # Usage: 27 # 28 # $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch 29 # GAMMADIR=dir OS_FAMILY=os VARIANT=variant 30 # 31 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the 32 # environment or on the command-line: 33 # 34 # ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory 35 # BUILDARCH - build directory 36 # LIBARCH - the corresponding directory in JDK/JRE 37 # GAMMADIR - top of workspace 38 # OS_FAMILY - operating system 39 # VARIANT - core, compiler1, compiler2, or tiered 40 # VERSION_STRING - the JDK version string as specified by JEP-223 41 # HOTSPOT_VERSION_STRING - the same as VERSION_STRING, unless overridden by a standalone build 42 # 43 # Builds the directory trees with makefiles plus some convenience files in 44 # each directory: 45 # 46 # Makefile - for "make foo" 47 # flags.make - with macro settings 48 # vm.make - to support making "$(MAKE) -v vm.make" in makefiles 49 # adlc.make - 50 # trace.make - generate tracing event and type definitions 51 # jvmti.make - generate JVMTI bindings from the spec (JSR-163) 52 # sa.make - generate SA jar file and natives 53 # 54 # The makefiles are split this way so that "make foo" will run faster by not 55 # having to read the dependency files for the vm. 56 57 -include $(SPEC) 58 include $(GAMMADIR)/make/scm.make 59 include $(GAMMADIR)/make/defs.make 60 include $(GAMMADIR)/make/altsrc.make 61 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 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 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make 128 129 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ 130 SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 131 132 # Define variables to be set in flags.make. 133 # Default values are set in make/defs.make. 134 135 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami) 136 ifndef HOTSPOT_BUILD_USER 137 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME) 138 endif 139 ifndef HOTSPOT_BUILD_USER 140 HOTSPOT_BUILD_USER := $(shell whoami) 141 endif 142 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 143 # or make/hotspot_distro. 144 ifndef HOTSPOT_VM_DISTRO 145 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 146 include $(GAMMADIR)/make/hotspot_distro 147 else 148 include $(GAMMADIR)/make/openjdk_distro 149 endif 150 endif 151 152 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK 153 ifndef OPENJDK 154 ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 155 OPENJDK=true 156 endif 157 endif 158 159 BUILDTREE_VARS += HOTSPOT_VERSION_STRING=$(HOTSPOT_VERSION_STRING) VERSION_STRING=$(VERSION_STRING) 160 161 BUILDTREE = \ 162 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS) 163 164 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)" 165 166 all: $(SUBMAKE_DIRS) 167 168 # Run make in each subdirectory recursively. 169 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE 170 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; } 171 +$(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F) 172 $(QUIETLY) touch $@ 173 174 $(SIMPLE_DIRS): 175 $(QUIETLY) mkdir -p $@ 176 177 # Convenience macro which takes a source relative path, applies $(1) to the 178 # absolute path, and then replaces $(GAMMADIR) in the result with a 179 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. 188 DATA_MODE/ppc64 = 64 189 190 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) 191 192 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 193 @echo $(LOG_INFO) Creating $@ ... 194 $(QUIETLY) ( \ 195 $(BUILDTREE_COMMENT); \ 196 echo; \ 197 echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ 198 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ 199 echo; \ 200 echo "GAMMADIR = $(GAMMADIR)"; \ 201 echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ 202 echo "OSNAME = $(OSNAME)"; \ 203 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ 204 echo "SRCARCH = $(SRCARCH)"; \ 205 echo "BUILDARCH = $(BUILDARCH)"; \ 206 echo "LIBARCH = $(LIBARCH)"; \ 207 echo "TARGET = $(TARGET)"; \ 208 echo "HOTSPOT_VERSION_STRING = $(HOTSPOT_VERSION_STRING)"; \ 209 echo "VERSION_STRING = $(VERSION_STRING)"; \ 210 echo "SA_BUILD_VERSION = $(HOTSPOT_VERSION_STRING)"; \ 211 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ 212 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ 213 echo "OPENJDK = $(OPENJDK)"; \ 214 echo "$(LP64_SETTING/$(DATA_MODE))"; \ 215 echo; \ 216 echo "# Used for platform dispatching"; \ 217 echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ 218 echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ 219 echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ 220 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ 221 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ 222 echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ 223 echo "CFLAGS += \$$(TARGET_DEFINES)"; \ 224 echo; \ 225 echo "Src_Dirs_V = \\"; \ 226 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 227 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 228 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 229 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 230 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ |