Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ endif

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
Expand Down Expand Up @@ -65,6 +68,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
Expand All @@ -82,13 +86,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

Expand All @@ -104,33 +111,43 @@ julia-libccalllazybar: julia-deps julia-libccalllazyfoo
julia-libllvmcalltest: julia-deps
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src libllvmcalltest

.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-release julia-cli-debug
julia-cli-release julia-cli-debug: julia-cli-% : julia-deps
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/cli $*

.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 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 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

.PHONY: check-whitespace
check-whitespace:
ifneq ($(NO_GIT), 1)
@# Append the directory containing the julia we just built to the end of `PATH`,
Expand All @@ -140,6 +157,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`,
Expand All @@ -149,6 +167,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
Expand Down Expand Up @@ -203,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) \
Expand Down Expand Up @@ -328,6 +348,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 \
Expand Down Expand Up @@ -574,6 +595,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)
Expand Down Expand Up @@ -620,6 +642,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)
Expand All @@ -642,6 +665,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
Expand All @@ -651,10 +675,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
Expand All @@ -671,6 +697,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
Expand All @@ -688,41 +715,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 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)

# 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)

Expand All @@ -735,7 +761,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
Expand Down
16 changes: 16 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions deps/mmtk_julia.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 23 additions & 3 deletions deps/tools/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,26 @@ 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-*
14 changes: 12 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Makefile for building documentation

.PHONY: default
default: html

# You can set these variables from the command line.
Expand All @@ -9,8 +10,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 <target>' where <target> is one of"
@echo " html to make standalone HTML files"
Expand All @@ -35,39 +35,49 @@ 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
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) "$<"

.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)
@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")'
Loading