comparison Makefile @ 1:bc8961a81af6 release

2007-08-13 22:53:14 by steve Initial revision
author steve
date Mon, 13 Aug 2007 22:53:14 +0000
parents
children 8503c495b169
comparison
equal deleted inserted replaced
0:30c6796bded8 1:bc8961a81af6
1 #
2 # Utility makefile for people working with chronicle
3 #
4 # The targets are intended to be useful for people who are using
5 # the CVS repository - but it also contains other useful targets.
6 #
7 # Steve
8 # --
9 # http://www.steve.org.uk/
10 #
11 # $Id: Makefile,v 1.1.1.1 2007-08-13 22:53:14 steve Exp $
12
13
14 #
15 # Only used to build distribution tarballs.
16 #
17 DIST_PREFIX = ${TMP}
18 VERSION = 0.1
19 BASE = chronicle
20
21
22 #
23 # Installation prefix, useful for the Debian package.
24 #
25 prefix=
26
27
28 nop:
29 @echo "Valid targets are (alphabetically) :"
30 @echo " "
31 @echo " clean = Remove bogus files and any local output."
32 @echo " diff = Run a 'cvs diff'."
33 @echo " test = Run our simple test cases."
34 @echo " test-verbose = Run our simple test cases, verbosely."
35 @echo " update = Update from the CVS repository."
36 @echo " "
37
38
39 #
40 # Delete all temporary files, recursively.
41 #
42 clean:
43 @find . -name '.*~' -exec rm \{\} \;
44 @find . -name '.#*' -exec rm \{\} \;
45 @find . -name '*~' -exec rm \{\} \;
46 @find . -name '*.bak' -exec rm \{\} \;
47 @find . -name '*.tmp' -exec rm \{\} \;
48 @if [ -d output ]; then rm -rf output; mkdir output; fi
49 #
50 # Show what has been changed in the local copy vs. the CVS repository.
51 #
52 diff:
53 cvs diff --unified 2>/dev/null
54
55
56 #
57 # Make a new release tarball, and make a GPG signature.
58 #
59 release: clean
60 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
61 rm -f $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz
62 cp -R . $(DIST_PREFIX)/$(BASE)-$(VERSION)
63 find $(DIST_PREFIX)/$(BASE)-$(VERSION) -name "CVS" -print | xargs rm -rf
64 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/debian
65 cd $(DIST_PREFIX) && tar --exclude=.cvsignore -cvf $(DIST_PREFIX)/$(BASE)-$(VERSION).tar $(BASE)-$(VERSION)/
66 gzip $(DIST_PREFIX)/$(BASE)-$(VERSION).tar
67 mv $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz .
68 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
69 gpg --armour --detach-sign $(BASE)-$(VERSION).tar.gz
70
71
72 #
73 # Run the test suite.
74 #
75 test:
76 prove --shuffle tests/
77
78
79 #
80 # Run the test suite verbosely.
81 #
82 test-verbose:
83 prove --shuffle --verbose tests/
84
85
86
87 #
88 # Update the local copy from the CVS repository.
89 #
90 # NOTE: Removes empty local directories.
91 #
92 update:
93 cvs -z3 update -A -P -d 2>/dev/null