makefile: add 'dist' target.

This commit is contained in:
Jonathan Moore Liles 2008-05-27 17:14:37 -05:00
parent b4e2a6b4b6
commit f0b0c455c7
2 changed files with 39 additions and 3 deletions

View File

@ -69,10 +69,12 @@ TAGS: $(SRCS)
clean_deps: clean_deps:
@ rm -f .deps @ rm -f .deps
clean_sources: SOURCES = Timeline/.sources FL/.sources
@ rm -f Timeline/.sources FL/.sources
.sources: Timeline/.sources FL/.sources clean_sources:
@ rm -f $(SOURCES)
.sources: $(SOURCES)
rearrange: clean_deps clean_sources rearrange: clean_deps clean_sources
@ $(MAKE) -s .deps @ $(MAKE) -s .deps
@ -82,4 +84,12 @@ rearrange: clean_deps clean_sources
clean: FL_clean Timeline_clean 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 -include .deps

26
scripts/dist Executable file
View File

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