install depends on ksu
[unix-history] / usr / src / usr.bin / mail / Makefile
index 0bc9e7c..8e9106d 100644 (file)
 #
 #
-# Unix version 7.
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.
 #
 #
-# Sccs Id = "@(#)Makefile      2.7 %G%";
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley.  The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
 #
-
-CFLAGS=-O -DVMUNIX -DV7
-XSTR=/usr/ucb/xstr
-DESTDIR=/usr/src
-CTAGS=/usr/ucb/ctags -w
-VPRINT=/usr/ucb/print
-CGRAF=/ja/rigel/rigel/bin/cgraf
-CGRAPH=/ja/rigel/rigel/bin/cgraph
-NMKINDEX=/ja/rigel/rigel/bin/nmkindex
-DIRTCLOD=/ja/rigel/rigel/bin/dirtclod
-LIBES=-ljobs
-ED=-ed
-AS=-as
-RM=-rm
-OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o config.o edit.o fio.o \
-       getname.o head.o v7.local.o lock.o lex.o list.o main.o \
-       names.o optim.o popen.o quit.o send.o strings.o temp.o tty.o \
-       vars.o version.o errlst.o str.o
-
-SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c config.c edit.c fio.c \
-       getname.c head.c v7.local.c lock.c lex.c list.c main.c \
-       names.c optim.c popen.c quit.c send.c strings.c temp.c tty.c vars.c \
-       errlst.c version.c
-
-HDRS=rcv.h configdefs.h def.h glob.h v7.local.h local.h
-
-S = $(SRCS) $(HDRS)
-
+#      @(#)Makefile    5.11 (Berkeley) %G%
 #
 #
-# Special massaging of C files for sharing of strings
-#
-.c.o:
-       ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
-       ${CC} -c ${CFLAGS} x.c 
-       mv x.o $*.o
-       @$(RM) -f x.c
-
-Mail:  $S $(OBJS)
-       $(RM) -f Mail
-       @echo Loading ...
-       @$(CC) -n -o Mail $(OBJS) $(LIBES)
-       @size Mail
-
-mail.g:        $(SRCS)
-       $(CGRAF) $(SRCS) > mail.g
-
-install:
-       install -s Mail ${DESTDIR}/usr/ucb
-       cp Mail.help* ${DESTDIR}/usr/lib
-       cd ${DESTDIR}/usr/ucb; rm -f mail; ln Mail mail
-
-$S:
-       sccs get $@;
-
-srcs:  $S
-
-tags:  $(SRCS)
-       ${CTAGS} $(SRCS);
+CFLAGS=        -O -R
+LIBC=  /lib/libc.a
+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=  version.o aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \
+       getname.o head.o v7.local.o lex.o list.o main.o names.o popen.o \
+       quit.o send.o strings.o temp.o tty.o vars.o flsbuf.o
+FSRCS= fmt.c head.c
+FOBJS= fmt.o head.o
+MAN=   mail.0 fmt.0
+
+all: mail fmt
+
+mail: ${OBJS} ${LIBC}
+       ${CC} -o $@ ${OBJS}
+
+fmt: ${FOBJS} ${LIBC}
+       ${CC} -o $@ ${FOBJS}
 
 clean:
 
 clean:
-       $(RM) -f *.o
-       rm -f Mail a.out fmt x.c xs.c tags core
-       cp /dev/null strings
-
-lint:
-       lint $(CFLAGS) $(SRCS)
-
-fmt:   fmt.c head.c
-       $(CC) fmt.c head.c -o fmt
-       $(RM) fmt.o head.o
-       size fmt
+       rm -f ${FOBJS} ${OBJS} mail a.out fmt core
 
 
-str.o: strings
-       $(XSTR)
-       $(CC) -R -c xs.c
-       mv xs.o str.o
-       $(RM) xs.c
+cleandir: clean
+       rm -f ${MAN} tags .depend
 
 
-config.o:      config.c
-       $(CC) -R -c config.c
+depend:
+       mkdep fmt.c ${SRCS}
 
 
-cmdtab.o: cmdtab.c
-       $(CC) -R -c $(CFLAGS) cmdtab.c
+install: ${MAN}
+       install -s -o bin -g bin -m 755 mail ${DESTDIR}/usr/ucb/mail
+       install -s -o bin -g bin -m 755 fmt ${DESTDIR}/usr/ucb/fmt
+       install -c -o bin -g bin -m 444 misc/Mail.* ${DESTDIR}/usr/lib
+       rm -f ${DESTDIR}/usr/ucb/Mail
+       ln ${DESTDIR}/usr/ucb/mail ${DESTDIR}/usr/ucb/Mail
+       install -c -o bin -g bin -m 444 mail.0 ${DESTDIR}/usr/man/cat1/mail.0
+       install -c -o bin -g bin -m 444 fmt.0 ${DESTDIR}/usr/man/cat1/fmt.0
+       rm -f ${DESTDIR}/usr/man/cat1/Mail.0
+       ln ${DESTDIR}/usr/man/cat1/mail.0 ${DESTDIR}/usr/man/cat1/Mail.0
 
 
-errlst.o: errlst.c
-       ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c -
-       ${CC} ${CFLAGS} -R -c x.c
-       mv x.o errlst.o
-
-print: $S fmt.c
-       $(CGRAPH) > mail.g;
-       $(NMKINDEX) > mail.i;
-       $(DIRTCLOD) -x mail.i -p mail.g > mail.x
-       @$(VPRINT) makefile mail.x rcv.h def.h glob.h local.h v7.local.h \
-           $(SRCS) fmt.c;
+lint:
+       lint ${CFLAGS} ${SRCS}
+       lint ${CFLAGS} fmt.c head.c
 
 
-wc:
-       @wc rcv.h def.h glob.h local.h v7.local.h $(SRCS)
+tags:
+       ctags ${SRCS}
+       ctags -a fmt.c
+       sort -o tags tags
 
 
-sc:
-       @grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS)