xref: /plan9/sys/src/cmd/upas/misc/unix/makefile (revision a8482e058adfb9039bb8aaa40ea4270fc64ff0a4)
1LIB=/usr/lib/upas
2CFLAGS=${UNIX} -g -I. -I../libc -I../common -I/usr/include -I/usr/include/sys
3LFLAGS=-g
4HOSTNAME=cat /etc/whoami
5
6.c.o: ; $(CC) -c $(CFLAGS) $*.c
7all: mail
8
9sedfile:
10	echo 's+LIBDIR+$(LIB)+g' >sed.file
11	echo 's+HOSTNAME+$(HOSTNAME)+g' >>sed.file
12
13install: sedfile install.fish install.mail.sh
14
15install.fish:
16	cp gone.msg $(LIB)
17	sed -f sed.file gone.fishing >$(LIB)/gone.fishing
18	-chmod 775 $(LIB)/gone.fishing
19	-chown bin $(LIB)/gone.fishing $(LIB)/gone.msg
20
21install.mail.sh:
22	sed -f sed.file mail.sh >/bin/mail
23	-chown bin /bin/mail
24	-chmod 775 /bin/mail
25
26install.notify: notify
27	cp notify $(LIB)/notify
28	-chmod 775 $(LIB)/notify
29	-chown bin $(LIB)/notify
30
31install.mail: mail
32	cp mail /bin
33	strip /bin/mail
34
35notify: notify.o
36	cc $(LFLAGS) notify.o -o notify
37
38mail: mail.o ../config/config.o
39	cc $(LFLAGS) mail.o ../config/config.o -o mail
40
41clean:
42	-rm -f *.[oOa] core a.out *.sL notify
43	-rm -f sed.file mail
44
45