make/linux/makefiles/buildtree.make

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>


  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>.<minor>-b<nn> (11.0-b07)
  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 # 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 
  61 
  62 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
  63 QUIETLY$(MAKE_VERBOSE)  = @
  64 
  65 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
  66   PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
  67 else
  68   ifdef USE_SUNCC
  69     PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc


  97 
  98 ALWAYS_EXCLUDE_DIRS     = $(SCM_DIRS)
  99 
 100 ifeq            ($(VARIANT),tiered)
 101 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
 102 else
 103 ifeq            ($(VARIANT),compiler2)
 104 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
 105 else
 106 # compiler1 and core use the same exclude list
 107 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
 108 endif
 109 endif
 110 
 111 # Get things from the platform file.
 112 COMPILER        = $(shell sed -n 's/^compiler[  ]*=[    ]*//p' $(PLATFORM_FILE))
 113 
 114 SIMPLE_DIRS     = \
 115         $(PLATFORM_DIR)/generated/dependencies \
 116         $(PLATFORM_DIR)/generated/adfiles \
 117         $(PLATFORM_DIR)/generated/jvmtifiles

 118 
 119 TARGETS      = debug fastdebug optimized product
 120 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
 121 
 122 # For dependencies and recursive makes.
 123 BUILDTREE_MAKE  = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 124 
 125 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make
 126 
 127 BUILDTREE_VARS  = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 128         SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
 129 
 130 # Define variables to be set in flags.make.
 131 # Default values are set in make/defs.make.
 132 ifeq ($(HOTSPOT_BUILD_VERSION),)
 133   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
 134 else
 135   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
 136 endif
 137 # Set BUILD_USER from system-dependent hints:  $LOGNAME, $(whoami)
 138 ifndef HOTSPOT_BUILD_USER
 139   HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
 140 endif
 141 ifndef HOTSPOT_BUILD_USER
 142   HOTSPOT_BUILD_USER := $(shell whoami)
 143 endif
 144 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
 145 # or make/hotspot_distro.


 252         echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
 253         echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
 254         echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
 255         echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 256         [ -n "$(CFLAGS_BROWSE)" ] && \
 257             echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 258         [ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
 259             echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
 260         [ -n "$(OBJCOPY)" ] && \
 261             echo && echo "OBJCOPY = $(OBJCOPY)"; \
 262         [ -n "$(STRIP_POLICY)" ] && \
 263             echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
 264         [ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
 265             echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
 266         [ -n "$(ZIPEXE)" ] && \
 267             echo && echo "ZIPEXE = $(ZIPEXE)"; \
 268         [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 269             echo && \
 270             echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
 271             echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \


 272         echo; \
 273         [ -n "$(SPEC)" ] && \
 274             echo "include $(SPEC)"; \
 275         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
 276         echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
 277         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
 278         ) > $@
 279 
 280 flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
 281         @echo Creating $@ ...
 282         $(QUIETLY) ( \
 283         $(BUILDTREE_COMMENT); \
 284         echo; \
 285         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
 286         ) > $@
 287 
 288 ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
 289         @echo Creating directory list $@
 290         $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
 291           find $(HS_ALT_SRC)/share/vm/* -prune \


 320 adlc.make: $(BUILDTREE_MAKE)
 321         @echo Creating $@ ...
 322         $(QUIETLY) ( \
 323         $(BUILDTREE_COMMENT); \
 324         echo; \
 325         echo include flags.make; \
 326         echo; \
 327         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 328         ) > $@
 329 
 330 jvmti.make: $(BUILDTREE_MAKE)
 331         @echo Creating $@ ...
 332         $(QUIETLY) ( \
 333         $(BUILDTREE_COMMENT); \
 334         echo; \
 335         echo include flags.make; \
 336         echo; \
 337         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 338         ) > $@
 339 










 340 sa.make: $(BUILDTREE_MAKE)
 341         @echo Creating $@ ...
 342         $(QUIETLY) ( \
 343         $(BUILDTREE_COMMENT); \
 344         echo; \
 345         echo include flags.make; \
 346         echo; \
 347         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 348         ) > $@
 349 
 350 FORCE:
 351 
 352 .PHONY:  all FORCE


  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>.<minor>-b<nn> (11.0-b07)
  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 
  62 
  63 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
  64 QUIETLY$(MAKE_VERBOSE)  = @
  65 
  66 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
  67   PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
  68 else
  69   ifdef USE_SUNCC
  70     PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc


  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 
 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 ifeq ($(HOTSPOT_BUILD_VERSION),)
 135   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
 136 else
 137   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
 138 endif
 139 # Set BUILD_USER from system-dependent hints:  $LOGNAME, $(whoami)
 140 ifndef HOTSPOT_BUILD_USER
 141   HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
 142 endif
 143 ifndef HOTSPOT_BUILD_USER
 144   HOTSPOT_BUILD_USER := $(shell whoami)
 145 endif
 146 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
 147 # or make/hotspot_distro.


 254         echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
 255         echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
 256         echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
 257         echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 258         [ -n "$(CFLAGS_BROWSE)" ] && \
 259             echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 260         [ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
 261             echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
 262         [ -n "$(OBJCOPY)" ] && \
 263             echo && echo "OBJCOPY = $(OBJCOPY)"; \
 264         [ -n "$(STRIP_POLICY)" ] && \
 265             echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
 266         [ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
 267             echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
 268         [ -n "$(ZIPEXE)" ] && \
 269             echo && echo "ZIPEXE = $(ZIPEXE)"; \
 270         [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 271             echo && \
 272             echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
 273             echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
 274         [ -n "$(INCLUDE_TRACE)" ] && \
 275             echo && echo "INCLUDE_TRACE = $(INCLUDE_TRACE)"; \
 276         echo; \
 277         [ -n "$(SPEC)" ] && \
 278             echo "include $(SPEC)"; \
 279         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
 280         echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
 281         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
 282         ) > $@
 283 
 284 flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
 285         @echo Creating $@ ...
 286         $(QUIETLY) ( \
 287         $(BUILDTREE_COMMENT); \
 288         echo; \
 289         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
 290         ) > $@
 291 
 292 ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
 293         @echo Creating directory list $@
 294         $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
 295           find $(HS_ALT_SRC)/share/vm/* -prune \


 324 adlc.make: $(BUILDTREE_MAKE)
 325         @echo Creating $@ ...
 326         $(QUIETLY) ( \
 327         $(BUILDTREE_COMMENT); \
 328         echo; \
 329         echo include flags.make; \
 330         echo; \
 331         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 332         ) > $@
 333 
 334 jvmti.make: $(BUILDTREE_MAKE)
 335         @echo Creating $@ ...
 336         $(QUIETLY) ( \
 337         $(BUILDTREE_COMMENT); \
 338         echo; \
 339         echo include flags.make; \
 340         echo; \
 341         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 342         ) > $@
 343 
 344 trace.make: $(BUILDTREE_MAKE)
 345         @echo Creating $@ ...
 346         $(QUIETLY) ( \
 347         $(BUILDTREE_COMMENT); \
 348         echo; \
 349         echo include flags.make; \
 350         echo; \
 351         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 352         ) > $@
 353 
 354 sa.make: $(BUILDTREE_MAKE)
 355         @echo Creating $@ ...
 356         $(QUIETLY) ( \
 357         $(BUILDTREE_COMMENT); \
 358         echo; \
 359         echo include flags.make; \
 360         echo; \
 361         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 362         ) > $@
 363 
 364 FORCE:
 365 
 366 .PHONY:  all FORCE