Skip to content

Commit

Permalink
Fix for out-of-source build.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Oct 20, 2018
1 parent 17ad47e commit ae92782
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ endif
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$(build_datarootdir)/julia,$(notdir $(link)))))

build_defaultpkgdir = $(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR))
$(eval $(call symlink_target,$(JULIAHOME)/stdlib,$(build_datarootdir)/julia/stdlib,$(shell echo $(VERSDIR))))

julia_flisp.boot.inc.phony: julia-deps
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony

Expand All @@ -56,7 +53,7 @@ ifndef JULIA_VAGRANT_BUILD
endif
endif

julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test $(build_defaultpkgdir)
julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps

julia-stdlib: | $(DIRS)
Expand Down
24 changes: 22 additions & 2 deletions stdlib/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
default: Pkg
default: install

.PHONY: default extract-pkg Pkg get-pkg clean-pkg getall install

SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
JULIAHOME := $(abspath $(SRCDIR)/..)
SRCCACHE := $(abspath $(SRCDIR)/srccache)
Expand All @@ -8,6 +11,9 @@ include $(JULIAHOME)/Make.inc
include $(JULIAHOME)/deps/tools/common.mk
include $(JULIAHOME)/deps/tools/git-external.mk

VERSDIR := v`cut -d. -f1-2 < $(JULIAHOME)/VERSION`

# Download and extract Pkg
PKG := https://github.com/JuliaLang/Pkg.jl
PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1
$(eval $(call git-external,Pkg,PKG,,,$(BUILDDIR)))
Expand All @@ -21,6 +27,20 @@ clean-pkg:
-rm -rf Pkg
-rm -rf $(BUILDDIR)/$(PKG_SRC_DIR)

# Generate symlinks to all stdlibs from usr/share/julia/stdlib/vX.Y/
STDLIBS = Base64 CRC32c Dates DelimitedFiles Distributed FileWatching \
Future InteractiveUtils Libdl LibGit2 LinearAlgebra Logging \
Markdown Mmap Printf Profile Random REPL Serialization SHA \
SharedArrays Sockets SparseArrays Statistics SuiteSparse Test Unicode UUIDs

$(foreach pkg, $(STDLIBS), $(eval $(call symlink_target,$(JULIAHOME)/stdlib/$(pkg),$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)),$(pkg))))
$(eval $(call symlink_target,$(BUILDDIR)/$(PKG_SRC_DIR),$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)),Pkg))

$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)):
mkdir -p $@

STDLIBS_LINK_TARGETS = $(addprefix $(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR))/, $(STDLIBS) Pkg)

install: Pkg $(STDLIBS_LINK_TARGETS)
getall: get-pkg

.PHONY: default extract-pkg Pkg get-pkg clean-pkg getall

0 comments on commit ae92782

Please sign in to comment.