1#	$NetBSD: Makefile,v 1.9 2011/08/17 09:03:47 christos Exp $
2
3.include "${.CURDIR}/../Makefile.inc"
4
5PROG=	amd
6
7DIST=	${IDIST}/amd
8.PATH:	${DIST}
9
10SRCS=	am_ops.c amd.c amfs_auto.c amfs_generic.c amfs_direct.c \
11	amfs_error.c amfs_host.c \
12	amfs_link.c amfs_linkx.c amfs_nfsl.c amfs_nfsx.c \
13	amfs_program.c amfs_root.c amfs_toplvl.c amfs_union.c amq_subr.c \
14	amq_svc.c autil.c clock.c conf.c get_args.c info_exec.c info_file.c \
15	info_ndbm.c info_passwd.c info_sun.c \
16	info_union.c map.c mapc.c mntfs.c nfs_prot_svc.c nfs_start.c \
17	nfs_subr.c ops_cdfs.c ops_efs.c \
18	ops_mfs.c ops_nfs.c ops_nfs3.c ops_nullfs.c ops_pcfs.c \
19	ops_tfs.c ops_tmpfs.c ops_udf.c ops_ufs.c ops_umapfs.c ops_unionfs.c \
20	opts.c readdir.c restart.c rpc_fwd.c sched.c srvr_amfs_auto.c \
21	srvr_nfs.c sun_map.c sun_map_parse.y sun_map_tok.l \
22	conf_parse.y conf_tok.l
23
24.if (${USE_HESIOD} != "no")
25SRCS+=	info_hesiod.c
26.endif
27
28.if (${USE_LDAP} != "no")
29SRCS+=	info_ldap.c
30
31LDADD+=	-lldap
32DPADD+=	${LIBLDAP}
33.if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != ""))
34LDADD+=	-llber
35DPADD+=	${LIBLBER}
36.if ${MKCRYPTO} != "no" 
37DPADD+=	${LIBSSL} ${LIBCRYPTO}
38LDADD+=	-lssl -lcrypto
39.endif
40.endif
41.endif
42
43.if (${USE_YP} != "no")
44SRCS+=	info_nis.c
45.endif
46
47# the following are not supported on NetBSD
48#	info_ldap.c info_nisplus.c ops_cachefs.c ops_efs.c ops_lofs.c ops_xfs.c
49MAN+=	amd.8
50
51AMDOBJDIR!=cd ${.CURDIR} && ${PRINTOBJDIR}
52
53CPPFLAGS+=	-I${DIST} -I${AMDOBJDIR}
54LDADD+=		${LIBAMU} -lrpcsvc
55DPADD+=		${LIBRPCSVC}
56YHEADER=	1
57
58YPREFIX.sun_map_parse.y =	sun_map_
59LPREFIX.sun_map_tok.l =	sun_map_
60CPPFLAGS.sun_map_tok.c += -Dyylval=sun_map_lval -Dyyerror=sun_map_error
61
62CWARNFLAGS.clang+=	-Wno-unneeded-internal-declaration
63
64YPREFIX.conf_parse.y =	conf_
65LPREFIX.conf_tok.l =	conf_
66CPPFLAGS.conf_tok.c += -Dyylval=conf_lval -Dyyerror=conf_error
67
68CLEANFILES+=	build_version.h
69DPSRCS+=	build_version.h
70
71get_args.o get_args.d: build_version.h
72
73build_version.h: get_args.c
74	${_MKTARGET_CREATE}
75	echo '#define AMU_BUILD_VERSION	1' > ${.TARGET}
76	echo '#define BUILD_USER "'unknown'"' >> ${.TARGET}
77	echo '#define BUILD_HOST "'unknown'"' >> ${.TARGET}
78	echo '#define BUILD_DATE "'unknown'"' >> ${.TARGET}
79
80
81.include <bsd.prog.mk>
82