xref: /original-bsd/usr.bin/mail/Makefile.11 (revision a9c19d04)
1#
2# Copyright (c) 1980 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)Makefile.11	5.1 (Berkeley) 06/06/85
7#
8# Unix version 7.
9#
10# If you are compiling this for a nonseparate I/D machine,
11# you must:
12#	change the definitions of LDFLAGS, CFLAGS, LIBES,
13#	SIGRETROSRC, and SIGRETROOBJ
14#	make Mail40 rather than Mail
15#
16# Mail is too large to fit on a nonseparate I/D machine without
17# text overlays.
18#
19# If you do not have a vfork system call or do not support
20# job control, you must change the definition of OPTIONS.
21#
22
23OPTIONS=	-DV7 -DVMUNIX			# vfork and job control
24#OPTIONS=	-DV7				# no vfork or no job control
25
26LDFLAGS=	-i				# for separate I/D machines
27#LDFLAGS=	-n				# for nonseparate I/D machines
28
29CFLAGS=		-O ${OPTIONS} ${INCLUDES}	# for separate I/D machines
30#CFLAGS=	-O -V ${OPTIONS} ${INCLUDES}	# for nonseparate I/D machines
31
32LIBES=		-ljobs -lc			# for separate I/D machines
33#LIBES=		-lovjobs -lovc			# for nonseparate I/D machines
34
35SIGRETROSRC=					# for those with job control
36SIGRETROOBJ=					# for those with job control
37#SIGRETROSRC=	sigretro.c			# for those without job control
38#SIGRETROOBJ=	sigretro.o			# for those without job control
39
40XSTR=		/usr/ucb/xstr
41DESTDIR=	/
42CTAGS=		/usr/ucb/ctags -w
43ED=		-ed
44AS=		-as
45RM=		-rm
46OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o config.o edit.o fio.o \
47	getname.o head.o v7.local.o lock.o lex.o list.o main.o \
48	names.o optim.o popen.o quit.o send.o strings.o temp.o tty.o \
49	vars.o version.o errlst.o str.o ${SIGRETROOBJ}
50
51SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c config.c edit.c fio.c \
52	getname.c head.c v7.local.c lock.c lex.c list.c main.c \
53	names.c optim.c popen.c quit.c send.c strings.c temp.c tty.c vars.c \
54	errlst.c version.c ${SIGRETROSRC}
55
56HDRS=rcv.h configdefs.h def.h glob.h v7.local.h local.h
57
58S = $(SRCS) $(HDRS)
59
60#
61# Special massaging of C files for sharing of strings
62#
63.c.o:
64	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
65	${CC} -c ${CFLAGS} x.c
66	mv x.o $*.o
67	@$(RM) -f x.c
68
69Mail:	$S $(OBJS)
70	$(RM) -f Mail
71	@echo Loading ...
72	@${CC} ${LDFLAGS} -o Mail ${OBJS} ${LIBES}
73	@size Mail
74
75Mail40:	$S $(OBJS)
76	$(RM) -f Mail
77	@echo Loading ...
78	@ld -X /lib/crt0.o ${LDFLAGS} -o Mail \
79	-Z	getname.o names.o optim.o popen.o send.o strings.o temp.o \
80		v7.local.o vars.o \
81	-Z	edit.o head.o lex.o list.o lock.o main.o quit.o tty.o \
82	-Z	cmd1.o cmd2.o cmd3.o collect.o ${SIGRETROOBJ} \
83	-L	aux.o cmdtab.o config.o errlst.o fio.o \
84		str.o version.o ${LIBES}
85	@size Mail
86
87install:
88	install -s Mail ${DESTDIR}/usr/ucb
89	cp misc/Mail.help* ${DESTDIR}/usr/lib
90	cd ${DESTDIR}/usr/ucb; rm -f mail; ln Mail mail
91
92$S:
93	sccs get $@;
94
95srcs:	$S
96
97tags:	$(SRCS)
98	${CTAGS} $(SRCS);
99
100clean:
101	$(RM) -f *.o
102	rm -f Mail a.out fmt x.c xs.c core
103	cp /dev/null strings
104
105lint:
106	lint $(CFLAGS) $(SRCS)
107
108fmt:	fmt.c head.c
109	$(CC) fmt.c head.c -O -o fmt
110	$(RM) fmt.o head.o
111	size fmt
112
113str.o: strings
114	$(XSTR)
115	$(CC) -c $(CFLAGS) xs.c
116	mv xs.o str.o
117	$(RM) xs.c
118
119config.o:	config.c
120	$(CC) -c $(CFLAGS) config.c
121
122cmdtab.o: cmdtab.c
123	$(CC) -c $(CFLAGS) cmdtab.c
124
125errlst.o: errlst.c
126	${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c -
127	${CC} ${CFLAGS} -c x.c
128	mv x.o errlst.o
129
130wc:
131	@wc rcv.h def.h glob.h local.h v7.local.h $(SRCS)
132
133sc:
134	@grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS)
135