aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mailstats/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mailstats/Makefile')
-rw-r--r--usr.sbin/mailstats/Makefile21
1 files changed, 18 insertions, 3 deletions
diff --git a/usr.sbin/mailstats/Makefile b/usr.sbin/mailstats/Makefile
index 3cef65b23a86..301691d8895d 100644
--- a/usr.sbin/mailstats/Makefile
+++ b/usr.sbin/mailstats/Makefile
@@ -7,9 +7,18 @@ SENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail
.PATH: ${SENDMAIL_DIR}/mailstats
PROG= mailstats
+SRCS= mailstats.c
MAN= mailstats.8
-CFLAGS+= -I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -DNOT_SENDMAIL
+CFLAGS+= -I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I.
+CFLAGS+= -DNOT_SENDMAIL
+
+.if exists(${.OBJDIR}/../../lib/libsm)
+LIBSMDIR:= ${.OBJDIR}/../../lib/libsm
+.else
+LIBSMDIR!= cd ${.CURDIR}/../../lib/libsm; make -V .OBJDIR
+.endif
+LIBSM:= ${LIBSMDIR}/libsm.a
.if exists(${.OBJDIR}/../../lib/libsmutil)
LIBSMUTILDIR:= ${.OBJDIR}/../../lib/libsmutil
@@ -18,8 +27,11 @@ LIBSMUTILDIR!= cd ${.CURDIR}/../../lib/libsmutil; make -V .OBJDIR
.endif
LIBSMUTIL:= ${LIBSMUTILDIR}/libsmutil.a
-DPADD= ${LIBSMUTIL}
-LDADD= ${LIBSMUTIL}
+DPADD= ${LIBSMUTIL} ${LIBSM}
+LDADD= ${LIBSMUTIL} ${LIBSM}
+
+SRCS+= sm_os.h
+CLEANFILES+=sm_os.h
# User customizations to the sendmail build environment
CFLAGS+= ${SENDMAIL_CFLAGS}
@@ -27,4 +39,7 @@ DPADD+= ${SENDMAIL_DPADD}
LDADD+= ${SENDMAIL_LDADD}
LDFLAGS+= ${SENDMAIL_LDFLAGS}
+sm_os.h:
+ ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+
.include <bsd.prog.mk>