dhcpcd: Adjust Makefile for dhcpcd-8.0.4
[dragonfly.git] / sbin / dhcpcd / Makefile
CommitLineData
5d669bfa
AL
1# Derived from NetBSD's Makefile for dhcpcd
2
3DISTDIR= ${.CURDIR}/../../contrib/dhcpcd
4
5PROG= dhcpcd
6
7SRCDIR= ${DISTDIR}/src
8.PATH: ${SRCDIR}
9CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR} -I${SRCDIR} -I${DISTDIR}
10SRCS= common.c control.c dhcpcd.c duid.c eloop.c logerr.c
11SRCS+= if.c if-options.c route.c sa.c script.c
12SRCS+= dhcp-common.c dhcpcd-embedded.c
13SRCS+= if-bsd.c
14
15CFLAGS+= -DAUTH
16SRCS+= auth.c
17
fa94e205
RM
18CFLAGS+= -DINET
19SRCS+= bpf.c dhcp.c ipv4.c
20CFLAGS+= -DARP -DARPING
21SRCS+= arp.c
22CFLAGS+= -DIPV4LL
5d669bfa
AL
23SRCS+= ipv4ll.c
24
25CFLAGS+= -DINET6
26SRCS+= ipv6.c ipv6nd.c
27CFLAGS+= -DDHCP6
28SRCS+= dhcp6.c
29
30.PATH: ${DISTDIR}/compat
fa94e205 31SRCS+= pidfile.c rb.c strtoi.c strtou.c
5d669bfa
AL
32.PATH: ${DISTDIR}/compat/crypt
33SRCS+= hmac.c
34
31f23bc7 35# Fully convert to openssl/md5.h and openssl/sha2.h
fa94e205 36CFLAGS+= -DUSE_PRIVATECRYPTO
31f23bc7 37FLAGS_GROUPS= openssl
38openssl_FLAGS= -I${_SHLIBDIRPREFIX}/usr/include/priv/openssl
39openssl_FLAGS+= -DMD5Init=MD5_Init -DMD5Update=MD5_Update -DMD5Final=MD5_Final
40openssl_FLAGS_FILES= hmac.c ipv6.c
41
42CFLAGS+= ${PRIVATELIB_CFLAGS}
43DPADD= ${LIBCRYPTO}
44LDADD= -lprivate_crypto
5d669bfa 45LDFLAGS+= ${PRIVATELIB_LDFLAGS}
5d669bfa
AL
46
47# system directories
48_SYSCONFDIR= /etc
49_LIBDIR= /usr/lib
50_LIBEXECDIR= /usr/libexec
51_DBDIR= /var/db/dhcpcd
52_RUNDIR= /var/run
53CFLAGS+= -DSYSCONFDIR='"${_SYSCONFDIR}"' \
54 -DSBINDIR='"${BINDIR}"' \
55 -DLIBDIR='"${_LIBDIR}"' \
56 -DLIBEXECDIR='"${_LIBEXECDIR}"' \
57 -DDBDIR='"${_DBDIR}"' \
58 -DRUNDIR='"${_RUNDIR}"'
59
60_DATADIR= /usr/share/examples
61_HOOKDIR= ${_LIBEXECDIR}/dhcpcd-hooks
62_SED_CMDS= -e 's:@SYSCONFDIR@:${_SYSCONFDIR}:g' \
63 -e 's:@DATADIR@:${_DATADIR}:g' \
64 -e 's:@DBDIR@:${_DBDIR}:g' \
65 -e 's:@LIBDIR@:${_LIBDIR}:g' \
66 -e 's:@RUNDIR@:${_RUNDIR}:g' \
67 -e 's:@HOOKDIR@:${_HOOKDIR}:g' \
68 -e 's:@SCRIPT@:${_LIBEXECDIR}/dhcpcd-run-hooks:g' \
69 -e 's:@SERVICEEXISTS@::g' \
70 -e 's:@SERVICECMD@::g' \
71 -e 's:@SERVICESTATUS@::g' \
72 -e 's:@STATUSARG@::g' \
73 -e 's:@YPDOMAIN_DIR@::g' \
74 -e 's:@YPDOMAIN_SUFFIX@::g'
75
76MAN= dhcpcd.conf.5 dhcpcd.8
77.for f in dhcpcd.conf.5 dhcpcd.8
78CLEANFILES+= ${f}
79${f}: ${f}.in
80 sed ${_SED_CMDS} ${SRCDIR}/${f}.in > $@
81.endfor
82
83# NOTE:
84# The configuration file 'dhcpcd.conf' is installed by 'etc/Makefile'
85
86#
87# Hooks
88#
89
90HOOKSRC= ${DISTDIR}/hooks
91.PATH: ${HOOKSRC}
92
93SCRIPTS= dhcpcd-run-hooks
94SCRIPTSDIR= ${_LIBEXECDIR}
95MAN+= dhcpcd-run-hooks.8
96
97FILES= 01-test 02-dump 20-resolv.conf 30-hostname
98FILESDIR= ${_HOOKDIR}
99
100# Example hooks that should not be installed by default
101.for f in 10-wpa_supplicant 15-timezone 29-lookup-hostname 50-ypbind
102FILES+= ${f}
103FILESDIR_${f}= ${_DATADIR}/dhcpcd/hooks
104.endfor
105
106.for f in dhcpcd-run-hooks dhcpcd-run-hooks.8 50-ypbind
107CLEANFILES+= ${f}
108${f}: ${f}.in
109 sed ${_SED_CMDS} ${HOOKSRC}/${f}.in > $@
110.endfor
111
112.include <bsd.prog.mk>