dhcpcd: Adjust Makefile for dhcpcd-8.0.4
[dragonfly.git] / sbin / dhcpcd / Makefile
1 # Derived from NetBSD's Makefile for dhcpcd
2
3 DISTDIR=        ${.CURDIR}/../../contrib/dhcpcd
4
5 PROG=           dhcpcd
6
7 SRCDIR=         ${DISTDIR}/src
8 .PATH:          ${SRCDIR}
9 CFLAGS+=        -DHAVE_CONFIG_H -I${.CURDIR} -I${SRCDIR} -I${DISTDIR}
10 SRCS=           common.c control.c dhcpcd.c duid.c eloop.c logerr.c
11 SRCS+=          if.c if-options.c route.c sa.c script.c
12 SRCS+=          dhcp-common.c dhcpcd-embedded.c
13 SRCS+=          if-bsd.c
14
15 CFLAGS+=        -DAUTH
16 SRCS+=          auth.c
17
18 CFLAGS+=        -DINET
19 SRCS+=          bpf.c dhcp.c ipv4.c
20 CFLAGS+=        -DARP -DARPING
21 SRCS+=          arp.c
22 CFLAGS+=        -DIPV4LL
23 SRCS+=          ipv4ll.c
24
25 CFLAGS+=        -DINET6
26 SRCS+=          ipv6.c ipv6nd.c
27 CFLAGS+=        -DDHCP6
28 SRCS+=          dhcp6.c
29
30 .PATH:          ${DISTDIR}/compat
31 SRCS+=          pidfile.c rb.c strtoi.c strtou.c
32 .PATH:          ${DISTDIR}/compat/crypt
33 SRCS+=          hmac.c
34
35 # Fully convert to openssl/md5.h and openssl/sha2.h
36 CFLAGS+=        -DUSE_PRIVATECRYPTO
37 FLAGS_GROUPS=   openssl
38 openssl_FLAGS=  -I${_SHLIBDIRPREFIX}/usr/include/priv/openssl
39 openssl_FLAGS+= -DMD5Init=MD5_Init -DMD5Update=MD5_Update -DMD5Final=MD5_Final
40 openssl_FLAGS_FILES= hmac.c ipv6.c
41
42 CFLAGS+=        ${PRIVATELIB_CFLAGS}
43 DPADD=          ${LIBCRYPTO}
44 LDADD=          -lprivate_crypto
45 LDFLAGS+=       ${PRIVATELIB_LDFLAGS}
46
47 # system directories
48 _SYSCONFDIR=    /etc
49 _LIBDIR=        /usr/lib
50 _LIBEXECDIR=    /usr/libexec
51 _DBDIR=         /var/db/dhcpcd
52 _RUNDIR=        /var/run
53 CFLAGS+=        -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
76 MAN=            dhcpcd.conf.5 dhcpcd.8
77 .for f in dhcpcd.conf.5 dhcpcd.8
78 CLEANFILES+=    ${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
90 HOOKSRC=        ${DISTDIR}/hooks
91 .PATH:          ${HOOKSRC}
92
93 SCRIPTS=        dhcpcd-run-hooks
94 SCRIPTSDIR=     ${_LIBEXECDIR}
95 MAN+=           dhcpcd-run-hooks.8
96
97 FILES=          01-test 02-dump 20-resolv.conf 30-hostname
98 FILESDIR=       ${_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
102 FILES+=         ${f}
103 FILESDIR_${f}=  ${_DATADIR}/dhcpcd/hooks
104 .endfor
105
106 .for f in dhcpcd-run-hooks dhcpcd-run-hooks.8 50-ypbind
107 CLEANFILES+=    ${f}
108 ${f}: ${f}.in
109         sed ${_SED_CMDS} ${HOOKSRC}/${f}.in > $@
110 .endfor
111
112 .include <bsd.prog.mk>