File: Makefile

package info (click to toggle)
dhcpcd-ui 0.7.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,580 kB
  • sloc: ansic: 6,459; cpp: 2,060; sh: 482; makefile: 212
file content (82 lines) | stat: -rw-r--r-- 1,885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
PROG=		dhcpcd-ui
PACKAGE=	${PROG}
VERSION=	0.7.9

TOPDIR=		.
include ${TOPDIR}/iconfig.mk
include ${MKDIR}/subdir.mk

.PHONY:		icons

SUBDIR=		src ${MKICONS}

DIST!=		if test -d .git; then echo "dist-git"; \
		else echo "dist-inst"; fi
DISTPREFIX?=	${PACKAGE}-${VERSION}
DISTFILETAR?=	${DISTPREFIX}.tar
DISTFILE?=	${DISTFILETAR}.xz
DISTINFO=	${DISTFILE}.distinfo
DISTINFOMD=	${DISTINFO}.md
DISTSIGN=	${DISTFILE}.asc

CLEANFILES+=	${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}

_SNAP_SH=	date -u +%Y%m%d%H%M
_SNAP!=		${_SNAP_SH}
SNAP=		${_SNAP}$(shell ${_SNAP_SH})
SNAPDIR=	${DISTPREFIX}-${SNAP}
SNAPFILE=	${SNAPDIR}.tar.xz

SHA256?=	sha256
PGP?=		gpg

dist-git:
	git archive --prefix=${DISTPREFIX}/ v${VERSION} | 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} ${DISTSIGN}
	${SHA256} ${DISTFILE} >${DISTINFO}
	wc -c <${DISTFILE} \
		| xargs printf 'Size   (${DISTFILE}) = %s\n' >>${DISTINFO}
	${PGP} --armour --detach-sign ${DISTFILE}
	chmod 644 ${DISTSIGN}
	ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN}

${DISTINFOMD}: ${DISTINFO}
	echo '```' >${DISTINFOMD}
	cat ${DISTINFO} >>${DISTINFOMD}
	echo '```' >>${DISTINFOMD}

release: distinfo ${DISTINFOMD}
	gh release create v${VERSION} \
		--title "${PACKAGE} ${VERSION}" --draft --generate-notes \
		--notes-file ${DISTINFOMD} \
		${DISTFILE} ${DISTSIGN}

distclean:
	(cd src; make clean)
	rm -f config.h config.mk config.log \
		dhcpcd-ui-*.tar.xz*

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