forked from NetworkConfiguration/dhcpcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
121 lines (92 loc) · 3.11 KB
/
Makefile
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
SUBDIRS= src hooks
PACKAGE= dhcpcd
VERSION!= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
DIST!= if test -d .git; then echo "dist-git"; \
else echo "dist-inst"; fi
FOSSILID?= current
GITREF?= HEAD
DISTSUFFIX=
DISTPREFIX?= ${PACKAGE}-${VERSION}${DISTSUFFIX}
DISTFILE?= ${DISTPREFIX}.tar.xz
DISTINFO= ${DISTFILE}.distinfo
DISTINFOMD= ${DISTINFO}.md
DISTSIGN= ${DISTFILE}.asc
CLEANFILES+= *.tar.xz
.PHONY: hooks import import-bsd tests
.SUFFIXES: .in
all: config.h
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
depend: config.h
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
tests:
cd $@; ${MAKE} $@
test: tests
hooks:
cd $@; ${MAKE}
eginstall:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
install:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
proginstall:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
clean:
rm -rf cov-int dhcpcd.xz
for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
distclean: clean
rm -f config.h config.mk config.log \
${DISTFILE} ${DISTINFO} ${DISTINFOMD} ${DISTSIGN}
rm -f *.diff *.patch *.orig *.rej
for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
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}
snapshot:
rm -rf /tmp/${DISTPREFIX}
${INSTALL} -d /tmp/${DISTPREFIX}
cp -RPp * /tmp/${DISTPREFIX}
${MAKE} -C /tmp/${DISTPREFIX} distclean
tar cf - -C /tmp ${DISTPREFIX} | xz >${DISTFILE}
ls -l ${DISTFILE}
_import: dist
rm -rf ${DESTDIR}/*
${INSTALL} -d ${DESTDIR}
tar xvpf ${DISTFILE} -C ${DESTDIR} --strip 1
@${ECHO}
@${ECHO} "============================================================="
@${ECHO} "${PACKAGE}-${VERSION} imported to ${DESTDIR}"
import:
${MAKE} _import DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi`
_import-src: clean
rm -rf ${DESTDIR}/*
${INSTALL} -d ${DESTDIR}
cp LICENSE README.md ${DESTDIR};
for x in ${SUBDIRS}; do cd $$x; ${MAKE} DESTDIR=${DESTDIR} $@ || exit $$?; cd ..; done
@${ECHO}
@${ECHO} "============================================================="
@${ECHO} "${PACKAGE}-${VERSION} imported to ${DESTDIR}"
import-src:
${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi`
include Makefile.inc