Use git
[dhcpcd-ui] / mk / dist.mk
1 # rules to make a distribution tarball from a svn repo
2 # Copyright 2008 Roy Marples <roy@marples.name>
3
4 GITREF?=        HEAD
5 DISTPREFIX?=    ${PROG}-${VERSION}
6 DISTFILE?=      ${DISTPREFIX}.tar.bz2
7
8 CLEANFILES+=    *.tar.bz2
9
10 _SNAP_SH=       date -u +%Y%m%d%H%M
11 _SNAP!=         ${_SNAP_SH}
12 SNAP=           ${_SNAP}$(shell ${_SNAP_SH})
13 SNAPDIR=        ${DISTPREFIX}-${SNAP}
14 SNAPFILE=       ${SNAPDIR}.tar.bz2
15
16 dist:
17         git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
18
19 snapshot:
20         mkdir /tmp/${SNAPDIR}
21         cp -RPp * /tmp/${SNAPDIR}
22         (cd /tmp/${SNAPDIR}; make clean)
23         tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
24         rm -rf /tmp/${SNAPDIR}
25         ls -l ${SNAPFILE}
26
27 snap: snapshot