dhcpcd: Fix build for 9.1.2
[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
c891d45b 30CFLAGS+= -DPRIVSEP -DPRIVSEP_USER='"_dhcp"'
fdbdc70a 31SRCS+= privsep.c privsep-root.c privsep-inet.c privsep-control.c
c891d45b
RM
32SRCS+= privsep-bpf.c
33SRCS+= privsep-bsd.c
34
5d669bfa 35.PATH: ${DISTDIR}/compat
fa94e205 36SRCS+= pidfile.c rb.c strtoi.c strtou.c
5d669bfa
AL
37.PATH: ${DISTDIR}/compat/crypt
38SRCS+= hmac.c
39
31f23bc7 40# Fully convert to openssl/md5.h and openssl/sha2.h
fa94e205 41CFLAGS+= -DUSE_PRIVATECRYPTO
31f23bc7 42FLAGS_GROUPS= openssl
43openssl_FLAGS= -I${_SHLIBDIRPREFIX}/usr/include/priv/openssl
44openssl_FLAGS+= -DMD5Init=MD5_Init -DMD5Update=MD5_Update -DMD5Final=MD5_Final
45openssl_FLAGS_FILES= hmac.c ipv6.c
46
47CFLAGS+= ${PRIVATELIB_CFLAGS}
48DPADD= ${LIBCRYPTO}
49LDADD= -lprivate_crypto
5d669bfa 50LDFLAGS+= ${PRIVATELIB_LDFLAGS}
5d669bfa
AL
51
52# system directories
53_SYSCONFDIR= /etc
54_LIBDIR= /usr/lib
55_LIBEXECDIR= /usr/libexec
56_DBDIR= /var/db/dhcpcd
c891d45b 57_RUNDIR= /var/run/dhcpcd
5d669bfa
AL
58CFLAGS+= -DSYSCONFDIR='"${_SYSCONFDIR}"' \
59 -DSBINDIR='"${BINDIR}"' \
60 -DLIBDIR='"${_LIBDIR}"' \
61 -DLIBEXECDIR='"${_LIBEXECDIR}"' \
62 -DDBDIR='"${_DBDIR}"' \
63 -DRUNDIR='"${_RUNDIR}"'
64
65_DATADIR= /usr/share/examples
66_HOOKDIR= ${_LIBEXECDIR}/dhcpcd-hooks
67_SED_CMDS= -e 's:@SYSCONFDIR@:${_SYSCONFDIR}:g' \
68 -e 's:@DATADIR@:${_DATADIR}:g' \
69 -e 's:@DBDIR@:${_DBDIR}:g' \
70 -e 's:@LIBDIR@:${_LIBDIR}:g' \
71 -e 's:@RUNDIR@:${_RUNDIR}:g' \
72 -e 's:@HOOKDIR@:${_HOOKDIR}:g' \
73 -e 's:@SCRIPT@:${_LIBEXECDIR}/dhcpcd-run-hooks:g' \
74 -e 's:@SERVICEEXISTS@::g' \
75 -e 's:@SERVICECMD@::g' \
76 -e 's:@SERVICESTATUS@::g' \
77 -e 's:@STATUSARG@::g' \
64ee5ebc 78 -e 's:@DEFAULT_HOSTNAME@::g' \
5d669bfa
AL
79 -e 's:@YPDOMAIN_DIR@::g' \
80 -e 's:@YPDOMAIN_SUFFIX@::g'
81
82MAN= dhcpcd.conf.5 dhcpcd.8
83.for f in dhcpcd.conf.5 dhcpcd.8
84CLEANFILES+= ${f}
85${f}: ${f}.in
86 sed ${_SED_CMDS} ${SRCDIR}/${f}.in > $@
87.endfor
88
89# NOTE:
90# The configuration file 'dhcpcd.conf' is installed by 'etc/Makefile'
91
92#
93# Hooks
94#
95
96HOOKSRC= ${DISTDIR}/hooks
97.PATH: ${HOOKSRC}
98
99SCRIPTS= dhcpcd-run-hooks
100SCRIPTSDIR= ${_LIBEXECDIR}
101MAN+= dhcpcd-run-hooks.8
102
c891d45b 103FILES= 01-test 20-resolv.conf 30-hostname
5d669bfa
AL
104FILESDIR= ${_HOOKDIR}
105
106# Example hooks that should not be installed by default
107.for f in 10-wpa_supplicant 15-timezone 29-lookup-hostname 50-ypbind
108FILES+= ${f}
109FILESDIR_${f}= ${_DATADIR}/dhcpcd/hooks
110.endfor
111
c891d45b 112.for f in dhcpcd-run-hooks dhcpcd-run-hooks.8 30-hostname 50-ypbind
5d669bfa
AL
113CLEANFILES+= ${f}
114${f}: ${f}.in
115 sed ${_SED_CMDS} ${HOOKSRC}/${f}.in > $@
116.endfor
117
118.include <bsd.prog.mk>