Skip to content

Commit

Permalink
Makefile targets to generate normalized release tarballs.
Browse files Browse the repository at this point in the history
"make dist" will generate riak/riak-<version>.tar.gz with riak/deps fully
populated. "make dist" clean will clean it up.
  • Loading branch information
Ryan Tilder committed May 13, 2010
1 parent 9c5a017 commit f788e94
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Makefile
@@ -1,3 +1,5 @@
RIAK_TAG = $(shell hg identify -t)

.PHONY: rel deps

all: deps compile
Expand All @@ -11,7 +13,7 @@ deps:
clean:
./rebar clean

distclean: clean devclean relclean
distclean: clean devclean relclean ballclean
./rebar delete-deps

test:
Expand Down Expand Up @@ -79,4 +81,23 @@ orgs-README:
dialyzer: compile
@dialyzer -Wno_return -c apps/riak/ebin

# Release tarball creation
# Generates a tarball that includes all the deps sources so no checkouts are necessary

distdir:
$(if $(findstring tip,$(RIAK_TIP)),$(error "You can't generate a release tarball from tip"))
mkdir distdir
hg clone . distdir/riak-clone
cd distdir/riak-clone; \
hg archive ../$(RIAK_TAG); \
mkdir ../$(RIAK_TAG)/deps; \
make deps; \
for dep in deps/*; do cd $${dep} && hg archive ../../../$(RIAK_TAG)/$${dep}; cd ../..; done

dist $(RIAK_TAG).tar.gz: distdir
cd distdir; \
tar czf ../$(RIAK_TAG).tar.gz $(RIAK_TAG)

ballclean:
rm -rf $(RIAK_TAG).tar.gz distdir

0 comments on commit f788e94

Please sign in to comment.