aboutsummaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-09-19 01:31:26 +0200
committerGilles Chehade <gilles@poolp.org>2019-09-19 01:31:26 +0200
commitc74fe1d280a812a17c92107a532d6ea44ffc2b4b (patch)
treed98191a6db0918faa49ebb4057edcb0505ce5a81 /mk
parentMerge branch 'portable' of ssh://github.com/OpenSMTPD/OpenSMTPD into portable (diff)
downloadOpenSMTPD-c74fe1d280a812a17c92107a532d6ea44ffc2b4b.tar.xz
OpenSMTPD-c74fe1d280a812a17c92107a532d6ea44ffc2b4b.zip
add missing file
Diffstat (limited to 'mk')
-rw-r--r--mk/smtp/Makefile.am59
1 files changed, 59 insertions, 0 deletions
diff --git a/mk/smtp/Makefile.am b/mk/smtp/Makefile.am
new file mode 100644
index 00000000..0c6702da
--- /dev/null
+++ b/mk/smtp/Makefile.am
@@ -0,0 +1,59 @@
+include $(top_srcdir)/mk/pathnames
+
+bin_PROGRAMS= smtp
+
+smtp_SOURCES= $(smtpd_srcdir)/iobuf.c
+smtp_SOURCES+= $(smtpd_srcdir)/ioev.c
+smtp_SOURCES+= $(smtpd_srcdir)/log.c
+smtp_SOURCES+= $(smtpd_srcdir)/smtp_client.c
+smtp_SOURCES+= $(smtpd_srcdir)/smtpc.c
+smtp_SOURCES+= $(smtpd_srcdir)/ssl.c
+smtp_SOURCES+= $(smtpd_srcdir)/ssl_verify.c
+
+smtp_CFLAGS= -DIO_TLS
+
+AM_CPPFLAGS= -I$(top_srcdir)/smtpd \
+ -I$(top_srcdir)/openbsd-compat
+if !SUPPORT_ERR_H
+AM_CPPFLAGS += -I$(top_srcdir)/openbsd-compat/err_h
+endif
+
+LIBCOMPAT= $(top_builddir)/openbsd-compat/libopenbsd-compat.a
+
+LDADD= $(LIBCOMPAT)
+
+# need to define _GNU_SOURCE to get:
+# EAI_NODATA defined
+# {v,}asprintf
+# setres{g,u}id
+CFLAGS+= -D_GNU_SOURCE
+CPPFLAGS= -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
+
+MANPAGES= smtp.1.out
+MANPAGES_IN= $(smtpd_srcdir)/smtp.1
+
+EXTRA_DIST= $(MANPAGES_IN)
+
+PATHSUBS= -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \
+ -e 's|/usr/libexec|$(libexecdir)|g' \
+ -e 's|/etc/mail/|$(sysconfdir)/|g'
+
+FIXPATHSCMD= $(SED) $(PATHSUBS)
+
+
+$(MANPAGES): $(MANPAGES_IN)
+ manpage=$(smtpd_srcdir)/`echo $@ | sed 's/\.out$$//'`; \
+ if test "$(MANTYPE)" = "man"; then \
+ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \
+ else \
+ $(FIXPATHSCMD) $${manpage} > $@; \
+ fi
+
+install-exec-hook: $(CONFIGFILES) $(MANPAGES)
+ $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)1
+ $(INSTALL) -m 644 smtp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1
+ rm smtp.1.out
+
+uninstall-hook:
+ rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1
+ rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 2> /dev/null || /bin/true