Update copyrights and grab version in configure.
[dhcpcd-ui] / Makefile
index bf34733a4c068591082cb24c34f8ca21470e20f6..4880876a96de02bf71f2def83cd7a2fb6d7f269f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,41 @@ VERSION=       0.4.3
 
 SUBDIR=                src icons
 
-MK=    mk
-include ${MK}/subdir.mk
-include ${MK}/dist.mk
+TOPDIR=                .
+include ${TOPDIR}/config.mk
+include ${MKDIR}/subdir.mk
+
+GITREF?=       HEAD
+DISTPREFIX?=   ${PROG}-${VERSION}
+DISTFILE?=     ${DISTPREFIX}.tar.bz2
+
+CLEANFILES+=   *.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:
+       mkdir /tmp/${DISTPREFIX}
+       cp -RPp * /tmp/${DISTPREFIX}
+       (cd /tmp/${DISTPREFIX}; make clean icons; rm config.h config.mk)
+       find /tmp/${DISTPREFIX} -name .gitignore -delete
+       tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+       rm -rf /tmp/${DISTPREFIX}
+       ls -l ${DISTFILE}
+
+snapshot: icons
+       mkdir /tmp/${SNAPDIR}
+       cp -RPp * /tmp/${SNAPDIR}
+       (cd /tmp/${SNAPDIR}; make clean; rm config.h config.mk)
+       find /tmp/${SNAPDIR} -name .gitignore -delete
+       tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
+       rm -rf /tmp/${SNAPDIR}
+       ls -l ${SNAPFILE}
+
+snap: snapshot
 
 icons:
        ${MAKE} -C icons