2009-07-14 21:59:30 +08:00
|
|
|
# dhcpcd Makefile
|
2007-04-09 01:35:22 +08:00
|
|
|
|
2008-01-08 07:45:48 +08:00
|
|
|
PROG= dhcpcd
|
2008-09-04 00:49:28 +08:00
|
|
|
SRCS= arp.c bind.c common.c control.c dhcp.c dhcpcd.c duid.c eloop.c
|
2008-09-10 01:07:48 +08:00
|
|
|
SRCS+= if-options.c if-pref.c ipv4ll.c net.c signals.c
|
2008-09-02 21:28:11 +08:00
|
|
|
SRCS+= configure.c
|
2007-09-04 20:48:40 +08:00
|
|
|
|
2009-07-14 21:59:30 +08:00
|
|
|
CFLAGS?= -O2
|
|
|
|
CSTD?= c99
|
|
|
|
CFLAGS+= -std=${CSTD}
|
|
|
|
include config.mk
|
|
|
|
|
|
|
|
OBJS+= ${SRCS:.c=.o}
|
|
|
|
|
2008-05-25 01:15:14 +08:00
|
|
|
SCRIPT= ${LIBEXECDIR}/dhcpcd-run-hooks
|
|
|
|
HOOKDIR= ${LIBEXECDIR}/dhcpcd-hooks
|
2008-05-20 20:23:29 +08:00
|
|
|
|
2009-07-14 21:59:30 +08:00
|
|
|
MAN5= dhcpcd.conf.5
|
|
|
|
MAN8= dhcpcd.8 dhcpcd-run-hooks.8
|
2008-05-25 01:15:14 +08:00
|
|
|
CLEANFILES= dhcpcd.conf.5 dhcpcd.8 dhcpcd-run-hooks.8
|
2008-05-19 23:50:50 +08:00
|
|
|
|
2008-05-25 01:15:14 +08:00
|
|
|
SCRIPTS= dhcpcd-run-hooks
|
2008-05-22 17:23:03 +08:00
|
|
|
SCRIPTSDIR= ${LIBEXECDIR}
|
2008-05-25 01:15:14 +08:00
|
|
|
CLEANFILES+= dhcpcd-run-hooks
|
2009-07-14 21:59:30 +08:00
|
|
|
CLEANFILES+= .depend
|
2008-05-19 23:50:50 +08:00
|
|
|
|
|
|
|
FILES= dhcpcd.conf
|
|
|
|
FILESDIR= ${SYSCONFDIR}
|
2007-09-04 20:48:40 +08:00
|
|
|
|
2009-07-14 21:59:30 +08:00
|
|
|
LDFLAGS+= -Wl,-rpath=${PREFIX}/${LIBNAME}
|
2006-11-28 04:23:22 +08:00
|
|
|
|
2008-05-25 01:37:15 +08:00
|
|
|
SUBDIRS= dhcpcd-hooks
|
2008-05-20 18:55:25 +08:00
|
|
|
|
2008-05-20 20:23:29 +08:00
|
|
|
SED_DBDIR= -e 's:@DBDIR@:${DBDIR}:g'
|
|
|
|
SED_HOOKDIR= -e 's:@HOOKDIR@:${HOOKDIR}:g'
|
|
|
|
SED_SCRIPT= -e 's:@SCRIPT@:${SCRIPT}:g'
|
|
|
|
SED_SYS= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
|
|
|
|
|
2009-07-14 21:59:30 +08:00
|
|
|
_DEPEND_SH= test -e .depend && echo ".depend" || echo ""
|
|
|
|
_DEPEND!= ${_DEPEND_SH}
|
|
|
|
DEPEND= ${_DEPEND}$(shell ${_DEPEND_SH})
|
|
|
|
|
|
|
|
_VERSION_SH= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' defs.h
|
|
|
|
_VERSION!= ${_VERSION_SH}
|
|
|
|
VERSION= ${_VERSION}$(shell ${_VERSION_SH})
|
|
|
|
|
|
|
|
GITREF?= HEAD
|
|
|
|
DISTPREFIX?= ${PROG}-${VERSION}
|
|
|
|
DISTFILE?= ${DISTPREFIX}.tar.bz2
|
|
|
|
|
|
|
|
CLEANFILES+= *.tar.bz2
|
|
|
|
|
|
|
|
.SUFFIXES: .in
|
|
|
|
|
2008-01-18 02:49:26 +08:00
|
|
|
.in:
|
2008-05-20 20:23:29 +08:00
|
|
|
${SED} ${SED_DBDIR} ${SED_HOOKDIR} ${SED_SCRIPT} ${SED_SYS} $< > $@
|
2008-04-16 17:51:20 +08:00
|
|
|
|
2009-07-14 21:59:30 +08:00
|
|
|
|
|
|
|
all: ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
|
|
|
|
|
|
|
|
.depend: ${SRCS}
|
|
|
|
${CC} ${CPPFLAGS} -MM ${SRCS} > .depend
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
${PROG}: ${DEPEND} ${OBJS}
|
|
|
|
${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
|
|
|
|
|
|
|
|
_proginstall: ${PROG}
|
|
|
|
${INSTALL} -d ${DESTDIR}${SBINDIR}
|
|
|
|
${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
|
|
|
|
${INSTALL} -d ${DESTDIR}${DBDIR}
|
|
|
|
|
|
|
|
_scriptsinstall: ${SCRIPTS}
|
|
|
|
${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
|
|
|
|
${INSTALL} -m ${BINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR}
|
|
|
|
|
|
|
|
_maninstall: ${MAN5} ${MAN8}
|
|
|
|
${INSTALL} -d ${DESTDIR}${MANDIR}5
|
|
|
|
${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}5
|
|
|
|
${INSTALL} -d ${DESTDIR}${MANDIR}8
|
|
|
|
${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}8
|
|
|
|
|
|
|
|
_confinstall:
|
|
|
|
${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
|
|
|
|
test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
|
|
|
|
${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
|
|
|
|
|
|
|
|
install: _proginstall _scriptsinstall _maninstall _confinstall
|
|
|
|
for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
|
|
|
|
|
|
|
|
dist:
|
|
|
|
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
|
|
|
|
|
|
|
|
include Makefile.inc
|