Skip to content

Commit

Permalink
8326947: Minimize MakeBase.gmk
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Apr 11, 2024
1 parent 2e3682a commit 1606187
Show file tree
Hide file tree
Showing 43 changed files with 577 additions and 482 deletions.
5 changes: 4 additions & 1 deletion make/Bundles.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
Expand Down Expand Up @@ -28,6 +28,9 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include MakeIO.gmk

PRODUCT_TARGETS :=
LEGACY_TARGETS :=
TEST_TARGETS :=
Expand Down
2 changes: 2 additions & 0 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include Modules.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/CompileToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/CopyImportModules.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
Expand Down
2 changes: 2 additions & 0 deletions make/CopyInterimTZDB.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

##########################################################################################

### TZDB tool needs files from java.time.zone package
Expand Down
2 changes: 2 additions & 0 deletions make/CreateJmods.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ModuleTools.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/GenerateLinkOptData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk

################################################################################
Expand Down
2 changes: 2 additions & 0 deletions make/GraalBuilderImage.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

################################################################################

TARGETS :=
Expand Down
2 changes: 2 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include Utils.gmk
Expand Down
25 changes: 25 additions & 0 deletions make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,31 @@ else # $(HAS_SPEC)=true
endef
endif

##############################################################################
# Functions for timers
##############################################################################

# Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times

# Record starting time for build of a sub repository.
define RecordStartTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
endef

# Record ending time and calculate the difference and store it in a
# easy to read format. Handles builds that cross midnight. Expects
# that a build will never take 24 hours or more.
define RecordEndTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
endef

define StartGlobalTimer
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
$(MKDIR) -p $(BUILDTIMESDIR) && \
Expand Down
2 changes: 2 additions & 0 deletions make/JrtfsJar.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include JarArchive.gmk
include TextFileProcessing.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/MacBundles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include TextFileProcessing.gmk

default: bundles
Expand Down
2 changes: 2 additions & 0 deletions make/ModuleWrapper.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

MODULE_SRC := $(TOPDIR)/src/$(MODULE)

# All makefiles should add the targets to be built to this variable.
Expand Down
12 changes: 11 additions & 1 deletion make/SourceRevision.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
Expand Down Expand Up @@ -41,6 +41,16 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))

STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev

# Locate all sourcecode repositories included in the forest, as absolute paths
FindAllReposAbs = \
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
)))))

# Locate all sourcecode repositories included in the forest, as relative paths
FindAllReposRel = \
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))

USE_SCM := false
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
USE_SCM := true
Expand Down
2 changes: 2 additions & 0 deletions make/StaticLibsImage.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Modules.gmk

ALL_MODULES = $(call FindAllModules)
Expand Down
4 changes: 4 additions & 0 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@ BUILD_JAR = @FIXPATH@ $(BUILD_JDK)/bin/jar

DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@

# A file containing a way to uniquely identify the source code revision that
# the build was created from
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker

# Interim langtools modules and arguments
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
Expand Down
Loading

1 comment on commit 1606187

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.