dhcpcd/Makefile

122 lines
3.1 KiB
Makefile
Raw Permalink Normal View History

2017-03-16 17:54:30 +08:00
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"; \
2017-03-16 18:01:12 +08:00
else echo "dist-inst"; fi
FOSSILID?= current
2017-03-16 18:01:12 +08:00
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:
2017-03-16 17:54:30 +08:00
cd $@; ${MAKE}
2015-12-23 07:46:17 +08:00
eginstall:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
2015-12-23 07:46:17 +08:00
install:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
2017-03-31 17:48:42 +08:00
proginstall:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
2017-03-31 17:48:42 +08:00
clean:
2017-04-14 17:34:18 +08:00
rm -rf cov-int dhcpcd.xz
for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
2010-06-10 05:16:04 +08:00
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
2010-06-10 05:16:04 +08:00
2017-03-16 18:01:12 +08:00
dist-git:
git archive --prefix=${DISTPREFIX}/ v${VERSION} | xz >${DISTFILE}
2017-03-16 18:01:12 +08:00
dist-inst:
mkdir /tmp/${DISTPREFIX}
cp -RPp * /tmp/${DISTPREFIX}
(cd /tmp/${DISTPREFIX}; make clean)
tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX}
2017-03-16 18:01:12 +08:00
rm -rf /tmp/${DISTPREFIX}
dist: ${DIST}
distinfo: dist
rm -f ${DISTINFO} ${DISTSIGN}
${SHA256} ${DISTFILE} >${DISTINFO}
2023-04-21 21:58:25 +08:00
wc -c <${DISTFILE} \
| xargs printf 'Size (${DISTFILE}) = %s\n' >>${DISTINFO}
${PGP} --armour --detach-sign ${DISTFILE}
chmod 644 ${DISTSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN}
2023-04-20 19:12:14 +08:00
${DISTINFOMD}: ${DISTINFO}
echo '```' >${DISTINFOMD}
cat ${DISTINFO} >>${DISTINFOMD}
echo '```' >>${DISTINFOMD}
2023-04-20 19:12:14 +08:00
release: distinfo ${DISTINFOMD}
gh release create v${VERSION} \
--title "${PACKAGE} ${VERSION}" --draft --generate-notes \
--notes-file ${DISTINFOMD} \
${DISTFILE} ${DISTSIGN}
2015-02-23 20:16:17 +08:00
snapshot:
rm -rf /tmp/${DISTPREFIX}
${INSTALL} -d /tmp/${DISTPREFIX}
cp -RPp * /tmp/${DISTPREFIX}
2016-02-15 22:23:51 +08:00
${MAKE} -C /tmp/${DISTPREFIX} distclean
tar cf - -C /tmp ${DISTPREFIX} | xz >${DISTFILE}
2015-02-23 20:16:17 +08:00
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`
2020-07-02 21:05:19 +08:00
_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