xref: /original-bsd/usr.bin/mail/Makefile (revision 552e81d8)
1#
2# Unix version 7.
3#
4# Sccs Id = "@(#)Makefile	1.2 10/08/80";
5#
6
7CFLAGS=-O -DVMUNIX -DV7
8XSTR=/usr/ucb/xstr
9DESTDIR=/usr/src
10CTAGS=/usr/ucb/ctags -w
11VPRINT=/usr/ucb/vprint
12LIBES=-ljobs
13ED=-ed
14AS=-as
15RM=-rm
16OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \
17	getname.o head.o v7.local.o lock.o optim.o names.o lex.o list.o main.o \
18	quit.o send.o strings.o temp.o tty.o vars.o version.o \
19	errlst.o str.o
20
21SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \
22	getname.c head.c v7.local.c lock.c optim.c names.c lex.c list.c main.c \
23	quit.c send.c strings.c temp.c tty.c vars.c \
24	errlst.c str.c
25
26HDRS=rcv.h def.h glob.h v7.local.h local.h
27
28S = $(SRCS) $(HDRS)
29
30#
31# Special massaging of C files for sharing of strings
32#
33.c.o:
34	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
35	${CC} -c ${CFLAGS} x.c
36	mv x.o $*.o
37
38Mail:	$S $(OBJS) tags
39	$(CC) -n -o Mail $(OBJS) $(LIBES)
40	@size Mail
41
42install:
43	install -s Mail ${DESTDIR}/usr/ucb
44	cp Mail.help* ${DESTDIR}/usr/lib
45	cd ${DESTDIR}/usr/ucb; rm -f mail; ln Mail mail
46
47$S:
48	sccs get $@
49
50tags:
51	${CTAGS} *.c;
52
53clean:
54	$(RM) -f *.o
55	rm -f Mail a.out fmt x.c xs.c tags core
56	cp /dev/null strings
57	cp /dev/null version.c
58
59lint:
60	lint $(CFLAGS) $(SRCS)
61
62fmt:	fmt.c head.c
63	$(CC) fmt.c head.c -o fmt
64	$(RM) fmt.o head.o
65	size fmt
66
67str.o: strings
68	$(XSTR)
69	$(CC) -S xs.c
70	$(ED) - <:rofix xs.s
71	$(AS) -o str.o xs.s
72	$(RM) xs.s
73	$(RM) xs.c
74
75cmdtab.o: cmdtab.c
76	$(CC) -S $(CFLAGS) cmdtab.c
77	$(ED) - <:rofix cmdtab.s
78	$(AS) -o cmdtab.o cmdtab.s
79	$(RM) cmdtab.s
80
81errlst.o: errlst.c
82	${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c -
83	${CC} ${CFLAGS} -S x.c
84	${ED} - <:rofix x.s
85	${AS} -o errlst.o x.s
86	${RM} x.s
87	${RM} x.c
88
89#
90# Make the version file.  /tmp is always changing.
91#
92version.c: #	/tmp
93	/bin/sh version > version.c
94
95print:
96	@$(VPRINT) makefile rcv.h def.h glob.h local.h v7.local.h $(SRCS) fmt.c;
97
98wc:
99	@wc rcv.h def.h glob.h local.h v7.local.h $(SRCS)
100
101sc:
102	@grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS)
103