Package: bsd-mailx / 8.1.2-0.20141216cvs-2

00-Makefiles.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From: Loic Prylli <Loic.Prylli@graville.fdn.fr>
Date: Mon, 29 Jun 1998 20:15:00 -0400
Subject: 00 Makefiles.

Fix makefiles to make it possible to compile mailx on non-BSD systems.
---
 Makefile         | 33 ++++++++++++++++++++++++++++++---
 USD.doc/Makefile | 14 +++++++++-----
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 9d08f89..10fb240 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,22 @@
 #	$OpenBSD: Makefile,v 1.10 2014/07/22 17:05:45 deraadt Exp $
 
 PROG=	mail
+CC ?=	gcc
+
+CFLAGS += -D_BSD_SOURCE -DDEBIAN -g -Wall
+
 SRCS=	version.c aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c \
 	edit.c fio.c getname.c head.c v7.local.c lex.c list.c main.c names.c \
 	popen.c quit.c send.c strings.c temp.c tty.c vars.c
+
+OBJS=$(SRCS:%.c=%.o)
+LIBS=-llockfile -lbsd
+
 SFILES=	mail.help mail.tildehelp
 EFILES=	mail.rc
-LINKS=	${BINDIR}/mail ${BINDIR}/Mail ${BINDIR}/mail ${BINDIR}/mailx
-MLINKS=	mail.1 Mail.1 mail.1 mailx.1
+MFILES=	mail.1
+
+all: $(PROG)
 
 distribution:
 	cd ${.CURDIR}/misc; ${INSTALL} ${INSTALL_COPY} -o root -g wheel \
@@ -15,4 +24,22 @@ distribution:
 	cd ${.CURDIR}/misc; ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \
 	    -m 444 ${SFILES} ${DESTDIR}/usr/share/misc
 
-.include <bsd.prog.mk>
+
+$(PROG): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+
+.c.o:
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+.y.c:
+	bison $<
+	mv -f $*.tab.c $@
+
+clean:
+	rm -f $(PROG) $(OBJS) *~ core
+
+install:
+	install -p -c -m 755 $(PROG) $(DESTDIR)/usr/bin/bsd-mailx
+	install -p -c -m 644 $(MFILES) $(DESTDIR)/usr/share/man/man1/bsd-mailx.1
+	cd misc && install -p -c -m 644 $(EFILES) $(DESTDIR)/etc/
+	cd misc && install -p -c -m 644 $(SFILES) $(DESTDIR)/usr/share/bsd-mailx/
diff --git a/USD.doc/Makefile b/USD.doc/Makefile
index fc82a17..a59ecb0 100644
--- a/USD.doc/Makefile
+++ b/USD.doc/Makefile
@@ -5,11 +5,15 @@ DIR=	usd/07.mail
 SRCS=	mail0.nr mail1.nr mail2.nr mail3.nr mail4.nr mail5.nr mail6.nr \
 	mail7.nr mail8.nr mail9.nr maila.nr
 MACROS=	-me
+TBL=tbl
 
-paper.ps: ${SRCS}
-	${TBL} ${SRCS} | ${ROFF} > ${.TARGET}
+all: manual.ps manual.txt
 
-paper.txt: ${SRCS}
-	${TBL} ${SRCS} | ${ROFF} -Tascii > ${.TARGET}
+manual.ps: ${SRCS}
+	${TBL} ${SRCS} | groff ${MACROS} -Tps > $@
 
-.include <bsd.doc.mk>
+manual.txt: ${SRCS}
+	${TBL} ${SRCS} | groff ${MACROS} -Tascii  > $@
+
+clean :
+	-rm -f manual.ps manual.txt