8349515: [REDO] Framework for tracing makefile inclusion and parsing

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2025-02-11 10:55:47 +00:00
parent 8e85829496
commit 964dd18fd2
273 changed files with 2222 additions and 1062 deletions

View File

@ -49,6 +49,6 @@ runs:
- name: 'Export path to where GTest is installed' - name: 'Export path to where GTest is installed'
id: path-name id: path-name
run: | run: |
# Export the path # Export the absolute path
echo 'path=gtest' >> $GITHUB_OUTPUT echo "path=`pwd`/gtest" >> $GITHUB_OUTPUT
shell: bash shell: bash

View File

@ -49,6 +49,6 @@ runs:
- name: 'Export path to where JTReg is installed' - name: 'Export path to where JTReg is installed'
id: path-name id: path-name
run: | run: |
# Export the path # Export the absolute path
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT echo "path=`pwd`/jtreg/installed" >> $GITHUB_OUTPUT
shell: bash shell: bash

View File

@ -59,7 +59,7 @@ ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
else else
makefile_path := $(lastword $(MAKEFILE_LIST)) makefile_path := $(lastword $(MAKEFILE_LIST))
endif endif
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path)))) TOPDIR := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
# ... and then we can include the real makefile to bootstrap the build # ... and then we can include the real makefile to bootstrap the build
include $(topdir)/make/PreInit.gmk include $(TOPDIR)/make/PreInit.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include MakeIO.gmk include MakeIO.gmk
@ -43,8 +42,6 @@ ifeq ($(call isBuildOs, windows), true)
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1" TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
endif endif
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
################################################################################ ################################################################################
# BUNDLE : Name of bundle to create # BUNDLE : Name of bundle to create
# FILES : Files in BASE_DIRS to add to bundle # FILES : Files in BASE_DIRS to add to bundle
@ -502,11 +499,6 @@ endif
################################################################################ ################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles.gmk))
################################################################################
product-bundles: $(PRODUCT_TARGETS) product-bundles: $(PRODUCT_TARGETS)
legacy-bundles: $(LEGACY_TARGETS) legacy-bundles: $(LEGACY_TARGETS)
test-bundles: $(TEST_TARGETS) test-bundles: $(TEST_TARGETS)
@ -517,6 +509,10 @@ static-libs-bundles: $(STATIC_LIBS_TARGETS)
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS) static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
jcov-bundles: $(JCOV_TARGETS) jcov-bundles: $(JCOV_TARGETS)
.PHONY: all default product-bundles test-bundles \ .PHONY: product-bundles test-bundles \
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \ docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
static-libs-bundles static-libs-graal-bundles jcov-bundles static-libs-bundles static-libs-graal-bundles jcov-bundles
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
# When FIXPATH is set, let it process the file to make sure all paths are usable # When FIXPATH is set, let it process the file to make sure all paths are usable
# by system native tools. The FIXPATH tool assumes arguments preceded by an @ # by system native tools. The FIXPATH tool assumes arguments preceded by an @
@ -50,6 +49,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
TARGETS += $(OUTPUTDIR)/compile_commands.json TARGETS += $(OUTPUTDIR)/compile_commands.json
all: $(TARGETS) ################################################################################
.PHONY: all include MakeFileEnd.gmk

View File

@ -23,23 +23,17 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################ ################################################################################
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image. # Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
################################################################################ ################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
include ZipArchive.gmk include ZipArchive.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
# Prepare the find cache. # Prepare the find cache.
DEMO_SRC_DIRS += $(TOPDIR)/src/demo DEMO_SRC_DIRS += $(TOPDIR)/src/demo
@ -264,11 +258,8 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE) IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
endif endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, CompileDemos-post.gmk))
all: $(TARGETS)
images: $(IMAGES_TARGETS) images: $(IMAGES_TARGETS)
.PHONY: all ################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,11 +23,9 @@
# questions. # questions.
# #
# This must be the first rule include MakeFileStart.gmk
default: all
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
@ -148,5 +146,4 @@ TARGETS += $(BUILD_JAVAC_SERVER)
################################################################################ ################################################################################
include MakeFileEnd.gmk
all: $(TARGETS)

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,12 @@
# questions. # questions.
# #
# This must be the first rule include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include Modules.gmk
################################################################################ ################################################################################
# If this is an imported module that has prebuilt classes, only compile # If this is an imported module that has prebuilt classes, only compile
@ -86,7 +85,15 @@ CreateHkTargets = \
################################################################################ ################################################################################
# Include module specific build settings # Include module specific build settings
-include Java.gmk THIS_SNIPPET := modules/$(MODULE)/Java.gmk
ifneq ($(wildcard $(THIS_SNIPPET)), )
include MakeSnippetStart.gmk
include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
endif
################################################################################ ################################################################################
# Setup the main compilation # Setup the main compilation
@ -148,6 +155,4 @@ endif
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,12 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
################################################################################ ################################################################################
include JavaCompilation.gmk
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
# When using an external BUILDJDK, make it possible to shortcut building of # When using an external BUILDJDK, make it possible to shortcut building of
@ -64,4 +62,4 @@ TARGETS += $(BUILD_JIGSAW_TOOLS)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,19 +23,12 @@
# questions. # questions.
# #
# This must be the first rule include MakeFileStart.gmk
default: all
include $(SPEC) ################################################################################
include MakeBase.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
################################################################################ ################################################################################
# Build tools needed for the JFR source code generation # Build tools needed for the JFR source code generation
@ -51,7 +44,6 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
TARGETS += $(BUILD_TOOLS_HOTSPOT) TARGETS += $(BUILD_TOOLS_HOTSPOT)
################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,21 +23,14 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
################################################################################
$(eval $(call IncludeCustomExtension, CompileTools.gmk))
################################################################################
# Use += to be able to add to this from a custom extension # Use += to be able to add to this from a custom extension
BUILD_TOOLS_SRC_DIRS += \ BUILD_TOOLS_SRC_DIRS += \
$(TOPDIR)/make/jdk/src/classes \ $(TOPDIR)/make/jdk/src/classes \
@ -160,4 +153,6 @@ ifeq ($(ENABLE_PANDOC), true)
TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP) TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP)
endif endif
all: $(TARGETS) ################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,12 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################
# This makefile is called for every imported module to copy the non class # This makefile is called for every imported module to copy the non class
# contents into the exploded jdk image. # contents into the exploded jdk image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
@ -103,4 +102,6 @@ ifneq ($(CONF_DIR), )
TARGETS += $(COPY_CONF) TARGETS += $(COPY_CONF)
endif endif
all: $(TARGETS) ################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,12 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
################################################################################ ################################################################################
include CopyFiles.gmk
### TZDB tool needs files from java.time.zone package ### TZDB tool needs files from java.time.zone package
define tzdb_copyfiles define tzdb_copyfiles
@ -51,3 +48,7 @@ $(eval $(call SetupCopyFiles, COPY_INTERIM_TZDB, \
################################################################################ ################################################################################
all: $(COPY_INTERIM_TZDB) all: $(COPY_INTERIM_TZDB)
################################################################################
include MakeFileEnd.gmk

View File

@ -22,8 +22,7 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
include $(SPEC) include MakeFileStart.gmk
include MakeBase.gmk
################################################################################ ################################################################################
@ -54,3 +53,7 @@ $(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
$(RMDIR) $(JCOV_TEMP) $(RMDIR) $(JCOV_TEMP)
jcov-image: $(JCOV_IMAGE_DIR)/release jcov-image: $(JCOV_IMAGE_DIR)/release
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include Execute.gmk include Execute.gmk
@ -36,8 +35,6 @@ ifeq ($(MODULE), )
$(error MODULE must be set when calling CreateJmods.gmk) $(error MODULE must be set when calling CreateJmods.gmk)
endif endif
$(eval $(call IncludeCustomExtension, CreateJmods.gmk))
################################################################################ ################################################################################
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
@ -187,7 +184,15 @@ endif
################################################################################ ################################################################################
# Include module specific build settings # Include module specific build settings
-include Jmod.gmk THIS_SNIPPET := modules/$(MODULE)/Jmod.gmk
ifneq ($(wildcard $(THIS_SNIPPET)), )
include MakeSnippetStart.gmk
include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
endif
# Set main class # Set main class
ifneq ($(JMOD_FLAGS_main_class), ) ifneq ($(JMOD_FLAGS_main_class), )
@ -266,6 +271,4 @@ TARGETS += $(create_$(JMOD_FILE))
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
################################################################################

View File

@ -1,4 +1,4 @@
# Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -22,26 +22,7 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ModuleTools.gmk
include ProcessMarkdown.gmk
include ToolsJdk.gmk
include ZipArchive.gmk
include TextFileProcessing.gmk
# This is needed to properly setup DOCS_MODULES.
$(eval $(call ReadImportMetaData))
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Docs.gmk))
################################################################################ ################################################################################
# This file generates all documentation for OpenJDK. # This file generates all documentation for OpenJDK.
@ -54,7 +35,19 @@ $(eval $(call IncludeCustomExtension, Docs.gmk))
# #
# We will also generate separate, free-standing specifications from either # We will also generate separate, free-standing specifications from either
# markdown or existing html files. # markdown or existing html files.
# ################################################################################
include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ProcessMarkdown.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk
include $(TOPDIR)/make/ModuleTools.gmk
include $(TOPDIR)/make/ToolsJdk.gmk
# This is needed to properly setup DOCS_MODULES.
$(eval $(call ReadImportMetaData))
################################################################################ ################################################################################
# Javadoc settings # Javadoc settings
@ -761,10 +754,6 @@ $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP) ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Docs-post.gmk))
################################################################################ ################################################################################
# Bundles all generated specs into a zip archive, skipping javadocs. # Bundles all generated specs into a zip archive, skipping javadocs.
@ -806,7 +795,11 @@ all: docs-jdk-api-javadoc docs-jdk-api-graphs docs-javase-api-javadoc \
docs-reference-api-graphs docs-jdk-specs docs-jdk-index docs-zip \ docs-reference-api-graphs docs-jdk-specs docs-jdk-index docs-zip \
docs-specs-zip docs-specs-zip
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-graphs \ .PHONY: docs-jdk-api-javadoc docs-jdk-api-graphs \
docs-javase-api-javadoc docs-javase-api-graphs \ docs-javase-api-javadoc docs-javase-api-graphs \
docs-reference-api-javadoc docs-reference-api-graphs docs-jdk-specs \ docs-reference-api-javadoc docs-reference-api-graphs docs-jdk-specs \
docs-jdk-index docs-zip docs-specs-zip docs-jdk-index docs-zip docs-specs-zip
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,18 +23,11 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Doctor.gmk))
################################################################################ ################################################################################
#
# Help user diagnose possible errors and problems with the build environment. # Help user diagnose possible errors and problems with the build environment.
# ################################################################################
prologue: prologue:
$(ECHO) $(ECHO)
@ -145,4 +138,8 @@ doctor: $(TARGETS)
all: doctor all: doctor
.PHONY: default all doctor $(TARGETS) .PHONY: doctor $(TARGETS)
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,16 +23,14 @@
# questions. # questions.
# #
# Runs a tool on the exploded image to improve performance include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include Execute.gmk
include $(TOPDIR)/make/ModuleTools.gmk
################################################################################ ################################################################################
# Runs a tool on the exploded image to improve performance
################################################################################
include Execute.gmk
include $(TOPDIR)/make/ModuleTools.gmk
ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class) ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
@ -47,6 +45,4 @@ TARGETS := $(optimize_image_TARGET)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all default

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,12 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################ ################################################################################
# Generate classlist # Generate classlist
################################################################################ ################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
@ -148,4 +145,4 @@ TARGETS += $(COPY_JLI_TRACE)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,12 +23,11 @@
# questions. # questions.
# #
# Default target declared first include MakeFileStart.gmk
default: all
include $(SPEC) ################################################################################
include MakeBase.gmk
include ModuleTools.gmk include $(TOPDIR)/make/ModuleTools.gmk
GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
@ -50,3 +49,7 @@ $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/tec
$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods $(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot
################################################################################
include MakeFileEnd.gmk

View File

@ -121,12 +121,12 @@ print-configurations:
@true @true
test-prebuilt: test-prebuilt:
@( cd $(topdir) && \ @( cd $(TOPDIR) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \ $(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" ) test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
test-prebuilt-with-exit-code: test-prebuilt-with-exit-code:
@( cd $(topdir) && \ @( cd $(TOPDIR) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \ $(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" ) test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )

View File

@ -23,19 +23,14 @@
# questions. # questions.
# #
# This makefile creates a jdk image overlaid with statically linked core include MakeFileStart.gmk
# libraries.
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
################################################################################
# This makefile creates a jdk image overlaid with statically linked core
# libraries.
################################################################################ ################################################################################
TARGETS := include CopyFiles.gmk
$(eval $(call SetupCopyFiles, COPY_JDK_IMG, \ $(eval $(call SetupCopyFiles, COPY_JDK_IMG, \
SRC := $(JDK_IMAGE_DIR)/, \ SRC := $(JDK_IMAGE_DIR)/, \
@ -54,6 +49,4 @@ TARGETS += $(COPY_STATIC_LIBS)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,17 +23,14 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
include JdkNativeCompilation.gmk
################################################################################ ################################################################################
# This makefile compiles and installs the hsdis library # This makefile compiles and installs the hsdis library
#
################################################################################ ################################################################################
include JdkNativeCompilation.gmk
HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis
REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX) REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX)
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME) BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)
@ -201,8 +198,8 @@ endif
TARGETS += install TARGETS += install
.PHONY: build install
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all default build install

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include DebugInfoUtils.gmk include DebugInfoUtils.gmk
@ -37,9 +36,6 @@ include Utils.gmk
JDK_TARGETS := JDK_TARGETS :=
JRE_TARGETS := JRE_TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Images-pre.gmk))
################################################################################ ################################################################################
# All modules for the current target platform. # All modules for the current target platform.
@ -309,12 +305,6 @@ $(call SetupCopyDebuginfo,SYMBOLS)
################################################################################ ################################################################################
# Include custom post hook here to make it possible to augment the target lists
# before actual target prerequisites are declared.
$(eval $(call IncludeCustomExtension, Images-post.gmk))
################################################################################
$(JRE_TARGETS): $(JLINK_JRE_TARGETS) $(JRE_TARGETS): $(JLINK_JRE_TARGETS)
$(JDK_TARGETS): $(JLINK_JDK_TARGETS) $(JDK_TARGETS): $(JLINK_JDK_TARGETS)
@ -324,4 +314,8 @@ symbols: $(SYMBOLS_TARGETS)
all: jdk jre symbols all: jdk jre symbols
.PHONY: default all jdk jre symbols .PHONY: jdk jre symbols
################################################################################
include MakeFileEnd.gmk

View File

@ -23,6 +23,8 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################ ################################################################################
# Init.gmk sits between PreInit.gmk and Main.gmk when bootstrapping the build. # Init.gmk sits between PreInit.gmk and Main.gmk when bootstrapping the build.
# It is called from PreInit.gmk, and its main responsibility is to launch # It is called from PreInit.gmk, and its main responsibility is to launch
@ -31,28 +33,20 @@
# value of $(MAKE) for all further make calls. # value of $(MAKE) for all further make calls.
################################################################################ ################################################################################
# This must be the first rule # Our helper functions.
default: include $(TOPDIR)/make/InitSupport.gmk
.PHONY: default include LogUtils.gmk
# Force early generation of module-deps.gmk and find-tests.gmk
GENERATE_MODULE_DEPS_FILE := true
include Modules.gmk
GENERATE_FIND_TESTS_FILE := true
include FindTests.gmk
# Inclusion of this pseudo-target will cause make to execute this file # Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j. # serially, regardless of -j.
.NOTPARALLEL: .NOTPARALLEL:
include $(SPEC)
include $(TOPDIR)/make/common/MakeBase.gmk
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk
# Force early generation of module-deps.gmk and find-tests.gmk
GENERATE_MODULE_DEPS_FILE := true
include $(TOPDIR)/make/common/Modules.gmk
GENERATE_FIND_TESTS_FILE := true
include $(TOPDIR)/make/common/FindTests.gmk
# Parse COMPARE_BUILD (for makefile development) # Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild)) $(eval $(call ParseCompareBuild))
@ -169,7 +163,7 @@ main: $(INIT_TARGETS)
$(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
$(BUILD_LOG_PIPE_SIMPLE) && \ $(BUILD_LOG_PIPE_SIMPLE) && \
cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \
HAS_SPEC=true on-failure ; \ on-failure ; \
exit $$exitcode ) ) exit $$exitcode ) )
$(call CleanupJavacServer) $(call CleanupJavacServer)
$(call StopGlobalTimer) $(call StopGlobalTimer)
@ -205,3 +199,7 @@ post-compare-build:
$(call CompareBuildDoComparison) $(call CompareBuildDoComparison)
.PHONY: main on-failure pre-compare-build post-compare-build .PHONY: main on-failure pre-compare-build post-compare-build
################################################################################
include MakeFileEnd.gmk

View File

@ -23,6 +23,9 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains helper functions for Init.gmk. # This file contains helper functions for Init.gmk.
################################################################################ ################################################################################
@ -36,12 +39,6 @@ BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) &
# to stderr. # to stderr.
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG) BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
ifneq ($(CUSTOM_ROOT), )
topdir = $(CUSTOM_ROOT)
else
topdir = $(TOPDIR)
endif
# Setup the build environment to match the requested specification on # Setup the build environment to match the requested specification on
# level of reproducible builds # level of reproducible builds
define SetupReproducibleBuild define SetupReproducibleBuild
@ -64,7 +61,7 @@ endef
# FAIL can be set to false to have the return value of compare be ignored. # FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), ) ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUTDIR := $(topdir)/build/compare-build/$(CONF_NAME) COMPARE_BUILD_OUTPUTDIR := $(WORKSPACE_ROOT)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true COMPARE_BUILD_FAIL := true
ifneq ($$(findstring :, $$(COMPARE_BUILD)), ) ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
@ -106,14 +103,14 @@ define ParseCompareBuild
endif endif
endif endif
ifneq ($$(COMPARE_BUILD_PATCH), ) ifneq ($$(COMPARE_BUILD_PATCH), )
ifneq ($$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)), ) ifneq ($$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH)), )
# Assume relative path, if file exists # Assume relative path, if file exists
COMPARE_BUILD_PATCH := $$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)) COMPARE_BUILD_PATCH := $$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH))
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), ) else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist) $$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
endif endif
ifneq ($$(COMPARE_BUILD_NODRYRUN), true) ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED) PATCH_DRY_RUN := $$(shell cd $$(WORKSPACE_ROOT) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
ifeq ($$(PATCH_DRY_RUN), FAILED) ifeq ($$(PATCH_DRY_RUN), FAILED)
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly) $$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
endif endif
@ -129,11 +126,11 @@ endef
define PrepareCompareBuild define PrepareCompareBuild
$(ECHO) "Preparing for comparison rebuild" $(ECHO) "Preparing for comparison rebuild"
# Apply patch, if any # Apply patch, if any
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH)) $(if $(COMPARE_BUILD_PATCH), cd $(WORKSPACE_ROOT) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
# Move the first build away temporarily # Move the first build away temporarily
$(RM) -r $(topdir)/build/.compare-build-temp $(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
$(MKDIR) -p $(topdir)/build/.compare-build-temp $(MKDIR) -p $(WORKSPACE_ROOT)/build/.compare-build-temp
$(MV) $(OUTPUTDIR) $(topdir)/build/.compare-build-temp $(MV) $(OUTPUTDIR) $(WORKSPACE_ROOT)/build/.compare-build-temp
# Restore an old compare-build, or create a new compare-build directory. # Restore an old compare-build, or create a new compare-build directory.
if test -d $(COMPARE_BUILD_OUTPUTDIR); then \ if test -d $(COMPARE_BUILD_OUTPUTDIR); then \
$(MV) $(COMPARE_BUILD_OUTPUTDIR) $(OUTPUTDIR); \ $(MV) $(COMPARE_BUILD_OUTPUTDIR) $(OUTPUTDIR); \
@ -143,19 +140,19 @@ define PrepareCompareBuild
# Re-run configure with the same arguments (and possibly some additional), # Re-run configure with the same arguments (and possibly some additional),
# must be done after patching. # must be done after patching.
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" \ ( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" \
$(BASH) $(topdir)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF)) $(BASH) $(WORKSPACE_ROOT)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
endef endef
# Cleanup after a compare build # Cleanup after a compare build
define CleanupCompareBuild define CleanupCompareBuild
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue # If running with a COMPARE_BUILD patch, reverse-apply it, but continue
# even if that fails (can happen with removed files). # even if that fails (can happen with removed files).
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true) $(if $(COMPARE_BUILD_PATCH), cd $(WORKSPACE_ROOT) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
# Move this build away and restore the original build # Move this build away and restore the original build
$(MKDIR) -p $(topdir)/build/compare-build $(MKDIR) -p $(WORKSPACE_ROOT)/build/compare-build
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR) $(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
$(MV) $(topdir)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR) $(MV) $(WORKSPACE_ROOT)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
$(RM) -r $(topdir)/build/.compare-build-temp $(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
endef endef
# Do the actual comparison of two builds # Do the actual comparison of two builds
@ -265,7 +262,7 @@ endif
############################################################################## ##############################################################################
# Store the build times in this directory. # Store the build times in this directory.
BUILDTIMESDIR = $(OUTPUTDIR)/make-support/build-times BUILDTIMESDIR := $(OUTPUTDIR)/make-support/build-times
# Record starting time for build of a sub repository. # Record starting time for build of a sub repository.
define RecordStartTime define RecordStartTime
@ -318,3 +315,8 @@ define ReportProfileTimes
$(BUILD_LOG_PIPE_SIMPLE) $(BUILD_LOG_PIPE_SIMPLE)
) )
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include Execute.gmk include Execute.gmk
include Modules.gmk include Modules.gmk
@ -58,6 +57,4 @@ TARGETS += $(jlink_interim_image)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,13 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include JavaCompilation.gmk
include JarArchive.gmk include JarArchive.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
# This rule will be depended on due to the MANIFEST line # This rule will be depended on due to the MANIFEST line
@ -78,3 +77,7 @@ $(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
)) ))
all: $(BUILD_JRTFS_JAR) all: $(BUILD_JRTFS_JAR)
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,9 @@
# questions. # questions.
# #
include $(SPEC) include MakeFileStart.gmk
include MakeBase.gmk
################################################################################
include CopyFiles.gmk include CopyFiles.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
@ -118,3 +119,7 @@ else # Not macosx
endif # macosx endif # macosx
.PHONY: jdk-bundle jre-bundle bundles .PHONY: jdk-bundle jre-bundle bundles
################################################################################
include MakeFileEnd.gmk

View File

@ -24,44 +24,35 @@
# #
################################################################################ ################################################################################
# This is the main makefile containing most actual top level targets. It needs # This is the main makefile containing most actual top level targets.
# to be called with a SPEC file defined.
################################################################################ ################################################################################
# Declare default target # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
default: # valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
ifeq ($(wildcard $(SPEC)), ) ALL_TARGETS :=
$(error Main.gmk needs SPEC set to a proper spec.gmk)
endif
# Now load the spec DEFAULT_TARGET := default-target
include $(SPEC)
# Load the vital tools for all the makefiles. include MakeFileStart.gmk
include $(TOPDIR)/make/common/MakeBase.gmk
include $(TOPDIR)/make/common/Modules.gmk ################################################################################
include $(TOPDIR)/make/common/FindTests.gmk
include $(TOPDIR)/make/MainSupport.gmk include $(TOPDIR)/make/MainSupport.gmk
include FindTests.gmk
include Modules.gmk
# Are we requested to ignore dependencies? # Are we requested to ignore dependencies?
ifneq ($(findstring -only, $(MAKECMDGOALS)), ) ifneq ($(findstring -only, $(MAKECMDGOALS)), )
DEPS := none DEPS := none
endif endif
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
# valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
ALL_TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Main.gmk))
# All modules for the current target platform. # All modules for the current target platform.
ALL_MODULES := $(call FindAllModules) ALL_MODULES := $(call FindAllModules)
################################################################################
################################################################################ ################################################################################
# #
# Recipes for all targets. Only recipes, dependencies are declared later. # Recipes for all targets. Only recipes, dependencies are declared later.
@ -1342,7 +1333,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
# Traditional targets typically run by users. # Traditional targets typically run by users.
# These can be considered aliases for the targets now named by a more # These can be considered aliases for the targets now named by a more
# "modern" naming scheme. # "modern" naming scheme.
default: $(DEFAULT_MAKE_TARGET) default-target: $(DEFAULT_MAKE_TARGET)
jdk: exploded-image jdk: exploded-image
images: product-images images: product-images
docs: docs-image docs: docs-image
@ -1377,7 +1368,6 @@ ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \ test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \
test-jdk-jtreg-native test-docs test-jdk-jtreg-native test-docs
################################################################################
################################################################################ ################################################################################
# #
# Clean targets # Clean targets
@ -1487,10 +1477,8 @@ create-main-targets-include:
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \ @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Main-post.gmk))
.PHONY: $(ALL_TARGETS) .PHONY: $(ALL_TARGETS)
FRC: # Force target FRC: # Force target
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,13 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains helper functions for Main.gmk. # This file contains helper functions for Main.gmk.
################################################################################ ################################################################################
ifndef _MAINSUPPORT_GMK
_MAINSUPPORT_GMK := 1
# Setup make rules for creating a top-level target. # Setup make rules for creating a top-level target.
# Parameter 1 is the name of the rule. This name is used as variable prefix. # Parameter 1 is the name of the rule. This name is used as variable prefix.
# #
@ -218,4 +218,5 @@ endef
################################################################################ ################################################################################
endif # _MAINSUPPORT_GMK endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,10 @@
# questions. # questions.
# #
ifndef _MODULE_TOOLS_GMK include MakeIncludeStart.gmk
_MODULE_TOOLS_GMK := 1 ifeq ($(INCLUDE), true)
################################################################################
include JavaCompilation.gmk include JavaCompilation.gmk
@ -49,4 +51,7 @@ TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL_BUILDJDK) \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
build.tools.jigsaw.AddPackagesAttribute build.tools.jigsaw.AddPackagesAttribute
endif # _MODULE_TOOLS_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,27 +23,29 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################ ################################################################################
# This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk # This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk
# and wraps calls to makefiles for specific modules and build phases. Having # and wraps calls to makefiles for specific modules and build phases. Having
# this wrapper reduces the need for boilerplate code. It also provides # this wrapper reduces the need for boilerplate code. It also provides
# opportunity for automatic copying of files to an interim exploded runnable # opportunity for automatic copying of files to an interim exploded runnable
# image. # image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
MODULE_SRC := $(TOPDIR)/src/$(MODULE) MODULE_SRC := $(TOPDIR)/src/$(MODULE)
# All makefiles should add the targets to be built to this variable. # Define the snippet for MakeSnippetStart/End
TARGETS := THIS_SNIPPET := modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk
include MakeSnippetStart.gmk
# Include the file being wrapped. # Include the file being wrapped.
include $(MAKEFILE_PREFIX).gmk include $(THIS_SNIPPET)
include MakeSnippetEnd.gmk
ifeq ($(MAKEFILE_PREFIX), Lib) ifeq ($(MAKEFILE_PREFIX), Lib)
# We need to keep track of what libraries are generated/needed by this # We need to keep track of what libraries are generated/needed by this
@ -128,8 +130,12 @@ $(eval $(call SetupCopyFiles, COPY_CONF, \
)) ))
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true) ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS)) TARGETS := $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
else else
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \ TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
$(COPY_INCLUDE) $(COPY_CMDS) $(COPY_MAN) $(COPY_CONF) $(LINK_LIBS_TO_LIB) $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_MAN) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
endif endif
################################################################################
include MakeFileEnd.gmk

View File

@ -38,13 +38,15 @@ default:
# serially, regardless of -j. # serially, regardless of -j.
.NOTPARALLEL: .NOTPARALLEL:
IS_PREINIT_ENV := true
# Include our helper functions. # Include our helper functions.
include $(topdir)/make/PreInitSupport.gmk include $(TOPDIR)/make/PreInitSupport.gmk
include $(topdir)/make/common/LogUtils.gmk include $(TOPDIR)/make/common/LogUtils.gmk
# Here are "global" targets, i.e. targets that can be executed without having # Here are "global" targets, i.e. targets that can be executed without having
# a configuration. This will define ALL_GLOBAL_TARGETS. # a configuration. This will define ALL_GLOBAL_TARGETS.
include $(topdir)/make/Global.gmk include $(TOPDIR)/make/Global.gmk
# CALLED_TARGETS is the list of targets that the user provided, # CALLED_TARGETS is the list of targets that the user provided,
# or "default" if unspecified. # or "default" if unspecified.
@ -79,7 +81,8 @@ ifneq ($(SKIP_SPEC), true)
# Check that CONF_CHECK is valid. # Check that CONF_CHECK is valid.
$(eval $(call ParseConfCheckOption)) $(eval $(call ParseConfCheckOption))
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS. # Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE,
# MAKE_LOG_VARS and MAKE_LOG_FLAGS.
$(eval $(call ParseLogLevel)) $(eval $(call ParseLogLevel))
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails). # After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
@ -101,25 +104,26 @@ ifneq ($(SKIP_SPEC), true)
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS)) SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS)) PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
MAKE_INIT_ARGS := $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common
# The spec files depend on the autoconf source code. This check makes sure # The spec files depend on the autoconf source code. This check makes sure
# the configuration is up to date after changes to configure. # the configuration is up to date after changes to configure.
$(SPECS): $(wildcard $(topdir)/make/autoconf/*) \ $(SPECS): $(wildcard $(TOPDIR)/make/autoconf/*) \
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \ $(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
$(addprefix $(topdir)/make/conf/, version-numbers.conf branding.conf) \ $(addprefix $(TOPDIR)/make/conf/, version-numbers.conf branding.conf) \
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \ $(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
version-numbers.conf branding.conf))) version-numbers.conf branding.conf)))
ifeq ($(CONF_CHECK), fail) ifeq ($(CONF_CHECK), fail)
@echo Error: The configuration is not up to date for \ @echo Error: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'." "'$(lastword $(subst /, , $(dir $@)))'."
$(call PrintConfCheckFailed) $(call PrintConfCheckFailed)
@exit 2 @exit 2
else ifeq ($(CONF_CHECK), auto) else ifeq ($(CONF_CHECK), auto)
@echo Note: The configuration is not up to date for \ @echo Note: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'." "'$(lastword $(subst /, , $(dir $@)))'."
@( cd $(topdir) && \ @( cd $(TOPDIR) && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \ $(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk SPEC=$@ \
SPEC=$@ HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ reconfigure )
reconfigure )
else ifeq ($(CONF_CHECK), ignore) else ifeq ($(CONF_CHECK), ignore)
# Do nothing # Do nothing
endif endif
@ -139,7 +143,7 @@ ifneq ($(SKIP_SPEC), true)
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))') $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif endif
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \ MAKE_INIT_MAIN_TARGET_ARGS := \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \ USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
$(MAKE_LOG_VARS) \ $(MAKE_LOG_VARS) \
INIT_TARGETS="$(INIT_TARGETS)" \ INIT_TARGETS="$(INIT_TARGETS)" \
@ -155,21 +159,24 @@ ifneq ($(SKIP_SPEC), true)
@$(if $(TARGET_DONE), \ @$(if $(TARGET_DONE), \
true \ true \
, \ , \
( cd $(topdir) && \ ( cd $(TOPDIR) && \
$(foreach spec, $(SPECS), \ $(foreach spec, $(SPECS), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \ $(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \ SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
main && \ main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \ $(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \ $(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ SPEC=$(spec) \
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \ COMPARE_BUILD="$(COMPARE_BUILD)" \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \ pre-compare-build && \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \ $(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \ SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \ COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ main && \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" post-compare-build && \ $(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
SPEC=$(spec) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
post-compare-build && \
) \ ) \
) true ) \ ) true ) \
$(eval TARGET_DONE=true) \ $(eval TARGET_DONE=true) \
@ -213,3 +220,5 @@ else # SKIP_SPEC=true
.PHONY: $(ALL_TARGETS) .PHONY: $(ALL_TARGETS)
endif # $(SKIP_SPEC)!=true endif # $(SKIP_SPEC)!=true
################################################################################

View File

@ -23,20 +23,20 @@
# questions. # questions.
# #
############################################################################## ################################################################################
# Helper functions for PreInit.gmk, the initial part of initialization before # Helper functions for PreInit.gmk, the initial part of initialization before
# the SPEC file is loaded. Most of these functions provide parsing and setting # the SPEC file is loaded. Most of these functions provide parsing and setting
# up make options from the command-line. # up make options from the command-line.
############################################################################## ################################################################################
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Include the corresponding closed file, if present. # Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), ) ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk -include $(CUSTOM_MAKE_DIR)/PreInitSupport-pre.gmk
endif endif
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Essential control variables that are handled by PreInit.gmk or Init.gmk # Essential control variables that are handled by PreInit.gmk or Init.gmk
INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \ INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \
COMPARE_BUILD COMPARE_BUILD
@ -68,13 +68,13 @@ USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(ALL_CONTROL_VARI
# Setup information about available configurations, if any. # Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), ) ifneq ($(CUSTOM_ROOT), )
build_dir = $(CUSTOM_ROOT)/build build_dir := $(CUSTOM_ROOT)/build
else else
build_dir = $(topdir)/build build_dir := $(TOPDIR)/build
endif endif
all_spec_files = $(wildcard $(build_dir)/*/spec.gmk) all_spec_files := $(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path # Extract the configuration names from the path
all_confs = $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files))) all_confs := $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables # Check for unknown command-line variables
define CheckControlVariables define CheckControlVariables
@ -110,7 +110,7 @@ endef
define CheckInvalidMakeFlags define CheckInvalidMakeFlags
# This is a trick to get this rule to execute before any other rules # This is a trick to get this rule to execute before any other rules
# MAKEFLAGS only indicate -j if read in a recipe (!) # MAKEFLAGS only indicate -j if read in a recipe (!)
$$(topdir)/make/PreInit.gmk: .FORCE $$(TOPDIR)/make/PreInit.gmk: .FORCE
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \ $$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \ $$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
$$(error Cannot continue) \ $$(error Cannot continue) \
@ -162,7 +162,7 @@ define ParseConfAndSpec
ifneq ($(CUSTOM_ROOT), ) ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).) $$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else else
$$(info Error: No configurations found for $$(topdir).) $$(info Error: No configurations found for $$(TOPDIR).)
endif endif
$$(info Please run 'bash configure' to create a configuration.) $$(info Please run 'bash configure' to create a configuration.)
$$(info ) $$(info )
@ -278,9 +278,9 @@ define DefineMainTargets
endif endif
$$(main_targets_file): $$(main_targets_file):
@( cd $$(topdir) && \ @( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \ $$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/Main.gmk \
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \ -I $$(TOPDIR)/make/common SPEC=$(strip $2) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \ $$(MAKE_LOG_VARS) \
create-main-targets-include ) create-main-targets-include )
@ -295,3 +295,5 @@ define PrintConfCheckFailed
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>." @echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
@echo ' ' @echo ' '
endef endef
################################################################################

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,16 +23,12 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
################################################################################ ################################################################################
# This makefile generates the "release" file into the exploded image. Jlink is # This makefile generates the "release" file into the exploded image. Jlink is
# then responsible for using this as the base for release files in each linked # then responsible for using this as the base for release files in each linked
# image. # image.
#
################################################################################ ################################################################################
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
@ -85,10 +81,4 @@ TARGETS += $(BASE_RELEASE_FILE)
################################################################################ ################################################################################
$(eval $(call IncludeCustomExtension, ReleaseFile.gmk)) include MakeFileEnd.gmk
################################################################################
all: $(TARGETS)
.PHONY: all default

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,10 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
################################################################################
include $(SPEC)
include MakeBase.gmk
include FindTests.gmk include FindTests.gmk
# We will always run multiple tests serially # We will always run multiple tests serially
@ -71,9 +71,6 @@ ifeq ($(call isTargetOs, windows), true)
endif endif
endif endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, RunTests.gmk))
################################################################################ ################################################################################
# This is the JDK that we will test # This is the JDK that we will test
@ -1357,4 +1354,8 @@ endif
all: run-test all: run-test
.PHONY: default all $(TARGETS) .PHONY: $(TARGETS)
################################################################################
include MakeFileEnd.gmk

View File

@ -27,6 +27,8 @@
# Initial bootstrapping, copied and stripped down from Makefile and PreInit.gmk. # Initial bootstrapping, copied and stripped down from Makefile and PreInit.gmk.
################################################################################ ################################################################################
IS_PREINIT_ENV := true
# In Cygwin, the MAKE variable gets prepended with the current directory if the # In Cygwin, the MAKE variable gets prepended with the current directory if the
# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe). # make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
ifneq ($(findstring :, $(MAKE)), ) ifneq ($(findstring :, $(MAKE)), )
@ -57,7 +59,7 @@ TOPDIR := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
define SetupVariable define SetupVariable
ifeq ($$($1), ) ifeq ($$($1), )
ifeq ($2, ) ifeq ($2, )
$$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt) $$(info Error: Prebuilt variable $1 is missing, needed for test-prebuilt)
$$(error Cannot continue.) $$(error Cannot continue.)
else ifeq ($2, OPTIONAL) else ifeq ($2, OPTIONAL)
ifneq ($$(findstring $$(LOG), info debug trace), ) ifneq ($$(findstring $$(LOG), info debug trace), )
@ -135,7 +137,6 @@ $(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
# can include the prebuilt spec file ourselves, without an ephemeral spec # can include the prebuilt spec file ourselves, without an ephemeral spec
# wrapper. This is required so we can include MakeBase which is needed for # wrapper. This is required so we can include MakeBase which is needed for
# CreateNewSpec. # CreateNewSpec.
HAS_SPEC :=
include $(TOPDIR)/make/PreInitSupport.gmk include $(TOPDIR)/make/PreInitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk include $(TOPDIR)/make/common/LogUtils.gmk
@ -246,7 +247,7 @@ endif
# Now we can include additional custom support. # Now we can include additional custom support.
# This might define CUSTOM_NEW_SPEC_LINE # This might define CUSTOM_NEW_SPEC_LINE
ifneq ($(CUSTOM_MAKE_DIR), ) ifneq ($(CUSTOM_MAKE_DIR), )
include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt.gmk include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt-pre.gmk
endif endif
NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk
@ -296,14 +297,10 @@ test-prebuilt:
# is unfortunately not available at this point. # is unfortunately not available at this point.
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR)/failure-logs) $(call MakeDir, $(MAKESUPPORT_OUTPUTDIR)/failure-logs)
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error @$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
# The lazy initialization of the cache file in FindTests.gmk does not # We need to fill the FindTest cache before entering RunTests.gmk.
# always work with RunTests.gmk. To guarantee that the jtreg test groups @cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) SPEC=$(SPEC) \
# are always found and parsed, call FindTests.gmk stand alone once -f RunTestsPrebuiltFindTests.gmk
# before calling RunTests.gmk. @cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true \
GENERATE_FIND_TESTS_FILE=true
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)" TEST="$(TEST)"
test-prebuilt-with-exit-code: test-prebuilt test-prebuilt-with-exit-code: test-prebuilt

View File

@ -0,0 +1,38 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
include MakeFileStart.gmk
################################################################################
# This makefile is a thin wrapper around FindTests.gmk, just to make FindTest
# fill the cache.
################################################################################
GENERATE_FIND_TESTS_FILE := true
include FindTests.gmk
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,7 @@
# questions. # questions.
# #
include $(SPEC) include MakeFileStart.gmk
include MakeBase.gmk
$(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
################################################################################ ################################################################################
# Keep track of what source revision is used to create the build, by creating # Keep track of what source revision is used to create the build, by creating
@ -38,6 +35,7 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
# bundle. As a part of creating this source bundle, the current SCM revisions of # bundle. As a part of creating this source bundle, the current SCM revisions of
# all repos will be stored in a file in the top dir, which is then used when # all repos will be stored in a file in the top dir, which is then used when
# creating the tracker file. # creating the tracker file.
################################################################################
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
@ -156,10 +154,6 @@ endif
################################################################################ ################################################################################
$(eval $(call IncludeCustomExtension, SourceRevision-post.gmk))
################################################################################
store-source-revision: $(STORE_SOURCE_REVISION_TARGET) store-source-revision: $(STORE_SOURCE_REVISION_TARGET)
create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET) create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
@ -167,3 +161,7 @@ create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
FRC: # Force target FRC: # Force target
.PHONY: store-source-revision create-source-revision-tracker .PHONY: store-source-revision create-source-revision-tracker
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,9 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include DebugInfoUtils.gmk include DebugInfoUtils.gmk
@ -185,6 +184,8 @@ static-jdk-image: $(copy-from-jdk-image) $(copy-static-launcher) $(copy-static-l
TARGETS += static-jdk-image TARGETS += static-jdk-image
all: $(TARGETS) .PHONY: static-launcher static-jdk-image
.PHONY: all static-launcher static-jdk-image ################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,12 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################
# This makefile creates an image of the optional static versions of certain JDK # This makefile creates an image of the optional static versions of certain JDK
# libraries. # libraries.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk include CopyFiles.gmk
include Modules.gmk include Modules.gmk
@ -38,8 +37,6 @@ ALL_MODULES = $(call FindAllModules)
################################################################################ ################################################################################
TARGETS :=
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), ) ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), ) else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
@ -72,11 +69,9 @@ ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
) )
endif endif
################################################################################
static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS) static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS)
static-libs-graal-image: $(STATIC_LIBS_TARGETS) static-libs-graal-image: $(STATIC_LIBS_TARGETS)
all: $(TARGETS) ################################################################################
.PHONY: all include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,7 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, TestImage-pre.gmk))
################################################################################ ################################################################################
@ -54,4 +48,8 @@ TARGETS += $(BUILD_INFO_PROPERTIES) $(README)
prepare-test-image: $(TARGETS) prepare-test-image: $(TARGETS)
all: prepare-test-image all: prepare-test-image
.PHONY: default all prepare-test-image .PHONY: prepare-test-image
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,10 @@
# questions. # questions.
# #
ifndef _TOOLS_HOTSPOT_GMK include MakeIncludeStart.gmk
_TOOLS_HOTSPOT_GMK := 1 ifeq ($(INCLUDE), true)
################################################################################
include JavaCompilation.gmk include JavaCompilation.gmk
@ -44,4 +46,5 @@ TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
################################################################################ ################################################################################
endif # _TOOLS_HOTSPOT_GMK endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,13 @@
# questions. # questions.
# #
ifndef _TOOLS_GMK include MakeIncludeStart.gmk
_TOOLS_GMK := 1 ifeq ($(INCLUDE), true)
################################################################################
include JavaCompilation.gmk include JavaCompilation.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Tools.gmk))
################################################################################ ################################################################################
# To avoid reevaluating the compilation setup for the tools each time this file # To avoid reevaluating the compilation setup for the tools each time this file
# is included, the actual compilation is handled by CompileTools.gmk. The # is included, the actual compilation is handled by CompileTools.gmk. The
@ -137,7 +136,5 @@ PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpa
################################################################################ ################################################################################
# Hook to include the corresponding custom post file, if present. endif # include guard
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk)) include MakeIncludeEnd.gmk
endif # _TOOLS_GMK

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,11 +23,10 @@
# questions. # questions.
# #
# This must be the first rule include MakeFileStart.gmk
default: all
################################################################################
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
################################################################################ ################################################################################
@ -43,3 +42,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_LANGTOOLS, \
)) ))
all: $(BUILD_TOOLS_LANGTOOLS) all: $(BUILD_TOOLS_LANGTOOLS)
################################################################################
include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,17 +23,14 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC)
include MakeBase.gmk
include ProcessMarkdown.gmk
################################################################################ ################################################################################
# This makefile updates the generated build html documentation. # This makefile updates the generated build html documentation.
#
################################################################################ ################################################################################
include ProcessMarkdown.gmk
ifeq ($(ENABLE_PANDOC), false) ifeq ($(ENABLE_PANDOC), false)
$(info No pandoc executable was detected by configure) $(info No pandoc executable was detected by configure)
$(error Cannot continue) $(error Cannot continue)
@ -55,10 +52,4 @@ TARGETS += $(md_docs)
################################################################################ ################################################################################
$(eval $(call IncludeCustomExtension, UpdateBuildDocs.gmk)) include MakeFileEnd.gmk
################################################################################
all: $(TARGETS)
.PHONY: all default

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,7 @@
# questions. # questions.
# #
################################################################################ include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
################################################################################ ################################################################################
# This file is responsible for updating the generated sleef source code files # This file is responsible for updating the generated sleef source code files
@ -40,6 +32,9 @@ include Execute.gmk
# updated from upstream. # updated from upstream.
################################################################################ ################################################################################
include CopyFiles.gmk
include Execute.gmk
ifneq ($(COMPILE_TYPE), cross) ifneq ($(COMPILE_TYPE), cross)
$(error Only cross-compilation of libsleef is currently supported) $(error Only cross-compilation of libsleef is currently supported)
endif endif
@ -148,6 +143,4 @@ TARGETS := $(copy_generated_sleef_source)
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all default

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,7 @@
# questions. # questions.
# #
################################################################################ include MakeFileStart.gmk
default: all
include $(SPEC)
include MakeBase.gmk
include Execute.gmk
include JdkNativeCompilation.gmk
include ToolsJdk.gmk
################################################################################ ################################################################################
# This file is responsible for extracting the x11 native struct offsets to # This file is responsible for extracting the x11 native struct offsets to
@ -43,6 +35,10 @@ include ToolsJdk.gmk
# GensrcX11Wrappers.gmk to generate the Java code during the build. # GensrcX11Wrappers.gmk to generate the Java code during the build.
################################################################################ ################################################################################
include Execute.gmk
include JdkNativeCompilation.gmk
include $(TOPDIR)/make/ToolsJdk.gmk
ifeq ($(COMPILE_TYPE), cross) ifeq ($(COMPILE_TYPE), cross)
$(error It is not possible to update the x11wrappers when cross-compiling) $(error It is not possible to update the x11wrappers when cross-compiling)
endif endif
@ -108,6 +104,4 @@ TARGETS += $(run_wrappergen) wrapper-information
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: all default

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,10 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
################################################################################
include $(SPEC)
include MakeBase.gmk
include ZipArchive.gmk include ZipArchive.gmk
################################################################################ ################################################################################
@ -100,6 +100,4 @@ endif
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: default all

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,19 +23,16 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
################################################################################
include $(SPEC)
include MakeBase.gmk
include Modules.gmk include Modules.gmk
include ZipArchive.gmk include ZipArchive.gmk
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR))) $(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
################################################################################ ################################################################################
# Create the directory structure for src.zip using symlinks. # Create the directory structure for src.zip using symlinks.
# <module>/<package>/<file>.java # <module>/<package>/<file>.java
@ -95,8 +92,8 @@ zip: $(SRC_ZIP_SRCS)
TARGETS += zip TARGETS += zip
.PHONY: zip
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk
.PHONY: default all zip

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,11 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including CopyFiles.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Code for handling the SetupCopyFiles macro. # Code for handling the SetupCopyFiles macro.
#
################################################################################ ################################################################################
define AddFileToCopy define AddFileToCopy
@ -110,3 +107,8 @@ define SetupCopyFilesBody
) )
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,11 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including DebugInfoUtils.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Common debuginfo utility functions # Common debuginfo utility functions
#
################################################################################ ################################################################################
################################################################################ ################################################################################
@ -56,3 +53,6 @@ else
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1))) $(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif endif
endif endif
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,17 +23,13 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including Execute.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Code for handling the SetupExecute macro. # Code for handling the SetupExecute macro.
#
################################################################################ ################################################################################
################################################################################ ################################################################################
# Setup make rules for executing an arbitrary command. # Setup make rules for executing an arbitrary command.
# #
@ -196,3 +192,8 @@ define SetupExecuteBody
$1_TARGET := $$($1_FINAL_RESULT) $1_TARGET := $$($1_FINAL_RESULT)
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,11 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including FileUtils.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Common file utility functions # Common file utility functions
#
################################################################################ ################################################################################
################################################################################ ################################################################################
@ -307,3 +304,8 @@ ifeq ($(DISABLE_CACHE_FIND), true)
else else
FindFiles = $(CacheFindFiles) FindFiles = $(CacheFindFiles)
endif endif
################################################################################
include MakeIncludeEnd.gmk
endif # include guard

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,21 +23,10 @@
# questions. # questions.
# #
ifndef _FIND_TESTS_GMK include MakeIncludeStart.gmk
_FIND_TESTS_GMK := 1 ifeq ($(INCLUDE), true)
# This makefile can be called directly to just trigger generation of the cache ################################################################################
# makefile. If so, SPEC and MakeBase.gmk need to be included.
ifeq ($(FINDTESTS_STAND_ALONE), true)
include $(SPEC)
include MakeBase.gmk
endif
# Make sure this variable is not lazy evaled.
ALL_NAMED_TESTS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, common/FindTests.gmk))
# TEST_BASEDIRS might have been set by a custom extension # TEST_BASEDIRS might have been set by a custom extension
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR) TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
@ -105,4 +94,5 @@ ALL_NAMED_TESTS += failure-handler make
################################################################################ ################################################################################
endif # _FIND_TESTS_GMK endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,12 +23,10 @@
# questions. # questions.
# #
ifndef _JAR_ARCHIVE_GMK include MakeIncludeStart.gmk
_JAR_ARCHIVE_GMK := 1 ifeq ($(INCLUDE), true)
ifeq ($(_MAKEBASE_GMK), ) ################################################################################
$(error You must include MakeBase.gmk prior to including JarArchive.gmk)
endif
include MakeIO.gmk include MakeIO.gmk
@ -283,4 +281,7 @@ define SetupJarArchiveBody
$1 += $$($1_JAR) $1 += $$($1_JAR)
endef endef
endif # _JAR_ARCHIVE_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,12 +23,10 @@
# questions. # questions.
# #
ifndef _JAVA_COMPILATION_GMK include MakeIncludeStart.gmk
_JAVA_COMPILATION_GMK := 1 ifeq ($(INCLUDE), true)
ifeq ($(_MAKEBASE_GMK), ) ################################################################################
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
endif
include MakeIO.gmk include MakeIO.gmk
@ -540,4 +538,7 @@ SetupJavaCompilationCompileTarget = \
SetupJavaCompilationApiTarget = \ SetupJavaCompilationApiTarget = \
$(strip $2)/_the.$(strip $1)_pubapi $(strip $2)/_the.$(strip $1)_pubapi
endif # _JAVA_COMPILATION_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,18 +23,13 @@
# questions. # questions.
# #
ifndef _JDK_NATIVE_COMPILATION_GMK include MakeIncludeStart.gmk
_JDK_NATIVE_COMPILATION_GMK := 1 ifeq ($(INCLUDE), true)
ifeq ($(_MAKEBASE_GMK), ) ################################################################################
$(error You must include MakeBase.gmk prior to including JdkNativeCompilation.gmk)
endif
include NativeCompilation.gmk include NativeCompilation.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
FindSrcDirsForComponent += \ FindSrcDirsForComponent += \
$(call uniq, $(wildcard \ $(call uniq, $(wildcard \
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \ $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
@ -499,4 +494,7 @@ define SetupJdkExecutableBody
$$(eval $$(call SetupJdkNativeCompilation, $1)) $$(eval $$(call SetupJdkNativeCompilation, $1))
endef endef
endif # _JDK_NATIVE_COMPILATION_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,6 +23,9 @@
# questions. # questions.
# #
include $(TOPDIR)/make/common/MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains helper functions for logging. # This file contains helper functions for logging.
################################################################################ ################################################################################
@ -94,6 +97,9 @@ define ParseLogLevel
# Error: LOG contains unknown option or log level: debug-to-log. # Error: LOG contains unknown option or log level: debug-to-log.
$$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE)) $$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE))
# If "flow" is present, log makefile execution flow
$$(eval $$(call ParseLogOption, flow, LOG_FLOW))
# Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log # Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log
LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG)) LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG))
@ -122,6 +128,11 @@ endef
MAKE_LOG_VARS = $(foreach v, \ MAKE_LOG_VARS = $(foreach v, \
LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \ LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \
LOG_PROFILE_TIMES_FILE, \ LOG_PROFILE_TIMES_FILE LOG_FLOW, \
$v=$($v) \ $v=$($v) \
) )
################################################################################
endif # include guard
include $(TOPDIR)/make/common/MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,11 @@
# questions. # questions.
# #
MAKEBASE_INCLUDED := true
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# MakeBase provides the core functionality needed and used by all makefiles. It # MakeBase provides the core functionality needed and used by all makefiles. It
# should be included by all makefiles. MakeBase provides essential # should be included by all makefiles. MakeBase provides essential
@ -30,13 +35,6 @@
# execution, logging and fixpath functionality. # execution, logging and fixpath functionality.
################################################################################ ################################################################################
ifndef _MAKEBASE_GMK
_MAKEBASE_GMK := 1
ifeq ($(wildcard $(SPEC)), )
$(error MakeBase.gmk needs SPEC set to a proper spec.gmk)
endif
# By defining this pseudo target, make will automatically remove targets # By defining this pseudo target, make will automatically remove targets
# if their recipe fails so that a rebuild is automatically triggered on the # if their recipe fails so that a rebuild is automatically triggered on the
# next make invocation. # next make invocation.
@ -312,7 +310,5 @@ ExecuteWithLog = \
################################################################################ ################################################################################
# Hook to include the corresponding custom file, if present. include MakeIncludeEnd.gmk
$(eval $(call IncludeCustomExtension, common/MakeBase.gmk)) endif # include guard
endif # _MAKEBASE_GMK

View File

@ -0,0 +1,42 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeFileEnd.gmk should be included last of all in all top-level makefiles
################################################################################
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_POST_NAME := $(subst .gmk,-post.gmk, $(THIS_MAKEFILE))
$(eval $(call IncludeCustomExtension, $(CUSTOM_POST_NAME)))
endif
all: $(TARGETS)
ifeq ($(LOG_FLOW), true)
$(info :Leave $(THIS_MAKEFILE) [now executing rules])
endif
.PHONY: default all

View File

@ -0,0 +1,66 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeFileStart.gmk should be included first of all in all top-level makefiles
################################################################################
# This must be the first rule
default: $(if $(DEFAULT_TARGET), $(DEFAULT_TARGET), all)
THIS_MAKEFILE_PATH := $(firstword $(MAKEFILE_LIST))
ifeq ($(SPEC), )
$(error $(THIS_MAKEFILE_PATH): SPEC is not set)
endif
ifeq ($(wildcard $(SPEC)), )
$(error $(THIS_MAKEFILE_PATH): spec.gmk file $(SPEC) is missing)
endif
ifneq ($(words $(MAKEFILE_LIST)), 2)
$(error $(THIS_MAKEFILE_PATH): This file is not supposed to be included)
endif
# We need spec.gmk to get $(TOPDIR)
include $(SPEC)
THIS_MAKEFILE := $(patsubst make/%,%,$(patsubst $(TOPDIR)/%,%,$(THIS_MAKEFILE_PATH)))
ifeq ($(LOG_FLOW), true)
$(info :Enter $(THIS_MAKEFILE))
endif
include $(TOPDIR)/make/common/MakeBase.gmk
TARGETS :=
all:
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_PRE_NAME := $(subst .gmk,-pre.gmk, $(THIS_MAKEFILE))
$(eval $(call IncludeCustomExtension, $(CUSTOM_PRE_NAME)))
endif

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,18 +23,14 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including MakeIO.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Functions for dealing with reading and writing from makefiles. Prior to GNU # Functions for dealing with reading and writing from makefiles. Prior to GNU
# Make 4.0, this was tricky business. # Make 4.0, this was tricky business.
#
################################################################################ ################################################################################
################################################################################ ################################################################################
# ListPathsSafely can be used to print command parameters to a file. This is # ListPathsSafely can be used to print command parameters to a file. This is
# typically done if the command line length risk being too long for the # typically done if the command line length risk being too long for the
@ -241,3 +237,8 @@ else # HAS_FILE_FUNCTION = false
$$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000) $$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000)
endef endef
endif # HAS_FILE_FUNCTION endif # HAS_FILE_FUNCTION
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -0,0 +1,45 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeIncludeEnd.gmk should be included last of all in all include files
################################################################################
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_POST_NAME := $(subst .gmk,-post.gmk, $(THIS_INCLUDE))
$(eval $(call IncludeCustomExtension, $(CUSTOM_POST_NAME)))
endif
# Pop our helper name off the stack
HELPER_STACK := $(wordlist 2, $(words $(HELPER_STACK)), $(HELPER_STACK))
# Print an indented message, also counting the top-level makefile as a level
ifeq ($(LOG_FLOW), true)
$(info :$(foreach s, top $(HELPER_STACK), )Leave $(THIS_INCLUDE))
endif
# Restore the previous helper name
THIS_INCLUDE := $(firstword $(HELPER_STACK))

View File

@ -0,0 +1,83 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeIncludeStart.gmk should be included first of all in all include files
################################################################################
# Get the next to last word (by prepending a padding element)
THIS_INCLUDE_PATH := $(word $(words ${MAKEFILE_LIST}),padding ${MAKEFILE_LIST})
THIS_INCLUDE := $(patsubst $(TOPDIR)/make/%,%,$(THIS_INCLUDE_PATH))
# Print an indented message, also counting the top-level makefile as a level
ifneq ($(INCLUDE_GUARD_$(THIS_INCLUDE)), true)
THIS_INCLUDE_MSG := include
else
THIS_INCLUDE_MSG := included already
endif
ifeq ($(LOG_FLOW), true)
$(info :$(foreach s, top $(HELPER_STACK), )Enter $(THIS_INCLUDE) [$(THIS_INCLUDE_MSG)])
endif
ifneq ($(filter $(THIS_INCLUDE), $(HELPER_STACK)), )
$(error Internal makefile error: Include loop detected: $(THIS_INCLUDE) $(HELPER_STACK))
endif
ifeq ($(words $(MAKEFILE_LIST)), 2)
$(error $(THIS_INCLUDE_PATH): This file is supposed to be included)
endif
# In a preinit environment, we do not have any SPEC
ifneq ($(IS_PREINIT_ENV), true)
ifeq ($(SPEC), )
$(error $(THIS_INCLUDE_PATH): SPEC is not set)
endif
ifeq ($(wildcard $(SPEC)), )
$(error $(THIS_INCLUDE_PATH): spec.gmk file $(SPEC) is missing)
endif
ifneq ($(MAKEBASE_INCLUDED), true)
$(error $(THIS_INCLUDE_PATH): MakeBase.gmk is not included)
endif
endif
# Push our helper name onto the stack
HELPER_STACK := $(THIS_INCLUDE) $(HELPER_STACK)
# Setup an automatic include guard
ifneq ($(INCLUDE_GUARD_$(THIS_INCLUDE)), true)
INCLUDE_GUARD_$(THIS_INCLUDE) := true
INCLUDE := true
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_PRE_NAME := $(subst .gmk,-pre.gmk, $(THIS_INCLUDE))
$(eval $(call IncludeCustomExtension, $(CUSTOM_PRE_NAME)))
endif
else
INCLUDE := false
endif

View File

@ -0,0 +1,45 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeSnippetEnd.gmk should be included after including a makefile snippet
################################################################################
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_POST_NAME := $(subst .gmk,-post.gmk, $(THIS_SNIPPET))
$(eval $(call IncludeCustomExtension, $(CUSTOM_POST_NAME)))
endif
# Pop our helper name off the stack
HELPER_STACK := $(wordlist 2, $(words $(HELPER_STACK)), $(HELPER_STACK))
# Print an indented message, also counting the top-level makefile as a level
ifeq ($(LOG_FLOW), true)
$(info :$(foreach s, top $(HELPER_STACK), )Leave $(THIS_SNIPPET))
endif
# Restore the previous helper name
THIS_SNIPPET := $(firstword $(HELPER_STACK))

View File

@ -0,0 +1,46 @@
#
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# MakeSnippetStart.gmk should be included before including a makefile snippet
################################################################################
ifeq ($(THIS_SNIPPET), )
$(error Internal makefile error: THIS_SNIPPET is not defined)
endif
# Print an indented message, also counting the top-level makefile as a level
ifeq ($(LOG_FLOW), true)
$(info :$(foreach s, top $(HELPER_STACK), )Enter $(THIS_SNIPPET) [snippet])
endif
# Push our helper name onto the stack
HELPER_STACK := $(THIS_SNIPPET) $(HELPER_STACK)
# Hook to include the corresponding custom file, if present.
ifneq ($(NO_CUSTOM_EXTENSIONS), true)
CUSTOM_PRE_NAME := $(subst .gmk,-pre.gmk, $(THIS_SNIPPET))
$(eval $(call IncludeCustomExtension, $(CUSTOM_PRE_NAME)))
endif

View File

@ -23,8 +23,8 @@
# questions. # questions.
# #
ifndef _MODULES_GMK include MakeIncludeStart.gmk
_MODULES_GMK := 1 ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# Setup module sets for classloaders # Setup module sets for classloaders
@ -45,11 +45,6 @@ include $(TOPDIR)/make/conf/docs-modules.conf
include $(TOPDIR)/make/conf/build-module-sets.conf include $(TOPDIR)/make/conf/build-module-sets.conf
################################################################################
# Hook to include the corresponding custom file, if present.
# Allowing MODULE list extensions setup above.
$(eval $(call IncludeCustomExtension, common/Modules.gmk))
################################################################################ ################################################################################
# Depending on the configuration, we might need to filter out some modules that # Depending on the configuration, we might need to filter out some modules that
# normally should have been included # normally should have been included
@ -316,4 +311,5 @@ endef
################################################################################ ################################################################################
endif # _MODULES_GMK endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,19 +23,15 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This is the top-level entry point for our native compilation and linking. # This is the top-level entry point for our native compilation and linking.
# It contains the SetupNativeCompilation macro, but is supported by helper # It contains the SetupNativeCompilation macro, but is supported by helper
# macros in the make/common/native directory. # macros in the make/common/native directory.
################################################################################ ################################################################################
ifndef _NATIVE_COMPILATION_GMK
_NATIVE_COMPILATION_GMK := 1
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
endif
include MakeIO.gmk include MakeIO.gmk
include native/CompileFile.gmk include native/CompileFile.gmk
include native/DebugSymbols.gmk include native/DebugSymbols.gmk
@ -223,6 +219,7 @@ define SetupNativeCompilationBody
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true) ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
# Override all targets (this is a hack) # Override all targets (this is a hack)
$1 := $$($1_ALL_OBJS_JSON) $$($1_LDFLAGS_FILE) $1 := $$($1_ALL_OBJS_JSON) $$($1_LDFLAGS_FILE)
TARGETS := $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
endif endif
endef endef
@ -409,4 +406,7 @@ define ImportDependencyFile
endif endif
endef endef
endif # _NATIVE_COMPILATION_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,4 +1,4 @@
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -22,9 +22,10 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including ProcessMarkdown.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################
include TextFileProcessing.gmk include TextFileProcessing.gmk
@ -181,3 +182,8 @@ define SetupProcessMarkdownBody
) )
endif endif
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,10 @@
# questions. # questions.
# #
ifndef _TEST_FILES_COMPILATION_GMK include MakeIncludeStart.gmk
_TEST_FILES_COMPILATION_GMK := 1 ifeq ($(INCLUDE), true)
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including TestFilesCompilation.gmk)
endif
################################################################################
include JdkNativeCompilation.gmk include JdkNativeCompilation.gmk
@ -142,4 +139,7 @@ define SetupTestFilesCompilationBody
endef endef
endif # _TEST_FILES_COMPILATION_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,10 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including TextFileProcessing.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################
# Helper function for SetupTextFileProcessing; adds a rule for a single file # Helper function for SetupTextFileProcessing; adds a rule for a single file
# to be processed. # to be processed.
@ -222,3 +223,8 @@ define SetupTextFileProcessingBody
endif endif
endif endif
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,11 @@
# questions. # questions.
# #
ifeq ($(_MAKEBASE_GMK), ) include MakeIncludeStart.gmk
$(error You must include MakeBase.gmk prior to including Utils.gmk) ifeq ($(INCLUDE), true)
endif
################################################################################ ################################################################################
#
# Basic utility functions available to MakeBase.gmk itself # Basic utility functions available to MakeBase.gmk itself
#
################################################################################ ################################################################################
# String equals # String equals
@ -398,3 +395,8 @@ FilterExcludedTranslations = \
), \ ), \
$1 \ $1 \
)) ))
################################################################################
include MakeIncludeEnd.gmk
endif # include guard

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,13 @@
# questions. # questions.
# #
ifndef _ZIP_ARCHIVE_GMK include MakeIncludeStart.gmk
_ZIP_ARCHIVE_GMK := 1 ifeq ($(INCLUDE), true)
################################################################################
# Depends on build tools for MakeZipReproducible # Depends on build tools for MakeZipReproducible
include ../ToolsJdk.gmk include $(TOPDIR)/make/ToolsJdk.gmk
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including ZipArchive.gmk)
endif
# Setup make rules for creating a zip archive. # Setup make rules for creating a zip archive.
# #
@ -192,4 +190,7 @@ define SetupZipArchiveBody
$1 += $$($1_ZIP) $1 += $$($1_ZIP)
endef endef
endif # _ZIP_ARCHIVE_GMK ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,11 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include CopyFiles.gmk include CopyFiles.gmk
LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE) LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
@ -88,3 +93,8 @@ define SetupCopyLegalFilesBody
) \ ) \
) )
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,15 @@
# questions. # questions.
# #
include JavaCompilation.gmk include MakeIncludeStart.gmk
include ToolsJdk.gmk ifeq ($(INCLUDE), true)
################################################################################
include JavaCompilation.gmk
include $(TOPDIR)/make/ToolsJdk.gmk
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,14 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include Execute.gmk include Execute.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
include ToolsJdk.gmk include $(TOPDIR)/make/ToolsJdk.gmk
################################################################################ ################################################################################
# Sets up a rule that creates a version.properties file in the gensrc output # Sets up a rule that creates a version.properties file in the gensrc output
@ -41,3 +46,8 @@ define SetupVersionProperties
$$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2) $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,8 @@
# questions. # questions.
# #
include MakeFileStart.gmk
################################################################################ ################################################################################
# This file makes modifications to module-info.java files based on the build # This file makes modifications to module-info.java files based on the build
# configuration. # configuration.
@ -41,13 +43,8 @@
# #
# The modified module-info.java files are put in the gensrc directory where # The modified module-info.java files are put in the gensrc directory where
# they will automatically override the static versions in the src tree. # they will automatically override the static versions in the src tree.
#
################################################################################ ################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include Modules.gmk include Modules.gmk
################################################################################ ################################################################################
@ -101,4 +98,4 @@ endif
################################################################################ ################################################################################
all: $(TARGETS) include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,13 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
# This file defines macros that sets up rules for generating java classes # This file defines macros that sets up rules for generating java classes
# from resource bundle properties files. # from resource bundle properties files.
################################################################################
include JavaCompilation.gmk include JavaCompilation.gmk
@ -142,3 +147,8 @@ define SetupCompilePropertiesBody
$1 += $$($1_JAVAS) $$($1_TARGET) $$($1_HK) $1 += $$($1_JAVAS) $$($1_TARGET) $$($1_HK)
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,11 +23,16 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include CopyFiles.gmk include CopyFiles.gmk
include JdkNativeCompilation.gmk include JdkNativeCompilation.gmk
include Modules.gmk include Modules.gmk
include ProcessMarkdown.gmk include ProcessMarkdown.gmk
include ToolsJdk.gmk include $(TOPDIR)/make/ToolsJdk.gmk
LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \ LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
@ -234,3 +239,8 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
endif endif
endif endif
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,4 +23,14 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include JdkNativeCompilation.gmk include JdkNativeCompilation.gmk
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,11 +23,15 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to compiling a single native source # This file contains functionality related to compiling a single native source
# file (C, C++ or Objective-C) into an object file. It also harbours related # file (C, C++ or Objective-C) into an object file. It also harbours related
# functionality for generating PCH (precompiled headers) and Windows resource # functionality for generating PCH (precompiled headers) and Windows resource
# files. # files.
################################################################################
################################################################################ ################################################################################
# Creates a recipe that creates a compile_commands.json fragment. Remove any # Creates a recipe that creates a compile_commands.json fragment. Remove any
@ -352,3 +356,8 @@ define CreateWindowsResourceFile
> $$($1_RES_DEPS_TARGETS_FILE) > $$($1_RES_DEPS_TARGETS_FILE)
endif endif
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,12 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to native debug symbol handling. # This file contains functionality related to native debug symbol handling.
################################################################################
################################################################################ ################################################################################
define CreateDebugSymbols define CreateDebugSymbols
@ -98,3 +102,8 @@ define CreateDebugSymbols
endif # $1_DEBUG_SYMBOLS != false endif # $1_DEBUG_SYMBOLS != false
endif # COPY_DEBUG_SYMBOLS endif # COPY_DEBUG_SYMBOLS
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,14 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to setting up compiler and linker # This file contains functionality related to setting up compiler and linker
# flags, based on various more abstract sources of compilation description, # flags, based on various more abstract sources of compilation description,
# like optimization level. # like optimization level.
################################################################################
################################################################################ ################################################################################
# $1 is the prefix of the file to be compiled # $1 is the prefix of the file to be compiled
@ -223,3 +227,8 @@ define SetupLinkerFlags
$1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \ $1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \
$$($1_LIBS_$(TOOLCHAIN_TYPE)) $$($1_LIBS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)) $$($1_LIBS_$(TOOLCHAIN_TYPE)) $$($1_LIBS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,13 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to linking a native binary; # This file contains functionality related to linking a native binary;
# creating either a dynamic library, a static library or an executable. # creating either a dynamic library, a static library or an executable.
################################################################################
################################################################################ ################################################################################
# GetEntitlementsFile # GetEntitlementsFile
@ -212,3 +216,8 @@ define CreateDynamicLibraryOrExecutable
$$(ECHO) $$($1_ALL_LD_ARGS) > $$@ $$(ECHO) $$($1_ALL_LD_ARGS) > $$@
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,13 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to linking a native binary; # This file contains functionality related to linking a native binary;
# creating either a dynamic library, a static library or an executable. # creating either a dynamic library, a static library or an executable.
################################################################################
################################################################################ ################################################################################
define CreateLinkedResultMicrosoft define CreateLinkedResultMicrosoft
@ -114,3 +118,8 @@ define CreateDynamicLibraryOrExecutableMicrosoft
-outputresource:$$@;#1 -outputresource:$$@;#1
endif endif
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,9 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# This file contains functionality related to handling paths for source files # This file contains functionality related to handling paths for source files
# and object files. This is complicated by the fact that we usually, but not # and object files. This is complicated by the fact that we usually, but not
@ -31,6 +34,7 @@
# "@-files", which we normally use to avoid hitting command line length limits. # "@-files", which we normally use to avoid hitting command line length limits.
# Finally this file contains functionality for locating all source code files # Finally this file contains functionality for locating all source code files
# that should be included in the compilation. # that should be included in the compilation.
################################################################################
################################################################################ ################################################################################
# When absolute paths are not allowed in the output, and the compiler does not # When absolute paths are not allowed in the output, and the compiler does not
@ -240,3 +244,8 @@ define SetupObjectFileList
endif endif
endif endif
endef endef
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,11 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include CopyFiles.gmk include CopyFiles.gmk
# Copy all built libraries into exploded jdk # Copy all built libraries into exploded jdk
@ -57,3 +62,8 @@ else
TARGETS += $(COPY_LIBS) $(LINK_LIBS) TARGETS += $(COPY_LIBS) $(LINK_LIBS)
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,11 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
ifeq ($(JVM_VARIANT), ) ifeq ($(JVM_VARIANT), )
$(error This makefile must be called with JVM_VARIANT set) $(error This makefile must be called with JVM_VARIANT set)
endif endif
@ -46,3 +51,8 @@ check-jvm-feature = \
$(if $(filter-out $(VALID_JVM_FEATURES), $1), \ $(if $(filter-out $(VALID_JVM_FEATURES), $1), \
$(error Internal error: Invalid feature tested: $1)) \ $(error Internal error: Invalid feature tested: $1)) \
$(if $(filter $1, $(JVM_FEATURES_$(JVM_VARIANT))), true, false)) $(if $(filter $1, $(JVM_FEATURES_$(JVM_VARIANT))), true, false))
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,17 +23,16 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
################################################################################
include $(SPEC)
include MakeBase.gmk
include Execute.gmk include Execute.gmk
include HotspotCommon.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include JdkNativeCompilation.gmk include JdkNativeCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
include HotspotCommon.gmk
# The real work is done in these files # The real work is done in these files
include gensrc/GensrcJfr.gmk include gensrc/GensrcJfr.gmk
@ -41,8 +40,6 @@ include gensrc/GensrcAdlc.gmk
include gensrc/GensrcDtrace.gmk include gensrc/GensrcDtrace.gmk
include gensrc/GensrcJvmti.gmk include gensrc/GensrcJvmti.gmk
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk))
# While technically the rules below are "gendata" which can be done in parallel # While technically the rules below are "gendata" which can be done in parallel
# with native compilation, let's keep it here for simplicity. # with native compilation, let's keep it here for simplicity.
@ -63,6 +60,6 @@ $(CHMOD_HOTSPOT_LAUNCHER): $(CREATE_HOTSPOT_LAUNCHER)
TARGETS += $(CREATE_HOTSPOT_LAUNCHER) $(CHMOD_HOTSPOT_LAUNCHER) TARGETS += $(CREATE_HOTSPOT_LAUNCHER) $(CHMOD_HOTSPOT_LAUNCHER)
all: $(TARGETS) ################################################################################
.PHONY: all include MakeFileEnd.gmk

View File

@ -23,7 +23,10 @@
# questions. # questions.
# #
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcAdlc.gmk)) include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
ifeq ($(call check-jvm-feature, compiler2), true) ifeq ($(call check-jvm-feature, compiler2), true)
@ -260,3 +263,8 @@ ifeq ($(call check-jvm-feature, compiler2), true)
TARGETS += $(ADLC_GENERATED_FILES) TARGETS += $(ADLC_GENERATED_FILES)
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,8 +23,12 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# Gensrc support for dtrace. The files generated here are included by dtrace.hpp # Gensrc support for dtrace. The files generated here are included by dtrace.hpp
################################################################################
ifeq ($(call check-jvm-feature, dtrace), true) ifeq ($(call check-jvm-feature, dtrace), true)
@ -52,3 +56,8 @@ ifeq ($(call check-jvm-feature, dtrace), true)
$(DTRACE_GENSRC_DIR)/%.h, $(wildcard $(DTRACE_SOURCE_DIR)/*.d)) $(DTRACE_GENSRC_DIR)/%.h, $(wildcard $(DTRACE_SOURCE_DIR)/*.d))
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,12 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# Setup make rules for JFR gensrc file generation. # Setup make rules for JFR gensrc file generation.
# ################################################################################
include $(TOPDIR)/make/ToolsHotspot.gmk include $(TOPDIR)/make/ToolsHotspot.gmk
@ -44,3 +47,8 @@ $(eval $(call SetupExecute, jfr_gen_headers, \
)) ))
TARGETS += $(jfr_gen_headers) TARGETS += $(jfr_gen_headers)
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,12 +23,14 @@
# questions. # questions.
# #
include CopyFiles.gmk include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
################################################################################ ################################################################################
# Build tools needed for the JVMTI source code generation # Build tools needed for the JVMTI source code generation
################################################################################
include CopyFiles.gmk
# FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed. # FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed.
JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
@ -120,3 +122,8 @@ ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS)))
TARGETS += $(COPY_JVMTI_H) TARGETS += $(COPY_JVMTI_H)
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -22,8 +22,10 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileGtest.gmk)) ################################################################################
GTEST_TEST_SRC += $(TOPDIR)/test/hotspot/gtest GTEST_TEST_SRC += $(TOPDIR)/test/hotspot/gtest
@ -159,3 +161,6 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
TARGETS += $(BUILD_GTEST_LAUNCHER) TARGETS += $(BUILD_GTEST_LAUNCHER)
################################################################################ ################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,6 +23,11 @@
# questions. # questions.
# #
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################
include CopyFiles.gmk include CopyFiles.gmk
# Include support files that will setup compiler flags due to the selected # Include support files that will setup compiler flags due to the selected
@ -359,3 +364,8 @@ ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
$(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o))) $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
endif endif
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,14 +23,12 @@
# questions. # questions.
# #
default: all include MakeFileStart.gmk
include $(SPEC) ################################################################################
include MakeBase.gmk
include JdkNativeCompilation.gmk
include HotspotCommon.gmk include HotspotCommon.gmk
include JdkNativeCompilation.gmk
include lib/CompileJvm.gmk include lib/CompileJvm.gmk
ifneq ($(GTEST_FRAMEWORK_SRC), ) ifneq ($(GTEST_FRAMEWORK_SRC), )
@ -41,6 +39,6 @@ endif
include CopyToExplodedJdk.gmk include CopyToExplodedJdk.gmk
all: $(TARGETS) ################################################################################
.PHONY: all include MakeFileEnd.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,11 +23,15 @@
# questions. # questions.
# #
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFeatures.gmk)) ################################################################################
include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# Setup CFLAGS and EXCLUDES for the libjvm compilation, depending on which # Setup CFLAGS and EXCLUDES for the libjvm compilation, depending on which
# jvm features are selected for this jvm variant. # jvm features are selected for this jvm variant.
################################################################################
ifeq ($(call check-jvm-feature, compiler1), true) ifeq ($(call check-jvm-feature, compiler1), true)
JVM_CFLAGS_FEATURES += -DCOMPILER1 JVM_CFLAGS_FEATURES += -DCOMPILER1
@ -280,3 +284,8 @@ ifeq ($(call check-jvm-feature, opt-size), true)
BUILD_LIBJVM_systemDictionary.cpp_CXXFLAGS := -fno-optimize-sibling-calls BUILD_LIBJVM_systemDictionary.cpp_CXXFLAGS := -fno-optimize-sibling-calls
endif endif
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

View File

@ -23,10 +23,12 @@
# questions. # questions.
# #
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmFlags.gmk)) include MakeIncludeStart.gmk
ifeq ($(INCLUDE), true)
################################################################################ ################################################################################
# Setup JVM_CFLAGS. These are shared between GensrcDtrace.gmk and CompileJvm.gmk. # Setup JVM_CFLAGS. These are shared between GensrcDtrace.gmk and CompileJvm.gmk.
################################################################################
# This variable may be added to by a custom extension # This variable may be added to by a custom extension
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot
@ -99,3 +101,8 @@ endif
ifeq ($(ENABLE_COMPATIBLE_CDS_ALIGNMENT), true) ifeq ($(ENABLE_COMPATIBLE_CDS_ALIGNMENT), true)
JVM_CFLAGS += -DCOMPATIBLE_CDS_ALIGNMENT JVM_CFLAGS += -DCOMPATIBLE_CDS_ALIGNMENT
endif endif
################################################################################
endif # include guard
include MakeIncludeEnd.gmk

Some files were not shown because too many files have changed in this diff Show More