summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-03-16 10:01:12 +0000
committerRoy Marples <roy@marples.name>2017-03-16 10:01:12 +0000
commit0c1027ff138f321fbb193478c0f6b3aaf344f961 (patch)
treecf4fc08de421f3ee13f224e0f8a502f1f0255118 /Makefile
parent08d10095f6a755d1b809c3d08589f0b4d69650ec (diff)
downloaddhcpcd-0c1027ff138f321fbb193478c0f6b3aaf344f961.tar.xz
Fix building the distribution.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 5e2f3d0c..baa7caca 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,13 @@ SUBDIRS= src hooks
VERSION!= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
+DIST!= if test -f .fslckout; then echo "dist-fossil"; \
+ elif test -d .git; then echo "dist-git"; \
+ else echo "dist-inst"; fi
FOSSILID?= current
+GITREF?= HEAD
-DISTPREFIX?= ${PROG}-${VERSION}
+DISTPREFIX?= dhcpcd-${VERSION}
DISTFILEGZ?= ${DISTPREFIX}.tar.gz
DISTFILE?= ${DISTPREFIX}.tar.xz
DISTINFO= ${DISTFILE}.distinfo
@@ -45,11 +49,24 @@ distclean: clean
rm -f config.h config.mk config.log \
${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
-dist:
+
+dist-fossil:
fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
rm ${DISTFILEGZ}
+dist-git:
+ git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+ mkdir /tmp/${DISTPREFIX}
+ cp -RPp * /tmp/${DISTPREFIX}
+ (cd /tmp/${DISTPREFIX}; make clean)
+ tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+ rm -rf /tmp/${DISTPREFIX}
+
+dist: ${DIST}
+
distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
${CKSUM} ${DISTFILE} >${DISTINFO}