From 93649f454674b418acc8ed088d988fff10d59eb8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 28 Oct 2025 22:40:17 +0100 Subject: [PATCH 1/7] build: split overlong .PHONY statements --- Makefile | 53 +++++++++++++++++++++++++++++++++++--------- deps/tools/common.mk | 28 ++++++++++++++++++++--- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7ae414637cdda..db4fd98aa007d 100644 --- a/Makefile +++ b/Makefile @@ -699,16 +699,49 @@ distcleanall: cleanall @-$(MAKE) -C $(BUILDROOT)/doc cleanall .FORCE: -.PHONY: .FORCE default debug release check-whitespace fix-whitespace release-candidate \ - julia-debug julia-release julia-stdlib julia-deps julia-deps-libs \ - julia-cli-release julia-cli-debug julia-src-release julia-src-debug \ - julia-symlink julia-base julia-sysimg julia-sysimg-ji julia-sysimg-release julia-sysimg-debug \ - test testall testall1 test \ - clean distcleanall cleanall $(CLEAN_TARGETS) \ - run-julia run-julia-debug run-julia-release run \ - install binary-dist light-source-dist.tmp light-source-dist \ - dist full-source-dist source-dist \ - compile-database + +.PHONY: .FORCE +.PHONY: $(CLEAN_TARGETS) +.PHONY: binary-dist +.PHONY: check-whitespace +.PHONY: clean +.PHONY: cleanall +.PHONY: compile-database +.PHONY: debug +.PHONY: default +.PHONY: dist +.PHONY: distcleanall +.PHONY: fix-whitespace +.PHONY: full-source-dist +.PHONY: install +.PHONY: julia-base +.PHONY: julia-cli-debug +.PHONY: julia-cli-release +.PHONY: julia-debug +.PHONY: julia-deps +.PHONY: julia-deps-libs +.PHONY: julia-release +.PHONY: julia-src-debug +.PHONY: julia-src-release +.PHONY: julia-stdlib +.PHONY: julia-symlink +.PHONY: julia-sysimg +.PHONY: julia-sysimg-debug +.PHONY: julia-sysimg-ji +.PHONY: julia-sysimg-release +.PHONY: light-source-dist +.PHONY: light-source-dist.tmp +.PHONY: release +.PHONY: release-candidate +.PHONY: run +.PHONY: run-julia +.PHONY: run-julia-debug +.PHONY: run-julia-release +.PHONY: source-dist +.PHONY: test +.PHONY: test +.PHONY: testall +.PHONY: testall1 # Generate compilation database (leverages existing clang tooling setup) compile-database: diff --git a/deps/tools/common.mk b/deps/tools/common.mk index b7ebc39169221..0fb2f45cfb88f 100644 --- a/deps/tools/common.mk +++ b/deps/tools/common.mk @@ -289,6 +289,28 @@ endif ## phony targets ## -.PHONY: default get extract configure compile fastcheck check install uninstall reinstall cleanall distcleanall version-check \ - get-* extract-* configure-* compile-* fastcheck-* check-* install-* uninstall-* reinstall-* clean-* distclean-* \ - update-llvm +.PHONY: check +.PHONY: check-* +.PHONY: clean-* +.PHONY: cleanall +.PHONY: compile +.PHONY: compile-* +.PHONY: configure +.PHONY: configure-* +.PHONY: default +.PHONY: distclean-* +.PHONY: distcleanall +.PHONY: extract +.PHONY: extract-* +.PHONY: fastcheck +.PHONY: fastcheck-* +.PHONY: get +.PHONY: get-* +.PHONY: install +.PHONY: install-* +.PHONY: reinstall +.PHONY: reinstall-* +.PHONY: uninstall +.PHONY: uninstall-* +.PHONY: update-llvm +.PHONY: version-check From 0e8b965dae720f1883eaea0773f7c980946bb663 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 28 Oct 2025 22:41:28 +0100 Subject: [PATCH 2/7] Delete some redundant .PHONY statements --- Makefile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Makefile b/Makefile index db4fd98aa007d..c2d72bab987e8 100644 --- a/Makefile +++ b/Makefile @@ -709,7 +709,6 @@ distcleanall: cleanall .PHONY: compile-database .PHONY: debug .PHONY: default -.PHONY: dist .PHONY: distcleanall .PHONY: fix-whitespace .PHONY: full-source-dist @@ -719,27 +718,19 @@ distcleanall: cleanall .PHONY: julia-cli-release .PHONY: julia-debug .PHONY: julia-deps -.PHONY: julia-deps-libs .PHONY: julia-release .PHONY: julia-src-debug .PHONY: julia-src-release .PHONY: julia-stdlib .PHONY: julia-symlink -.PHONY: julia-sysimg .PHONY: julia-sysimg-debug -.PHONY: julia-sysimg-ji .PHONY: julia-sysimg-release .PHONY: light-source-dist .PHONY: light-source-dist.tmp .PHONY: release .PHONY: release-candidate -.PHONY: run -.PHONY: run-julia -.PHONY: run-julia-debug -.PHONY: run-julia-release .PHONY: source-dist .PHONY: test -.PHONY: test .PHONY: testall .PHONY: testall1 From 87fc33480e89a0c48b0d35a4d7493a4a4545d6f3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 28 Oct 2025 22:52:12 +0100 Subject: [PATCH 3/7] build: move .PHONY statements next to the targets they affect This way it is much easier to see which targets are PHONY and which aren't (and thus also which are not but should be) --- Makefile | 66 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index c2d72bab987e8..7fe9436ab0cb9 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ endif VERSDIR := v`cut -d. -f1-2 < $(JULIAHOME)/VERSION` +.PHONY: default default: $(JULIA_BUILD_MODE) # contains either "debug" or "release" all: debug release @@ -65,6 +66,7 @@ julia_flisp.boot.inc.phony: julia-deps $(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print) @$(MAKE) docs +.PHONY: julia-symlink julia-symlink: julia-cli-$(JULIA_BUILD_MODE) ifeq ($(OS),WINNT) printf '@"%%~dp0/%s" %%*\n' "$$(printf "%s\n" '$(call rel_path,$(BUILDROOT),$(JULIA_EXECUTABLE))')" | tr / '\\' > $(BUILDROOT)/julia.bat @@ -82,13 +84,16 @@ TOP_LEVEL_PKG_LINK_TARGETS := $(addprefix $(build_datarootdir)/julia/,$(TOP_LEVE # Generate symlinks for top level pkgs in usr/share/julia/ $(foreach module, $(TOP_LEVEL_PKGS), $(eval $(call symlink_target,$$(JULIAHOME)/$(module),$$(build_datarootdir)/julia,$(module)))) +.PHONY: julia-deps julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps # `julia-stdlib` depends on `julia-deps` so that the fake JLL stdlibs can copy in their Artifacts.toml files. +.PHONY: julia-stdlib julia-stdlib: | $(DIRS) julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/stdlib +.PHONY: julia-base julia-base: julia-deps $(build_sysconfdir)/julia/startup.jl $(build_man1dir)/julia.1 $(build_datarootdir)/julia/julia-config.jl $(build_datarootdir)/julia/juliac/juliac.jl $(build_datarootdir)/julia/juliac/abi_export.jl $(build_datarootdir)/julia/juliac/juliac-buildscript.jl $(build_datarootdir)/julia/juliac/juliac-trim-base.jl $(build_datarootdir)/julia/juliac/juliac-trim-stdlib.jl $(build_datarootdir)/julia/juliac/Artifacts.toml @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/base @@ -104,12 +109,18 @@ julia-libccalllazybar: julia-deps julia-libccalllazyfoo julia-libllvmcalltest: julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src libllvmcalltest +.PHONY: julia-src-debug +.PHONY: julia-src-release julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.inc.phony julia-cli-% @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src $* +.PHONY: julia-cli-debug +.PHONY: julia-cli-release julia-cli-release julia-cli-debug: julia-cli-% : julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/cli $* +.PHONY: julia-sysimg-debug +.PHONY: julia-sysimg-release julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-src-% $(TOP_LEVEL_PKG_LINK_TARGETS) julia-stdlib julia-base julia-cli-% | $(build_private_libdir) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$* @@ -117,12 +128,16 @@ julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-src-% $(TOP_LEV julia-sysbase-release julia-sysbase-debug : julia-sysbase-% : julia-src-% $(TOP_LEVEL_PKG_LINK_TARGETS) julia-stdlib julia-base julia-cli-% | $(build_private_libdir) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysbase-$* +.PHONY: julia-debug +.PHONY: julia-release julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest \ julia-libccalllazyfoo julia-libccalllazybar julia-libllvmcalltest julia-base-cache stdlibs-cache-release stdlibs-cache-debug : stdlibs-cache-% : julia-% @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f pkgimage.mk $* +.PHONY: debug +.PHONY: release debug release : % : julia-% stdlibs-cache-% docs: julia-sysimg-$(JULIA_BUILD_MODE) stdlibs-cache-$(JULIA_BUILD_MODE) @@ -131,6 +146,7 @@ docs: julia-sysimg-$(JULIA_BUILD_MODE) stdlibs-cache-$(JULIA_BUILD_MODE) docs-revise: @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/doc JULIA_EXECUTABLE='$(call spawn,$(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE))) --startup-file=no' revise=true +.PHONY: check-whitespace check-whitespace: ifneq ($(NO_GIT), 1) @# Append the directory containing the julia we just built to the end of `PATH`, @@ -140,6 +156,7 @@ else $(warn "Skipping whitespace check because git is unavailable") endif +.PHONY: fix-whitespace fix-whitespace: ifneq ($(NO_GIT), 1) @# Append the directory containing the julia we just built to the end of `PATH`, @@ -149,6 +166,7 @@ else $(warn "Skipping whitespace fix because git is unavailable") endif +.PHONY: release-candidate release-candidate: release testall @$(JULIA_EXECUTABLE) $(JULIAHOME)/contrib/add_license_to_files.jl #add license headers @#Check documentation @@ -328,6 +346,7 @@ define stringreplace endef +.PHONY: install install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html @$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE) @for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(private_libexecdir); do \ @@ -574,6 +593,7 @@ endif distclean: -rm -fr $(BUILDROOT)/julia-*.tar.gz $(BUILDROOT)/julia*.exe $(BUILDROOT)/julia-$(JULIA_COMMIT) +.PHONY: binary-dist binary-dist: distclean ifeq ($(USE_SYSTEM_BLAS),0) ifeq ($(ISX86),1) @@ -620,6 +640,7 @@ app: darwinframework: $(MAKE) -C $(JULIAHOME)/contrib/mac/framework +.PHONY: light-source-dist.tmp light-source-dist.tmp: $(BUILDROOT)/doc/_build/html/en/index.html ifneq ($(BUILDROOT),$(JULIAHOME)) $(error make light-source-dist does not work in out-of-tree builds) @@ -642,6 +663,7 @@ endif find doc/_build/html >> light-source-dist.tmp # Make tarball with only Julia code + stdlib tarballs +.PHONY: light-source-dist light-source-dist: light-source-dist.tmp # Prefix everything with "julia-$(commit-sha)/" or "julia-$(version)/" and then create tarball # To achieve prefixing, we temporarily create a symlink in the source directory that points back @@ -651,10 +673,12 @@ light-source-dist: light-source-dist.tmp tar -cz --no-recursion -T light-source-dist.tmp1 -f julia-$(JULIA_VERSION)_$(JULIA_COMMIT).tar.gz rm julia-${JULIA_COMMIT} +.PHONY: source-dist source-dist: @echo \'source-dist\' target is deprecated: use \'full-source-dist\' instead. # Make tarball with Julia code plus all dependencies +.PHONY: full-source-dist full-source-dist: light-source-dist.tmp # Get all the dependencies downloaded @$(MAKE) -C deps getall DEPS_GIT=0 USE_BINARYBUILDER=0 @@ -671,6 +695,7 @@ full-source-dist: light-source-dist.tmp tar -cz --no-recursion -T full-source-dist.tmp1 -f julia-$(JULIA_VERSION)_$(JULIA_COMMIT)-full.tar.gz rm julia-${JULIA_COMMIT} +.PHONY: clean clean: | $(CLEAN_TARGETS) @-$(MAKE) -C $(BUILDROOT)/base clean @-$(MAKE) -C $(BUILDROOT)/doc clean @@ -688,65 +713,40 @@ clean: | $(CLEAN_TARGETS) # Teporarily add this line to the Makefile to remove extras -rm -fr $(build_datarootdir)/julia/extras +.PHONY: cleanall cleanall: clean @-$(MAKE) -C $(BUILDROOT)/src clean-flisp clean-support @-$(MAKE) -C $(BUILDROOT)/deps clean-libuv -rm -fr $(build_prefix) $(build_staging) +.PHONY: distcleanall distcleanall: cleanall @-$(MAKE) -C $(BUILDROOT)/stdlib distclean @-$(MAKE) -C $(BUILDROOT)/deps distcleanall @-$(MAKE) -C $(BUILDROOT)/doc cleanall .FORCE: - .PHONY: .FORCE + .PHONY: $(CLEAN_TARGETS) -.PHONY: binary-dist -.PHONY: check-whitespace -.PHONY: clean -.PHONY: cleanall -.PHONY: compile-database -.PHONY: debug -.PHONY: default -.PHONY: distcleanall -.PHONY: fix-whitespace -.PHONY: full-source-dist -.PHONY: install -.PHONY: julia-base -.PHONY: julia-cli-debug -.PHONY: julia-cli-release -.PHONY: julia-debug -.PHONY: julia-deps -.PHONY: julia-release -.PHONY: julia-src-debug -.PHONY: julia-src-release -.PHONY: julia-stdlib -.PHONY: julia-symlink -.PHONY: julia-sysimg-debug -.PHONY: julia-sysimg-release -.PHONY: light-source-dist -.PHONY: light-source-dist.tmp -.PHONY: release -.PHONY: release-candidate -.PHONY: source-dist -.PHONY: test -.PHONY: testall -.PHONY: testall1 # Generate compilation database (leverages existing clang tooling setup) +.PHONY: compile-database compile-database: @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src compile-database +.PHONY: test test: check-whitespace $(JULIA_BUILD_MODE) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test default JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) +.PHONY: testall testall: check-whitespace $(JULIA_BUILD_MODE) cp $(JULIA_SYSIMG) $(BUILDROOT)/local.$(SHLIB_EXT) $(call spawn,$(JULIA_EXECUTABLE) -J $(call cygpath_w,$(BUILDROOT)/local.$(SHLIB_EXT)) -e 'true') rm $(BUILDROOT)/local.$(SHLIB_EXT) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test all JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) +.PHONY: testall1 testall1: check-whitespace $(JULIA_BUILD_MODE) @env JULIA_CPU_THREADS=1 $(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test all JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) @@ -759,7 +759,7 @@ test-revise-%: .FORCE @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test revise-$* JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) # download target for some hardcoded windows dependencies -.PHONY: win-extras wine_path +.PHONY: win-extras win-extras: @$(MAKE) -C $(BUILDROOT)/deps install-p7zip mkdir -p $(JULIAHOME)/dist-extras From cc6c39648399a44e47aaf7c0b1a458fce0f4c9c7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 7 Nov 2025 12:40:36 +0100 Subject: [PATCH 4/7] more PHONY work --- deps/Makefile | 16 ++++++++++++++++ deps/mmtk_julia.mk | 12 ++++++++++++ deps/tools/common.mk | 2 -- doc/Makefile | 9 +++++++-- src/Makefile | 17 ++++++++++++++++- stdlib/Makefile | 1 + test/Makefile | 13 +++++++++++-- 7 files changed, 63 insertions(+), 7 deletions(-) diff --git a/deps/Makefile b/deps/Makefile index 392b4fad2b2e2..fb6724317759d 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -247,6 +247,22 @@ distcleanall: $(addprefix distclean-, $(DEP_LIBS_ALL)) rm -rf $(build_prefix) getall: $(addprefix get-, $(DEP_LIBS_ALL)) +.PHONY: default +.PHONY: get +.PHONY: extract +.PHONY: configure +.PHONY: compile +.PHONY: check +.PHONY: fastcheck +.PHONY: stage +.PHONY: install +.PHONY: version-check + +.PHONY: uninstall +.PHONY: cleanall +.PHONY: distcleanall +.PHONY: getall + include $(SRCDIR)/BOLT.mk include $(SRCDIR)/csl.mk include $(SRCDIR)/sanitizers.mk diff --git a/deps/mmtk_julia.mk b/deps/mmtk_julia.mk index b443f9b6a25da..ef7359fee8fa1 100644 --- a/deps/mmtk_julia.mk +++ b/deps/mmtk_julia.mk @@ -9,6 +9,7 @@ MMTK_VARS := MMTK_PLAN=$(MMTK_PLAN) MMTK_MOVING=$(MMTK_MOVING) ifneq ($(USE_BINARYBUILDER_MMTK_JULIA),1) $(eval $(call git-external,mmtk_julia,MMTK_JULIA,,,$(BUILDDIR))) get-mmtk_julia: $(MMTK_JULIA_SRC_FILE) +.PHONY: get-mmtk_julia # Download the binding, build it from source ifeq (${MMTK_JULIA_DIR},$(BUILDROOT)/usr/lib/mmtk_julia) @@ -33,6 +34,12 @@ compile-mmtk_julia: $(BUILDROOT)/usr/lib/libmmtk_julia.so fastcheck-mmtk_julia: #none check-mmtk_julia: compile-mmtk_julia +.PHONY: extract-mmtk_julia +.PHONY: configure-mmtk_julia +.PHONY: compile-mmtk_julia +.PHONY: fastcheck-mmtk_julia +.PHONY: check-mmtk_julia + $(eval $(call symlink_install,mmtk_julia,$$(MMTK_JULIA_SRC_DIR),$$(BUILDROOT)/usr/lib)) # In this case, there is a custom version of the binding in MMTK_JULIA_DIR @@ -42,10 +49,13 @@ else PROJECT_DIRS := JULIA_PATH=$(JULIAHOME) JULIA_BUILDROOT=$(BUILDROOT) MMTK_JULIA_DIR=$(MMTK_JULIA_DIR) MMTK_JULIA_LIB_PATH=$(MMTK_JULIA_DIR)/mmtk/target/$(MMTK_BUILD) +.PHONY: install-mmtk_julia install-mmtk_julia: compile-mmtk_julia $(build_prefix)/manifest/mmtk_julia +.PHONY: compile-mmtk_julia compile-mmtk_julia: $(BUILDROOT)/usr/lib/libmmtk_julia.so +.PHONY: version-check-mmtk_julia version-check-mmtk_julia: $(MMTK_JULIA_DIR)/mmtk/target/$(MMTK_BUILD)/libmmtk_julia.so # NB: This will NOT run `cargo build` if there are changes in the Rust source files @@ -62,6 +72,7 @@ MMTK_JULIA_VER := mmtk_julia_custom UNINSTALL_mmtk_julia := $(MMTK_JULIA_VER) manual_mmtk_julia define manual_mmtk_julia +.PHONY: uninstall uninstall-mmtk_julia: -rm -f $(build_prefix)/manifest/mmtk_julia -rm -f $(BUILDROOT)/usr/lib/libmmtk_julia.so @@ -91,6 +102,7 @@ else LIB_PATH_MOVING := moving endif +.PHONY: version-check-mmtk_julia version-check-mmtk_julia: $(BUILDROOT)/usr/lib/libmmtk_julia.so $(BUILDROOT)/usr/lib/libmmtk_julia.so: get-mmtk_julia diff --git a/deps/tools/common.mk b/deps/tools/common.mk index 0fb2f45cfb88f..30e0e105d283f 100644 --- a/deps/tools/common.mk +++ b/deps/tools/common.mk @@ -312,5 +312,3 @@ endif .PHONY: reinstall-* .PHONY: uninstall .PHONY: uninstall-* -.PHONY: update-llvm -.PHONY: version-check diff --git a/doc/Makefile b/doc/Makefile index 37e681c915113..7685b9740e9e7 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,8 +9,7 @@ SRCCACHE := $(abspath $(JULIAHOME)/deps/srccache) include $(JULIAHOME)/Make.inc JULIA_EXECUTABLE := $(call spawn,$(build_bindir)/julia) --startup-file=no -.PHONY: help clean cleanall html pdf deps deploy - +.PHONY: help help: @echo "Please use 'make ' where is one of" @echo " html to make standalone HTML files" @@ -37,6 +36,7 @@ src/%: ln -s $(SRCDIR)/src/$* $@ src: $(addprefix src/,$(DOC_FILES)) +.PHONY: deps deps: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt $(JLCHECKSUM) "$<" cp "$<" UnicodeData.txt @@ -47,22 +47,27 @@ alldeps: deps checksum-unicodedata: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt $(JLCHECKSUM) "$<" +.PHONY: clean clean: rm -rf _build/* deps/* docbuild.log UnicodeData.txt +.PHONY: cleanall cleanall: clean +.PHONY: html html: deps @echo "Building HTML documentation." $(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) $(DOCUMENTER_OPTIONS) @echo "Build finished. The HTML pages are in _build/html." +.PHONY: pdf pdf: deps @echo "Building PDF documentation." $(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) -- pdf $(DOCUMENTER_OPTIONS) @echo "Build finished." # The deploy target should only be called in CI builds +.PHONY: deploy deploy: deps @echo "Deploying HTML documentation." $(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) -- deploy $(DOCUMENTER_OPTIONS) diff --git a/src/Makefile b/src/Makefile index f8c69b75b4d1b..4ee79aae6a343 100644 --- a/src/Makefile +++ b/src/Makefile @@ -256,9 +256,13 @@ else FLISP_EXECUTABLE := $(FLISP_EXECUTABLE_$(JULIA_BUILD_MODE)) endif +.PHONY: default default: $(JULIA_BUILD_MODE) # contains either "debug" or "release" + +.PHONY: all all: debug release +.PHONY: release debug release debug: %: libjulia-internal-% libjulia-codegen-% regenerate-compile_commands $(BUILDDIR): @@ -313,9 +317,11 @@ $(eval $(call dir_target,$(build_includedir)/julia/uv)) $(build_includedir)/julia/uv/*.h: $(LIBUV_INC)/uv/*.h | $(build_includedir)/julia/uv $(INSTALL_F) $^ $(build_includedir)/julia/uv +.PHONY: libccalltest libccalltest: $(build_shlibdir)/libccalltest.$(SHLIB_EXT) libccalllazyfoo: $(build_shlibdir)/libccalllazyfoo.$(SHLIB_EXT) libccalllazybar: $(build_shlibdir)/libccalllazybar.$(SHLIB_EXT) +.PHONY: libllvmcalltest libllvmcalltest: $(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT) ifeq ($(OS), Linux) @@ -349,6 +355,7 @@ $(build_shlibdir)/libccalllazybar.$(SHLIB_EXT): $(SRCDIR)/ccalllazybar.c $(build $(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT): $(SRCDIR)/llvmcalltest.cpp $(LLVM_CONFIG_ABSOLUTE) @$(call PRINT_CC, $(CXX) $(JCXXFLAGS) $(LLVM_CXXFLAGS) $(FLAGS_COMMON) $(CPPFLAGS) $(CXXFLAGS) -O3 $< $(fPIC) -shared -o $@ $(LDFLAGS) $(COMMON_LIBPATHS) $(NO_WHOLE_ARCHIVE) $(CG_LLVMLINK)) -lpthread +.PHONY: julia_flisp.boot.inc.phony julia_flisp.boot.inc.phony: $(BUILDDIR)/julia_flisp.boot.inc $(BUILDDIR)/julia_flisp.boot.inc: $(BUILDDIR)/julia_flisp.boot $(FLISP_EXECUTABLE_release) @@ -551,6 +558,7 @@ INCLUDED_CXX_FILES := \ processor.cpp:processor_arm.cpp \ processor.cpp:processor_fallback.cpp +.PHONY: clean clean: -rm -fr $(build_shlibdir)/libjulia-internal* $(build_shlibdir)/libjulia-codegen* -rm -rf $(build_shlibdir)/libccalltest* $(build_shlibdir)/libllvmcalltest* $(build_shlibdir)/libccalllazyfoo* $(build_shlibdir)/libccalllazybar* @@ -560,12 +568,15 @@ clean: -rm -f $(BUILDDIR)/julia_version.h -rm -f $(BUILDDIR)/compile_commands.json +.PHONY: clean-flisp clean-flisp: -$(MAKE) -C $(SRCDIR)/flisp clean BUILDDIR='$(abspath $(BUILDDIR)/flisp)' +.PHONY: clean-support clean-support: -$(MAKE) -C $(SRCDIR)/support clean BUILDDIR='$(abspath $(BUILDDIR)/support)' +.PHONY: cleanall cleanall: clean clean-flisp clean-support clean-analyzegc $(build_shlibdir)/lib%Plugin.$(SHLIB_EXT): $(SRCDIR)/clangsa/%.cpp $(LLVM_CONFIG_ABSOLUTE) @@ -642,7 +653,9 @@ clang-tidy-%: $(SRCDIR)/%.cpp $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB # Add C files as a target of `analyzesrc` and `analyzegc` and `tidysrc` tidysrc: $(addprefix clang-tidy-,$(CODEGEN_SRCS) $(SRCS)) +.PHONY: analyzesrc analyzesrc: $(addprefix clang-sa-,$(CODEGEN_SRCS) $(SRCS)) +.PHONY: analyzegc analyzegc: $(addprefix clang-sagc-,$(filter-out $(basename $(SKIP_GC_CHECK)),$(CODEGEN_SRCS) $(SRCS))) analyze: analyzesrc analyzegc tidysrc @@ -650,6 +663,7 @@ $(addprefix analyze-,$(CODEGEN_SRCS) $(SRCS)) : analyze-% : clang-sa-% $(addprefix analyze-,$(CODEGEN_SRCS) $(SRCS)) : analyze-% : clang-tidy-% $(addprefix analyze-,$(filter-out $(basename $(SKIP_GC_CHECK)),$(CODEGEN_SRCS) $(SRCS))) : analyze-% : clang-sagc-% +.PHONY: clean-analyzegc clean-analyzegc: rm -f $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) rm -f $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB_EXT) @@ -721,10 +735,11 @@ regenerate-compile_commands: rm -f $$TMPFILE; \ fi +.PHONY: compile-database compile-database: regenerate-compile_commands $(MAKE) -C $(SRCDIR)/flisp compile-database BUILDDIR='$(abspath $(BUILDDIR)/flisp)' $(MAKE) -C $(SRCDIR)/support compile-database BUILDDIR='$(abspath $(BUILDDIR)/support)' @echo "Compilation database created for src" .FORCE: -.PHONY: default all debug release clean cleanall clean-* libccalltest libllvmcalltest julia_flisp.boot.inc.phony analyzegc analyzesrc compile-database .FORCE +.PHONY: .FORCE diff --git a/stdlib/Makefile b/stdlib/Makefile index ccadce7546be4..33f77f8c38c96 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -75,6 +75,7 @@ endif getall get: $(addprefix get-, $(STDLIBS_EXT) $(JLL_NAMES)) install: version-check $(addprefix install-, $(STDLIBS_EXT) $(JLL_NAMES)) $(STDLIBS_LINK_TARGETS) remove-gpl-libs +.PHONY: version-check version-check: $(addprefix version-check-, $(STDLIBS_EXT)) uninstall: $(addprefix uninstall-, $(STDLIBS_EXT)) extstdlibclean: diff --git a/test/Makefile b/test/Makefile index 61946e650dee5..4fbf5633214e2 100644 --- a/test/Makefile +++ b/test/Makefile @@ -28,19 +28,24 @@ TRIMMING_ARGS := "JULIA=$(JULIA_EXECUTABLE)" "BIN=$(SRCDIR)/trimming" "CC=$(CC)" TEST_JULIA_OPTIONS := --check-bounds=yes --startup-file=no --depwarn=error TEST_SCRIPT_OPTIONS := --buildroot=$(call cygpath_w,$(BUILDROOT)) +default default: +.PHONY: $(TESTS) $(TESTS): @cd $(SRCDIR) && \ $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) $(TEST_JULIA_OPTIONS) ./runtests.jl $(TEST_SCRIPT_OPTIONS) $@) +.PHONY: install-revise-deps install-revise-deps: $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) $(TEST_JULIA_OPTIONS) ./runtests.jl $(TEST_SCRIPT_OPTIONS) --revise --help-list install_revise_deps) +.PHONY: $(addprefix revise-, $(TESTS)) $(addprefix revise-, $(TESTS)): revise-% : @cd $(SRCDIR) && \ $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) $(TEST_JULIA_OPTIONS) ./runtests.jl $(TEST_SCRIPT_OPTIONS) --revise $*) +.PHONY: relocatedepot relocatedepot: @rm -rf $(SRCDIR)/relocatedepot @cd $(SRCDIR) && \ @@ -54,6 +59,7 @@ relocatedepot: @cd $(SRCDIR) && \ $(call PRINT_JULIA, $(call spawn,RELOCATEDEPOT="" $(JULIA_EXECUTABLE)) $(TEST_JULIA_OPTIONS) ./runtests.jl $(TEST_SCRIPT_OPTIONS) $@) +.PHONY: revise-relocatedepot revise-relocatedepot: revise-% : @rm -rf $(SRCDIR)/relocatedepot @cd $(SRCDIR) && \ @@ -67,23 +73,26 @@ revise-relocatedepot: revise-% : @cd $(SRCDIR) && \ $(call PRINT_JULIA, $(call spawn,RELOCATEDEPOT="" $(JULIA_EXECUTABLE)) $(TEST_JULIA_OPTIONS) ./runtests.jl $(TEST_SCRIPT_OPTIONS) --revise $*) +.PHONY: embedding embedding: @$(MAKE) -C $(SRCDIR)/$@ check $(EMBEDDING_ARGS) +.PHONY: gcext gcext: @$(MAKE) -C $(SRCDIR)/$@ check $(GCEXT_ARGS) +.PHONY: trimming trimming: @$(MAKE) -C $(SRCDIR)/$@ check $(TRIMMING_ARGS) @$(MAKE) -C $(SRCDIR)/$@ clean $(TRIMMING_ARGS) +.PHONY: clangsa clangsa: @$(MAKE) -C $(SRCDIR)/$@ +.PHONY: clean clean: @$(MAKE) -C embedding $@ $(EMBEDDING_ARGS) @$(MAKE) -C gcext $@ $(GCEXT_ARGS) @$(MAKE) -C llvmpasses $@ @$(MAKE) -C trimming $@ $(TRIMMING_ARGS) - -.PHONY: $(TESTS) $(addprefix revise-, $(TESTS)) relocatedepot revise-relocatedepot embedding gcext trimming clangsa clean From 6d7eb8a04dd8f325ce700511713165a7b88807c3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 7 Nov 2025 12:55:18 +0100 Subject: [PATCH 5/7] Add some missing .PHONY statements --- Makefile | 22 ++++++++++++---------- doc/Makefile | 5 +++++ src/Makefile | 6 ++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 7fe9436ab0cb9..962da7147a894 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,8 @@ VERSDIR := v`cut -d. -f1-2 < $(JULIAHOME)/VERSION` .PHONY: default default: $(JULIA_BUILD_MODE) # contains either "debug" or "release" + +.PHONY: all all: debug release # sort is used to remove potential duplicates @@ -109,40 +111,39 @@ julia-libccalllazybar: julia-deps julia-libccalllazyfoo julia-libllvmcalltest: julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src libllvmcalltest -.PHONY: julia-src-debug -.PHONY: julia-src-release +.PHONY: julia-src-release julia-src-debug julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.inc.phony julia-cli-% @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src $* -.PHONY: julia-cli-debug -.PHONY: julia-cli-release +.PHONY: julia-cli-release julia-cli-debug julia-cli-release julia-cli-debug: julia-cli-% : julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/cli $* -.PHONY: julia-sysimg-debug -.PHONY: julia-sysimg-release +.PHONY: julia-sysimg-release julia-sysimg-debug julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-src-% $(TOP_LEVEL_PKG_LINK_TARGETS) julia-stdlib julia-base julia-cli-% | $(build_private_libdir) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$* # Useful for cross-bootstrapping +.PHONY: julia-sysbase-release julia-sysbase-debug julia-sysbase-release julia-sysbase-debug : julia-sysbase-% : julia-src-% $(TOP_LEVEL_PKG_LINK_TARGETS) julia-stdlib julia-base julia-cli-% | $(build_private_libdir) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysbase-$* -.PHONY: julia-debug -.PHONY: julia-release +.PHONY: julia-debug julia-release julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest \ julia-libccalllazyfoo julia-libccalllazybar julia-libllvmcalltest julia-base-cache +.PHONY: stdlibs-cache-release stdlibs-cache-debug stdlibs-cache-release stdlibs-cache-debug : stdlibs-cache-% : julia-% @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f pkgimage.mk $* -.PHONY: debug -.PHONY: release +.PHONY: debug release debug release : % : julia-% stdlibs-cache-% +.PHONY: docs docs: julia-sysimg-$(JULIA_BUILD_MODE) stdlibs-cache-$(JULIA_BUILD_MODE) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/doc JULIA_EXECUTABLE='$(call spawn,$(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE))) --startup-file=no' +.PHONY: docs-revise docs-revise: @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/doc JULIA_EXECUTABLE='$(call spawn,$(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE))) --startup-file=no' revise=true @@ -221,6 +222,7 @@ $(build_datarootdir)/julia/%: $(JULIAHOME)/contrib/% | $(build_datarootdir)/juli $(build_depsbindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(build_depsbindir) @$(call PRINT_CC, $(HOSTCC) -o $(build_depsbindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c) +.PHONY: julia-base-cache julia-base-cache: julia-sysimg-$(JULIA_BUILD_MODE) | $(DIRS) $(build_datarootdir)/julia @JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) JULIA_FALLBACK_REPL=1 WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \ $(call spawn, $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/contrib/write_base_cache.jl) \ diff --git a/doc/Makefile b/doc/Makefile index 7685b9740e9e7..50b5fb5331d34 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,6 @@ # Makefile for building documentation +.PHONY: default default: html # You can set these variables from the command line. @@ -34,6 +35,7 @@ DOC_FILES=$(filter-out NEWS.md stdlib,$(notdir $(wildcard $(SRCDIR)/src/*))) src/%: @mkdir -p src ln -s $(SRCDIR)/src/$* $@ +.PHONY: src src: $(addprefix src/,$(DOC_FILES)) .PHONY: deps @@ -41,9 +43,11 @@ deps: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt $(JLCHECKSUM) "$<" cp "$<" UnicodeData.txt +.PHONY: alldeps alldeps: deps $(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) deps $(DOCUMENTER_OPTIONS) +.PHONY: checksum-unicodedata checksum-unicodedata: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt $(JLCHECKSUM) "$<" @@ -73,6 +77,7 @@ deploy: deps $(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) -- deploy $(DOCUMENTER_OPTIONS) @echo "Build & deploy of docs finished." +.PHONY: update-documenter update-documenter: @echo "Updating Documenter." JULIA_PKG_PRECOMPILE_AUTO=0 $(JULIA_EXECUTABLE) --project=$(call cygpath_w,$(SRCDIR)/../deps/jlutilities/documenter/) --color=yes -e 'using Pkg; Pkg.update("Documenter")' diff --git a/src/Makefile b/src/Makefile index 4ee79aae6a343..8f977b97259f3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -319,7 +319,9 @@ $(build_includedir)/julia/uv/*.h: $(LIBUV_INC)/uv/*.h | $(build_includedir)/juli .PHONY: libccalltest libccalltest: $(build_shlibdir)/libccalltest.$(SHLIB_EXT) +.PHONY: libccalllazyfoo libccalllazyfoo: $(build_shlibdir)/libccalllazyfoo.$(SHLIB_EXT) +.PHONY: libccalllazybar libccalllazybar: $(build_shlibdir)/libccalllazybar.$(SHLIB_EXT) .PHONY: libllvmcalltest libllvmcalltest: $(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT) @@ -596,9 +598,11 @@ ANALYSIS_DEPS += llvmunwind else ifneq ($(OS),WINNT) ANALYSIS_DEPS += unwind endif +.PHONY: install-analysis-deps install-analysis-deps: $(MAKE) -C $(JULIAHOME)/deps $(addprefix install-,$(ANALYSIS_DEPS)) +.PHONY: analyzegc-deps-check analyzegc-deps-check: $(addprefix $(BUILDDIR)/,julia_version.h julia_flisp.boot.inc jl_internal_funcs.inc jl_data_globals_defs.inc) ifeq ($(USE_BINARYBUILDER_LLVM),0) ifneq ($(BUILD_LLVM_CLANG),1) @@ -652,11 +656,13 @@ clang-tidy-%: $(SRCDIR)/%.cpp $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB -- $(CLANG_TOOLING_CXX_FLAGS) -fcolor-diagnostics --system-header-prefix=llvm -Wno-deprecated-declarations -fno-caret-diagnostics -x c++) # Add C files as a target of `analyzesrc` and `analyzegc` and `tidysrc` +.PHONY: tidysrc tidysrc: $(addprefix clang-tidy-,$(CODEGEN_SRCS) $(SRCS)) .PHONY: analyzesrc analyzesrc: $(addprefix clang-sa-,$(CODEGEN_SRCS) $(SRCS)) .PHONY: analyzegc analyzegc: $(addprefix clang-sagc-,$(filter-out $(basename $(SKIP_GC_CHECK)),$(CODEGEN_SRCS) $(SRCS))) +.PHONY: analyze analyze: analyzesrc analyzegc tidysrc $(addprefix analyze-,$(CODEGEN_SRCS) $(SRCS)) : analyze-% : clang-sa-% From 048e46a3e42141b6a53fe2f8b6e2f746a617c872 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 9 Nov 2025 21:46:42 +0100 Subject: [PATCH 6/7] Update test/Makefile --- test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index 4fbf5633214e2..b22656766700b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -28,7 +28,7 @@ TRIMMING_ARGS := "JULIA=$(JULIA_EXECUTABLE)" "BIN=$(SRCDIR)/trimming" "CC=$(CC)" TEST_JULIA_OPTIONS := --check-bounds=yes --startup-file=no --depwarn=error TEST_SCRIPT_OPTIONS := --buildroot=$(call cygpath_w,$(BUILDROOT)) -default +.PHONY: default default: .PHONY: $(TESTS) From f4bcd88c0c82dfb03bbd55d7acfdbc716cbbb990 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 9 Nov 2025 21:48:52 +0100 Subject: [PATCH 7/7] Update deps/mmtk_julia.mk --- deps/mmtk_julia.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/mmtk_julia.mk b/deps/mmtk_julia.mk index ef7359fee8fa1..7a7160a595d90 100644 --- a/deps/mmtk_julia.mk +++ b/deps/mmtk_julia.mk @@ -72,7 +72,7 @@ MMTK_JULIA_VER := mmtk_julia_custom UNINSTALL_mmtk_julia := $(MMTK_JULIA_VER) manual_mmtk_julia define manual_mmtk_julia -.PHONY: uninstall +.PHONY: uninstall-mmtk_julia uninstall-mmtk_julia: -rm -f $(build_prefix)/manifest/mmtk_julia -rm -f $(BUILDROOT)/usr/lib/libmmtk_julia.so