11.45Smartin#	$NetBSD: Makefile,v 1.45 2024/11/11 11:44:51 martin Exp $
21.10Stls#	@(#)Makefile	8.3 (Berkeley) 4/20/95
31.1Scgd
41.15Slukem.include <bsd.own.mk>
51.25Schristos
61.45Smartin.include "${NETBSDSRCDIR}/external/bsd/zstd/Makefile.zstd"
71.45Smartin
81.30StlsUSE_FORT?= yes	# data-driven bugs?
91.30Stls
101.31SchristosUSE_EDITLINE?=yes
111.31SchristosMIME_SUPPORT?=yes	# currently requires USE_EDITLINE
121.31SchristosCHARSET_SUPPORT?=yes	# requires MIME_SUPPORT
131.31SchristosTHREAD_SUPPORT?=yes	# EXPERIMENTAL
141.31Schristos
151.31Schristos# Work around some problems in -current.
161.31Schristos# See the source code for more info.
171.31Schristos#
181.31SchristosCPPFLAGS+=	-DBROKEN_EXEC_TTY_RESTORE	# broken since 4.99.10
191.31SchristosCPPFLAGS+=	-DBROKEN_CLONE_STAT		# see PRs 37878 and 37550
201.32SchristosCPPFLAGS+=	-DBROKEN_MAGIC			# bad MIME type on short files
211.31Schristos
221.31Schristos# Debugging options (most should go away - please leave for now).
231.31Schristos#
241.31Schristos#CPPFLAGS+=	-DDEBUG_FILE_LEAK
251.15Slukem
261.1ScgdPROG=	mail
271.28SchristosSRCS=	version.c support.c cmd1.c cmd2.c cmd3.c cmd4.c cmdtab.c collect.c \
281.28Schristos	dotlock.c edit.c fio.c format.c getname.c head.c v7.local.c lex.c \
291.31Schristos	list.c main.c names.c popen.c quit.c send.c sig.c strings.c temp.c \
301.31Schristos	tty.c vars.c
311.37SchristosLINKS=	${BINDIR}/mail ${BINDIR}/mailx
321.37SchristosMLINKS=	mail.1 mailx.1
331.20Swiz
341.25SchristosLDADD+=		-lutil
351.25SchristosDPADD+=		${LIBUTIL}
361.25Schristos
371.26Schristos.if ${USE_EDITLINE:Uno} == "yes"
381.23SchristosSRCS+=	complete.c
391.23Schristos
401.25SchristosCPPFLAGS+=	-DUSE_EDITLINE
411.34SroyLDADD+=		-ledit -lterminfo
421.34SroyDPADD+=		${LIBEDIT} ${LIBTERMINFO}
431.23Schristos
441.26Schristos.if ${MIME_SUPPORT:Uno} == "yes"
451.25SchristosSRCS+=	mime_attach.c
461.25SchristosSRCS+=	mime_child.c
471.25SchristosSRCS+=	mime_codecs.c
481.25SchristosSRCS+=	mime_decode.c
491.28SchristosSRCS+=	mime_detach.c
501.25SchristosSRCS+=	mime_header.c
511.25Schristos
521.25SchristosCPPFLAGS+=	-DMIME_SUPPORT
531.26Schristos.if ${CHARSET_SUPPORT:Uno} == "yes"
541.25SchristosCPPFLAGS+=	-DCHARSET_SUPPORT
551.25Schristos.endif
561.25Schristos
571.40SchristosLDADD+=		-lmagic -llzma -lbz2 -lz
581.40SchristosDPADD+=		${LIBMAGIC} ${LIBLZMA} ${LIBBZ2} ${LIBZ}
591.45SmartinPROGDPLIBS+=	${ZSTDDPLIBS}
601.25Schristos.endif
611.23Schristos.endif
621.23Schristos
631.28Schristos.if ${THREAD_SUPPORT:Uno} == "yes"
641.28SchristosSRCS+=	thread.c
651.28SchristosCPPFLAGS+=	-DTHREAD_SUPPORT
661.28Schristos.endif
671.28Schristos
681.25SchristosCWARNFLAGS+=	-Wextra
691.3Sjtc
701.21Slukem.PATH: ${.CURDIR}/misc
711.21Slukem
721.15Slukem.if ${MKSHARE} != "no"
731.21SlukemFILESDIR=		/usr/share/misc
741.21SlukemFILES=			mail.help mail.tildehelp
751.36Sdholland.endif
761.5Smycroft
771.38SchristosSUBDIR.roff+= USD.doc
781.11Sperry
791.21SlukemCONFIGFILES=		mail.rc
801.21SlukemFILESDIR_mail.rc=	/etc
811.41SriastradFILESMODE_mail.rc=	644
821.1Scgd
831.39SmrgCOPTS.format.c+= -Wno-format-nonliteral
841.44SrinCOPTS.fio.c+=	${CC_WNO_FORMAT_TRUNCATION}
851.35Schristos
861.1Scgd.include <bsd.prog.mk>
871.13Smycroft.include <bsd.subdir.mk>
88