diff --git a/Makefile b/Makefile index 6ed3494..4347208 100644 --- a/Makefile +++ b/Makefile @@ -69,10 +69,12 @@ TAGS: $(SRCS) clean_deps: @ rm -f .deps -clean_sources: - @ rm -f Timeline/.sources FL/.sources +SOURCES = Timeline/.sources FL/.sources -.sources: Timeline/.sources FL/.sources +clean_sources: + @ rm -f $(SOURCES) + +.sources: $(SOURCES) rearrange: clean_deps clean_sources @ $(MAKE) -s .deps @@ -82,4 +84,12 @@ rearrange: clean_deps clean_sources clean: FL_clean Timeline_clean +# (generated) files not in git that need to go into the distribution tarball +EXTRA_DIST := $(SOURCES) + +dist: .sources + @ echo -n Building tarball... + @ scripts/dist non-daw $(VERSION) $(EXTRA_DIST) + @ echo $(DONE) + -include .deps diff --git a/scripts/dist b/scripts/dist new file mode 100755 index 0000000..c5c426f --- /dev/null +++ b/scripts/dist @@ -0,0 +1,26 @@ +#!/bin/sh + +# May 2008 Jonathan Moore Liles +# +# Use git to build a distribution tarball. +# +# USAGE: +# +# dist foo 1.2.0 extra-files ... +# +# This will build a tarball foo-1.2.0.tar.bz2 using git tag 'v1.2.0' +# +# Files not in git but listed as arguemnts will also be included in the archive. + +. colors + +NAME="$1" +shift 1 +VERSION="$1" +shift 1 +EXTRA_DIST="$@" + +PREFIX="${NAME}-${VERSION}" +git archive --prefix="${PREFIX}/" v${VERSION} > ${PREFIX}.tar +tar --owner 0 --group 0 --transform "s:^:${PREFIX}/:" -rf ${PREFIX}.tar ${EXTRA_DIST} +bzip2 -f ${PREFIX}.tar