xref: /original-bsd/usr.bin/mail/Makefile (revision 6c57d260)
1#
2# Unix version 7.
3#
4# Sccs Id = "@(#)Makefile	1.6 04/01/81";
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 npopen.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 errlst.c
24
25HDRS=rcv.h def.h glob.h v7.local.h local.h
26
27S = $(SRCS) $(HDRS)
28
29#
30# Special massaging of C files for sharing of strings
31#
32.c.o:
33	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
34	${CC} -c ${CFLAGS} x.c
35	mv x.o $*.o
36	@$(RM) -f x.c
37
38Mail:	$S $(OBJS) tags
39	$(RM) -f Mail
40	$(CC) -n -o Mail $(OBJS) $(LIBES)
41	@size Mail
42
43mail.g:	$(SRCS)
44	/va/rigel/bin/cgraf $(SRCS) > mail.g
45
46install:
47	install -s Mail ${DESTDIR}/usr/ucb
48	cp Mail.help* ${DESTDIR}/usr/lib
49	cd ${DESTDIR}/usr/ucb; rm -f mail; ln Mail mail
50
51$S:
52	sccs get $@
53
54srcs:	$S
55
56tags:
57	${CTAGS} *.c;
58
59clean:
60	$(RM) -f *.o
61	rm -f Mail a.out fmt x.c xs.c tags core
62	cp /dev/null strings
63	cp /dev/null version.c
64
65lint:
66	lint $(CFLAGS) $(SRCS)
67
68fmt:	fmt.c head.c
69	$(CC) fmt.c head.c -o fmt
70	$(RM) fmt.o head.o
71	size fmt
72
73str.o: strings
74	$(XSTR)
75	$(CC) -R -c xs.c
76	mv xs.o str.o
77	$(RM) xs.c
78
79cmdtab.o: cmdtab.c
80	$(CC) -R -c $(CFLAGS) cmdtab.c
81
82errlst.o: errlst.c
83	${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c -
84	${CC} ${CFLAGS} -R x.c
85	mv x.o errlst.o
86
87#
88# Make the version file.  /tmp is always changing.
89#
90version.c: #	/tmp
91	/bin/sh version > version.c
92
93print:
94	@$(VPRINT) makefile rcv.h def.h glob.h local.h v7.local.h $(SRCS) fmt.c;
95
96wc:
97	@wc rcv.h def.h glob.h local.h v7.local.h $(SRCS)
98
99sc:
100	@grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS)
101