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 # 23 # 24 25 # Usage: 26 # 27 # $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch 28 # GAMMADIR=dir OS_FAMILY=os VARIANT=variant 29 # 30 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the 31 # environment or on the command-line: 32 # 33 # ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory 34 # BUILDARCH - build directory 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 # HOTSPOT_RELEASE_VERSION - <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>] 40 # HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty 41 # JRE_RELEASE_VERSION - <major>.<minor>.<micro> (1.7.0) 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 116 117 SIMPLE_DIRS = \ 118 $(PLATFORM_DIR)/generated/dependencies \ 119 $(PLATFORM_DIR)/generated/adfiles \ 120 $(PLATFORM_DIR)/generated/jvmtifiles \ 121 $(PLATFORM_DIR)/generated/tracefiles 122 123 TARGETS = debug fastdebug optimized product 124 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) 125 126 # For dependencies and recursive makes. 127 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make 128 129 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make 130 131 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ 132 SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 133 134 # Define variables to be set in flags.make. 135 # Default values are set in make/defs.make. 136 ifeq ($(HOTSPOT_BUILD_VERSION),) 137 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION) 138 else 139 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) 140 endif 141 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami) 142 ifndef HOTSPOT_BUILD_USER 143 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME) 144 endif 145 ifndef HOTSPOT_BUILD_USER 146 HOTSPOT_BUILD_USER := $(shell whoami) 147 endif 148 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 149 # or make/hotspot_distro. 150 ifndef HOTSPOT_VM_DISTRO 151 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 152 include $(GAMMADIR)/make/hotspot_distro 153 else 154 include $(GAMMADIR)/make/openjdk_distro 155 endif 156 endif 157 158 # if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK 159 ifndef OPENJDK 160 ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 161 OPENJDK=true 162 endif 163 endif 164 165 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 166 167 BUILDTREE = \ 168 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS) 169 170 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)" 171 172 all: $(SUBMAKE_DIRS) 173 174 # Run make in each subdirectory recursively. 175 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE 176 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; } 177 +$(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F) 178 $(QUIETLY) touch $@ 179 180 $(SIMPLE_DIRS): 181 $(QUIETLY) mkdir -p $@ 182 183 # Convenience macro which takes a source relative path, applies $(1) to the 184 # absolute path, and then replaces $(GAMMADIR) in the result with a 185 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. 199 DATA_MODE/aarch64 = 64 200 201 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) 202 203 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 204 @echo $(LOG_INFO) Creating $@ ... 205 $(QUIETLY) ( \ 206 $(BUILDTREE_COMMENT); \ 207 echo; \ 208 echo "Platform_file = $(PLATFORM_FILE)" | sed -e 's|$(HS_ALT_MAKE)|$$(HS_ALT_MAKE)|' -e 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ 209 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ 210 echo; \ 211 echo "GAMMADIR = $(GAMMADIR)"; \ 212 echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ 213 echo "OSNAME = $(OSNAME)"; \ 214 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ 215 echo "SRCARCH = $(SRCARCH)"; \ 216 echo "BUILDARCH = $(BUILDARCH)"; \ 217 echo "LIBARCH = $(LIBARCH)"; \ 218 echo "TARGET = $(TARGET)"; \ 219 echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \ 220 echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \ 221 echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \ 222 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ 223 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ 224 echo "OPENJDK = $(OPENJDK)"; \ 225 echo "$(LP64_SETTING/$(DATA_MODE))"; \ 226 echo; \ 227 echo "# Used for platform dispatching"; \ 228 echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ 229 echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ 230 echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ 231 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ 232 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ 233 echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ 234 echo "CFLAGS += \$$(TARGET_DEFINES)"; \ 235 echo; \ 236 echo "Src_Dirs_V = \\"; \ 237 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 238 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 239 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 240 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 241 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | 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 # 23 # 24 25 # Usage: 26 # 27 # $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch 28 # GAMMADIR=dir OS_FAMILY=os VARIANT=variant 29 # 30 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the 31 # environment or on the command-line: 32 # 33 # ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory 34 # BUILDARCH - build directory 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 # sa.make - generate SA jar file and natives 52 # 53 # The makefiles are split this way so that "make foo" will run faster by not 54 # having to read the dependency files for the vm. 55 56 -include $(SPEC) 57 include $(GAMMADIR)/make/scm.make 58 include $(GAMMADIR)/make/defs.make 59 include $(GAMMADIR)/make/altsrc.make 60 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 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 140 ifndef HOTSPOT_BUILD_USER 141 HOTSPOT_BUILD_USER := $(shell whoami) 142 endif 143 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro 144 # or make/hotspot_distro. 145 ifndef HOTSPOT_VM_DISTRO 146 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) 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. 194 DATA_MODE/aarch64 = 64 195 196 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) 197 198 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst 199 @echo $(LOG_INFO) Creating $@ ... 200 $(QUIETLY) ( \ 201 $(BUILDTREE_COMMENT); \ 202 echo; \ 203 echo "Platform_file = $(PLATFORM_FILE)" | sed -e 's|$(HS_ALT_MAKE)|$$(HS_ALT_MAKE)|' -e 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ 204 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ 205 echo; \ 206 echo "GAMMADIR = $(GAMMADIR)"; \ 207 echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ 208 echo "OSNAME = $(OSNAME)"; \ 209 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ 210 echo "SRCARCH = $(SRCARCH)"; \ 211 echo "BUILDARCH = $(BUILDARCH)"; \ 212 echo "LIBARCH = $(LIBARCH)"; \ 213 echo "TARGET = $(TARGET)"; \ 214 echo "HOTSPOT_VERSION_STRING = $(HOTSPOT_VERSION_STRING)"; \ 215 echo "VERSION_STRING = $(VERSION_STRING)"; \ 216 echo "SA_BUILD_VERSION = $(HOTSPOT_VERSION_STRING)"; \ 217 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ 218 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ 219 echo "OPENJDK = $(OPENJDK)"; \ 220 echo "$(LP64_SETTING/$(DATA_MODE))"; \ 221 echo; \ 222 echo "# Used for platform dispatching"; \ 223 echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ 224 echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ 225 echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ 226 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ 227 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ 228 echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ 229 echo "CFLAGS += \$$(TARGET_DEFINES)"; \ 230 echo; \ 231 echo "Src_Dirs_V = \\"; \ 232 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ 233 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ 234 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ 235 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ 236 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ |