Skip to content

Commit 1b19730

Browse files
committed
8349515: [REDO] Framework for tracing makefile inclusion and parsing
Reviewed-by: erikj
1 parent 05b2f1a commit 1b19730

File tree

273 files changed

+2214
-1054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+2214
-1054
lines changed

.github/actions/get-gtest/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ runs:
4949
- name: 'Export path to where GTest is installed'
5050
id: path-name
5151
run: |
52-
# Export the path
53-
echo 'path=gtest' >> $GITHUB_OUTPUT
52+
# Export the absolute path
53+
echo "path=`pwd`/gtest" >> $GITHUB_OUTPUT
5454
shell: bash

.github/actions/get-jtreg/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ runs:
4949
- name: 'Export path to where JTReg is installed'
5050
id: path-name
5151
run: |
52-
# Export the path
53-
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
52+
# Export the absolute path
53+
echo "path=`pwd`/jtreg/installed" >> $GITHUB_OUTPUT
5454
shell: bash

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
5959
else
6060
makefile_path := $(lastword $(MAKEFILE_LIST))
6161
endif
62-
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
62+
TOPDIR := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
6363

6464
# ... and then we can include the real makefile to bootstrap the build
65-
include $(topdir)/make/PreInit.gmk
65+
include $(TOPDIR)/make/PreInit.gmk

make/Bundles.gmk

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,9 @@
2323
# questions.
2424
#
2525

26-
default: all
26+
include MakeFileStart.gmk
2727

28-
include $(SPEC)
29-
include MakeBase.gmk
28+
################################################################################
3029

3130
include CopyFiles.gmk
3231
include MakeIO.gmk
@@ -43,8 +42,6 @@ ifeq ($(call isBuildOs, windows), true)
4342
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
4443
endif
4544

46-
# Hook to include the corresponding custom file, if present.
47-
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
4845
################################################################################
4946
# BUNDLE : Name of bundle to create
5047
# FILES : Files in BASE_DIRS to add to bundle
@@ -502,11 +499,6 @@ endif
502499

503500
################################################################################
504501

505-
# Hook to include the corresponding custom file, if present.
506-
$(eval $(call IncludeCustomExtension, Bundles.gmk))
507-
508-
################################################################################
509-
510502
product-bundles: $(PRODUCT_TARGETS)
511503
legacy-bundles: $(LEGACY_TARGETS)
512504
test-bundles: $(TEST_TARGETS)
@@ -517,6 +509,10 @@ static-libs-bundles: $(STATIC_LIBS_TARGETS)
517509
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
518510
jcov-bundles: $(JCOV_TARGETS)
519511

520-
.PHONY: all default product-bundles test-bundles \
512+
.PHONY: product-bundles test-bundles \
521513
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
522514
static-libs-bundles static-libs-graal-bundles jcov-bundles
515+
516+
################################################################################
517+
518+
include MakeFileEnd.gmk

make/CompileCommands.gmk

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,9 @@
2323
# questions.
2424
#
2525

26-
default: all
26+
include MakeFileStart.gmk
2727

28-
include $(SPEC)
29-
include MakeBase.gmk
28+
################################################################################
3029

3130
# When FIXPATH is set, let it process the file to make sure all paths are usable
3231
# by system native tools. The FIXPATH tool assumes arguments preceded by an @
@@ -50,6 +49,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
5049

5150
TARGETS += $(OUTPUTDIR)/compile_commands.json
5251

53-
all: $(TARGETS)
52+
################################################################################
5453

55-
.PHONY: all
54+
include MakeFileEnd.gmk

make/CompileDemos.gmk

+5-14
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,17 @@
2323
# questions.
2424
#
2525

26+
include MakeFileStart.gmk
27+
2628
################################################################################
2729
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
2830
################################################################################
2931

30-
default: all
31-
32-
include $(SPEC)
33-
include MakeBase.gmk
34-
3532
include CopyFiles.gmk
3633
include JavaCompilation.gmk
3734
include TextFileProcessing.gmk
3835
include ZipArchive.gmk
3936

40-
# Hook to include the corresponding custom file, if present.
41-
$(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
42-
4337
# Prepare the find cache.
4438
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
4539

@@ -264,11 +258,8 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
264258
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
265259
endif
266260

267-
################################################################################
268-
# Hook to include the corresponding custom file, if present.
269-
$(eval $(call IncludeCustomExtension, CompileDemos-post.gmk))
270-
271-
all: $(TARGETS)
272261
images: $(IMAGES_TARGETS)
273262

274-
.PHONY: all
263+
################################################################################
264+
265+
include MakeFileEnd.gmk

make/CompileInterimLangtools.gmk

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,9 @@
2323
# questions.
2424
#
2525

26-
# This must be the first rule
27-
default: all
26+
include MakeFileStart.gmk
2827

29-
include $(SPEC)
30-
include MakeBase.gmk
28+
################################################################################
3129

3230
include CopyFiles.gmk
3331
include JavaCompilation.gmk
@@ -148,5 +146,4 @@ TARGETS += $(BUILD_JAVAC_SERVER)
148146

149147
################################################################################
150148

151-
152-
all: $(TARGETS)
149+
include MakeFileEnd.gmk

make/CompileJavaModules.gmk

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,12 @@
2323
# questions.
2424
#
2525

26-
# This must be the first rule
27-
default: all
26+
include MakeFileStart.gmk
27+
28+
################################################################################
2829

29-
include $(SPEC)
30-
include MakeBase.gmk
31-
include Modules.gmk
3230
include JavaCompilation.gmk
31+
include Modules.gmk
3332

3433
################################################################################
3534
# If this is an imported module that has prebuilt classes, only compile
@@ -86,7 +85,15 @@ CreateHkTargets = \
8685
################################################################################
8786
# Include module specific build settings
8887

89-
-include Java.gmk
88+
THIS_SNIPPET := modules/$(MODULE)/Java.gmk
89+
90+
ifneq ($(wildcard $(THIS_SNIPPET)), )
91+
include MakeSnippetStart.gmk
92+
93+
include $(THIS_SNIPPET)
94+
95+
include MakeSnippetEnd.gmk
96+
endif
9097

9198
################################################################################
9299
# Setup the main compilation
@@ -148,6 +155,4 @@ endif
148155

149156
################################################################################
150157

151-
all: $(TARGETS)
152-
153-
.PHONY: all
158+
include MakeFileEnd.gmk

make/CompileModuleTools.gmk

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,12 @@
2323
# questions.
2424
#
2525

26-
default: all
27-
28-
include $(SPEC)
29-
include MakeBase.gmk
30-
include JavaCompilation.gmk
26+
include MakeFileStart.gmk
3127

3228
################################################################################
3329

30+
include JavaCompilation.gmk
31+
3432
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
3533

3634
# When using an external BUILDJDK, make it possible to shortcut building of
@@ -64,4 +62,4 @@ TARGETS += $(BUILD_JIGSAW_TOOLS)
6462

6563
################################################################################
6664

67-
all: $(TARGETS)
65+
include MakeFileEnd.gmk

make/CompileToolsHotspot.gmk

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,19 +23,12 @@
2323
# questions.
2424
#
2525

26-
# This must be the first rule
27-
default: all
26+
include MakeFileStart.gmk
2827

29-
include $(SPEC)
30-
include MakeBase.gmk
28+
################################################################################
3129

3230
include JavaCompilation.gmk
3331

34-
TARGETS :=
35-
36-
# Hook to include the corresponding custom file, if present.
37-
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
38-
3932
################################################################################
4033
# Build tools needed for the JFR source code generation
4134

@@ -51,7 +44,6 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
5144

5245
TARGETS += $(BUILD_TOOLS_HOTSPOT)
5346

47+
################################################################################
5448

55-
all: $(TARGETS)
56-
57-
.PHONY: all
49+
include MakeFileEnd.gmk

make/CompileToolsJdk.gmk

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,21 +23,14 @@
2323
# questions.
2424
#
2525

26-
default: all
26+
include MakeFileStart.gmk
2727

28-
include $(SPEC)
29-
include MakeBase.gmk
28+
################################################################################
3029

3130
include CopyFiles.gmk
3231
include JavaCompilation.gmk
3332
include TextFileProcessing.gmk
3433

35-
################################################################################
36-
37-
$(eval $(call IncludeCustomExtension, CompileTools.gmk))
38-
39-
################################################################################
40-
4134
# Use += to be able to add to this from a custom extension
4235
BUILD_TOOLS_SRC_DIRS += \
4336
$(TOPDIR)/make/jdk/src/classes \
@@ -160,4 +153,6 @@ ifeq ($(ENABLE_PANDOC), true)
160153
TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP)
161154
endif
162155

163-
all: $(TARGETS)
156+
################################################################################
157+
158+
include MakeFileEnd.gmk

make/CopyImportModules.gmk

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,12 @@
2323
# questions.
2424
#
2525

26+
include MakeFileStart.gmk
27+
28+
################################################################################
2629
# This makefile is called for every imported module to copy the non class
2730
# contents into the exploded jdk image.
28-
29-
default: all
30-
31-
include $(SPEC)
32-
include MakeBase.gmk
31+
################################################################################
3332

3433
include CopyFiles.gmk
3534

@@ -103,4 +102,6 @@ ifneq ($(CONF_DIR), )
103102
TARGETS += $(COPY_CONF)
104103
endif
105104

106-
all: $(TARGETS)
105+
################################################################################
106+
107+
include MakeFileEnd.gmk

0 commit comments

Comments
 (0)