aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-12 23:12:06 +0000
committerRoy Marples <roy@marples.name>2009-01-12 23:12:06 +0000
commit2243c013900f1d3d850acf066dde2e83f41b3ed9 (patch)
tree5df3c682d0fad412f72c481ac49cf875191a551a
parenta52472c3c3dda0a24a5eed66eb9c3974c09f7192 (diff)
Add snapshot and snap targets
-rw-r--r--mk/dist.mk21
1 files changed, 20 insertions, 1 deletions
diff --git a/mk/dist.mk b/mk/dist.mk
index 657c2f71..179da847 100644
--- a/mk/dist.mk
+++ b/mk/dist.mk
@@ -5,9 +5,28 @@
DISTPREFIX?= ${NAME}-${VERSION}
DISTFILE?= ${DISTPREFIX}.tar.bz2
-CLEANFILES+= ${DISTFILE}
+CLEANFILES+= ${NAME}-*.tar.bz2
+
+_SNAP_SH= date -u +%Y%m%d%H%M
+_SNAP!= ${_SNAP_SH}
+SNAP= ${_SNAP}$(shell ${_SNAP_SH})
+SNAPDIR= ${DISTPREFIX}-${SNAP}
+SNAPFILE= ${SNAPDIR}.tar.bz2
dist:
svn export . ${DISTPREFIX}
tar cjpf ${DISTFILE} ${DISTPREFIX}
rm -rf ${DISTPREFIX}
+
+snapshot:
+ rm -rf /tmp/${SNAPDIR}
+ mkdir /tmp/${SNAPDIR}
+ cp -RPp * /tmp/${SNAPDIR}
+ (cd /tmp/${SNAPDIR}; make clean)
+ find /tmp/${SNAPDIR} -name .svn -exec rm -rf -- {} \; 2>/dev/null || true
+ tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
+ rm -rf /tmp/${SNAPDIR}
+ ls -l ${SNAPFILE}
+
+snap: snapshot
+