Skip to content

Commit

Permalink
Added source-dist make target
Browse files Browse the repository at this point in the history
source-dist is a make target for creating a standalone tarball that can
be compilled on a system with the requisit external dependencies without
internet access to download the internal dependencies.
  • Loading branch information
ivarne committed Jan 25, 2014
1 parent f7c19cb commit 178a720
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/usr
/Make.user
/julia-*
/source-dist.tmp
/source-dist.tmp1

*.exe
*.dll
Expand Down
13 changes: 8 additions & 5 deletions DISTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ Versioning and Git
The Makefile uses both the `VERSION` file and commit hashes and tags from the
git repository to generate the `base/version_git.jl` with information we use to
fill the splash screen and the `versioninfo()` output. If you for some reason
don't want to have the git repository availible when building you should
don't want to have the git repository available when building you should
pregenerate the `base/version_git.jl` file with:

make -C base version_git.jl.phony

For some dependencies we use patched versions that will be fetched via
`git submodules`. Those might be prefetched by:
Juila has lots of build dependencies where we use patched versions that has not
yet been included by the popular package managers. These dependencies will usually
be automatically downloaded when you build, but if you want to be able to build
Julia on a computer without internet access you should create a source-dist archive
with the special make targed

git submodule update --init
make source-dist

See example for how this is done for building nigtlies at [the debian build servers](https://github.com/staticfloat/julia-nightly-packaging/blob/master/build_ubuntu.sh)
that creates a julia-version-commit.tar.gz archive with all required dependencies.

When compiling a tagged release in the git repository, we don't display the
branch/commit hash info in the splash screen. You can use this line to show
Expand Down
39 changes: 31 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ endif
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,base test doc examples,$(eval $(call symlink_target,$(link),$(BUILD)/share/julia)))

git-submodules:
ifneq ($(NO_GIT), 1)
@-git submodule update --init
else
$(warn "Submodules could not be updated because git is unavailible")
endif

debug release: | $(DIRS) $(BUILD)/share/julia/base $(BUILD)/share/julia/test $(BUILD)/share/julia/doc $(BUILD)/share/julia/examples $(BUILD)/etc/julia/juliarc.jl
@$(MAKE) $(QUIET_MAKE) julia-$@
@export JL_PRIVATE_LIBDIR=$(JL_PRIVATE_LIBDIR) && \
Expand All @@ -43,13 +50,7 @@ julia-debug-symlink:
julia-release-symlink:
@ln -sf $(BUILD)/bin/julia-$(DEFAULT_REPL) julia

julia-debug julia-release:
ifneq ($(NO_GIT), 1)
@-git submodule init --quiet
@-git submodule update
else
$(warn "Submodules could not be updated because git is unavailible")
endif
julia-debug julia-release: git-submodules
@$(MAKE) $(QUIET_MAKE) -C deps
@$(MAKE) $(QUIET_MAKE) -C src lib$@
@$(MAKE) $(QUIET_MAKE) -C base
Expand Down Expand Up @@ -264,6 +265,27 @@ else
endif
rm -fr julia-$(JULIA_COMMIT)


source-dist: git-submodules
# Save git information
-@$(MAKE) -C base version_git.jl.phony
# Get all the dependencies downloaded
@$(MAKE) -C deps getall

# Create file source-dist.tmp to hold all the filenames that goes into the tarball
echo "base/version_git.jl" > source-dist.tmp
git ls-files >> source-dist.tmp
ls deps/*.tar.gz deps/*.tar.bz2 deps/*.tgz deps/random/*.tar.gz >> source-dist.tmp
git submodule --quiet foreach 'git ls-files | sed "s&^&$$path/&"' >> source-dist.tmp

# Remove unwanted files
sed '/\.git/d' source-dist.tmp > source-dist.tmp1
sed '/\.travis/d' source-dist.tmp1 > source-dist.tmp

# Create tarball
tar -cz -T source-dist.tmp --no-recursion -f julia-$(JULIA_VERSION)_$(JULIA_COMMIT).tar.gz
rm -f source-dist.tmp source-dist.tmp1

clean: | $(CLEAN_TARGETS)
@$(MAKE) -C base clean
@$(MAKE) -C src clean
Expand All @@ -275,6 +297,7 @@ clean: | $(CLEAN_TARGETS)
@rm -f julia
@rm -f *~ *# *.tar.gz
@rm -fr $(BUILD)/$(JL_PRIVATE_LIBDIR)
@rm -f source-dist.tmp source-dist.tmp1
# Temporarily add this line to the Makefile to remove extras
@rm -fr $(BUILD)/share/julia/extras

Expand All @@ -294,7 +317,7 @@ distclean: cleanall
.PHONY: default debug release julia-debug julia-release \
test testall testall1 test-* clean distclean cleanall \
run-julia run-julia-debug run-julia-release run \
install dist
install dist source-dist git-submodules

ifeq ($(VERBOSE),1)
.SILENT:
Expand Down

0 comments on commit 178a720

Please sign in to comment.