Build script to make Tweak releases simpler.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 8 Feb 2007 18:50:07 +0000 (18:50 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 8 Feb 2007 18:50:07 +0000 (18:50 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/tweak@7256 cda61777-01e9-0310-a592-d414129be87e

Buildscr [new file with mode: 0644]
tweak.h

diff --git a/Buildscr b/Buildscr
new file mode 100644 (file)
index 0000000..8766ce8
--- /dev/null
+++ b/Buildscr
@@ -0,0 +1,26 @@
+# -*- sh -*-
+# Build script for making Tweak release archives.
+
+module tweak
+
+# We need the `library' module checked out alongside this one, for
+# btree.[ch].
+checkout library library
+
+# Make symlinks for those source files.
+in tweak do ln -s ../library/btree.c .
+in tweak do ln -s ../library/btree.h .
+
+# Determine the version number.
+set Ver r$(revision)
+ifneq $(RELEASE) "" set Ver $(RELEASE)
+
+# Fiddle with tweak.h to include the version number. Note use of $#
+# to escape a hash sign from the build script lexer.
+in tweak do perl -i~ -pe 's/(?<=$#define VER ")(?=")/$(Ver)/' tweak.h
+
+# Make the release archive.
+in tweak do make release VERSION=$(Ver)
+
+# And deliver it.
+deliver tweak/tweak-$(Ver).tar.gz $@
diff --git a/tweak.h b/tweak.h
index eeb6236..c917b40 100644 (file)
--- a/tweak.h
+++ b/tweak.h
@@ -27,7 +27,9 @@
 #define ABORT 7                               /* character code for ^G */
 #endif
 
-#define VER "3.01"                    /* version */
+#ifndef VER
+#define VER ""
+#endif
 
 #define SEARCH_BLK 65536              /* so can this */
 #define SAVE_BLKSIZ 32768             /* and this too */