dhcpcd/Makefile

104 lines
2.9 KiB
Makefile
Raw Normal View History

SUBDIRS= src dhcpcd-hooks
VERSION!= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
FOSSILID?= current
DISTPREFIX?= ${PROG}-${VERSION}
DISTFILEGZ?= ${DISTPREFIX}.tar.gz
DISTFILE?= ${DISTPREFIX}.tar.xz
DISTINFO= ${DISTFILE}.distinfo
DISTINFOSIGN= ${DISTINFO}.asc
CKSUM?= cksum -a SHA256
PGP?= netpgp
HOST_SH?= /bin/sh
CLEANFILES+= *.tar.xz
.PHONY: import import-bsd test
.SUFFIXES: .in
all: config.h
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
depend: config.h
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
test:
cd $@; ${MAKE} $@; ./$@
hooks:
cd dhcpcd-hooks; ${MAKE}; cd ..; done
2015-12-23 07:46:17 +08:00
eginstall:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
install:
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
clean:
for x in ${SUBDIRS} test; do cd $$x; ${MAKE} $@; cd ..; done
2010-06-10 05:16:04 +08:00
distclean: clean
rm -f config.h config.mk config.log \
${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
2010-06-10 05:16:04 +08:00
dist:
fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
rm ${DISTFILEGZ}
distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
${CKSUM} ${DISTFILE} >${DISTINFO}
#printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
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: ${SRCS} hooks
rm -rf /tmp/${DISTPREFIX}
${INSTALL} -d /tmp/${DISTPREFIX}
cp genembedc genembedh /tmp/${DISTPREFIX}
cp $$(echo ${SRCS} | sed -e 's/\(dhcpcd-embedded.[ch]\)/\1.in/') \
/tmp/${DISTPREFIX}
cp dhcpcd.conf dhcpcd-definitions.conf *.in /tmp/${DISTPREFIX}
cp dhcpcd-definitions-small.conf *.in /tmp/${DISTPREFIX}
cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM \
$$(echo ${SRCS} | sed -e 's/dhcpcd-embedded.c//') | \
2010-02-27 23:33:18 +08:00
sed -e 's/^.*\.c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
tr ' ' '\n' | \
sed -e '/^dhcpcd-embedded.h$$/d' | \
2009-11-20 20:40:59 +08:00
sed -e '/^compat\//d' | \
2014-01-31 23:55:16 +08:00
sed -e '/^crypt\//d' | \
sort -u) /tmp/${DISTPREFIX}; \
if test -n "${CRYPT_SRCS}"; then \
2014-01-31 23:55:16 +08:00
${INSTALL} -d /tmp/${DISTPREFIX}/crypt; \
cp ${CRYPT_SRCS} /tmp/${DISTPREFIX}/crypt; \
cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM ${CRYPT_SRCS} | \
2014-01-31 23:55:16 +08:00
sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
tr ' ' '\n' | sed -e '/\/\.\.\//d' | \
2014-01-31 23:55:16 +08:00
sort -u) /tmp/${DISTPREFIX}/crypt; \
fi;
2009-10-09 04:21:23 +08:00
if test -n "${COMPAT_SRCS}"; then \
${INSTALL} -d /tmp/${DISTPREFIX}/compat; \
cp ${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \
cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM ${COMPAT_SRCS} | \
2010-02-27 23:33:18 +08:00
sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
tr ' ' '\n' | \
2009-10-09 04:21:23 +08:00
sort -u) /tmp/${DISTPREFIX}/compat; \
fi;
cd dhcpcd-hooks; ${MAKE} DISTPREFIX=${DISTPREFIX} $@
include Makefile.inc