# Make file for the UNIX Mail System (modified for PMAIL) # First, the descriptions of how to make .o files from .c and .s files # These are needed because the default compilation commands result in # the protection mode of the .o file being 0666, which we don't want .c.o: cc $(CFLAGS) -c $< chmod 0644 $@ .s.o: -as - -o $@ $< chmod 0644 $@ # Next, the macro definitions FILES = maild maildp msg send sig_maild \ creat_mbox mail_init MAILD-INCS = rqfile.h extern.h MAILD-OBJS = maild.o globals.o sender.o send_local.o str_util.o get_from.o \ getpw.o send_distrib.o MAILDP-OBJS = maildp.o globals.o senderp.o send_local.o send_pmail.o \ str_util.o get_from.o getpw.o getpm.o send_distrib.o MSG-INCS = rqfile.h init_rec.h MSG-OBJS = msg.o printf.o putchr.o SEND-INCS = rqfile.h init_rec.h send_cmd.h # The following macro should be equal to '-i' to get I/D separation in send ISPACE = -i CFLAGS = -O OWNER = Mail_Daemon GROUP = Daemons MAN = /src/man/ DOC = /src/docs/mail/ # With no arguments, make the entire mail system all: $(FILES) # Now, the description for the mail daemon and its constituents maild: $(MAILD-OBJS) binsrch.o cc -o maild $(MAILD-OBJS) binsrch.o -lS -chown $(OWNER) maild -chgrp $(GROUP) maild chmod 06755 maild # Now, the description for the mail daemon with pmail and its constituents maildp: $(MAILDP-OBJS) binsrch.o cc -o maildp $(MAILDP-OBJS) binsrch.o -lS -chown $(OWNER) maildp -chgrp $(GROUP) maildp chmod 06755 maildp $(MAILD-OBJS): $(MAILD-INCS) $(MAILDP-OBJS): $(MAILD-INCS) maild.o: tcode.h maildp.o: tcode.h maild.c cp maild.c maildp.c cc $(CFLAGS) -DPMAIL -c maildp.c rm maildp.c send_local.o: tcode.h init_rec.h send_pmail.o: tcode.h init_rec.h senderp.o: tcode.h init_rec.h sender.c cp sender.c senderp.c cc $(CFLAGS) -DPMAIL -c senderp.c rm senderp.c send_distrib.o: tcode.h # Next, the description for the mail reader and its constituents msg: $(MSG-OBJS) cc -o msg $(MSG-OBJS) chmod 0755 msg msg.o: $(MSG-INCS) # Next, the description for the mail sender send: send.c cc -o send $(ISPACE) $(CFLAGS) send.c -chgrp $(GROUP) send chmod 02755 send send.c: $(SEND-INCS) # Now, the descriptions for the utility programs: the mail daemon signaller, # mail initialization program, and mailbox creater. sig_maild: sig_maild.c cc -o $(CFLAGS) sig_maild sig_maild.c -chown $(OWNER) sig_maild -chgrp $(GROUP) sig_maild chmod 06755 sig_maild mail_init: mail_init.c cc -o $(CFLAGS) mail_init mail_init.c -lS chmod 0755 mail_init mail_init.c: rqfile.h init_rec.h creat_mbox: creat_mbox.c cc -o $(CFLAGS) creat_mbox creat_mbox.c -chown root creat_mbox chmod 04755 creat_mbox creat_mbox.c: rqfile.h init_rec.h # The operations to install the programs in the proper places install: cp maild /etc/maild -chown $(OWNER) /etc/maild -chgrp $(GROUP) /etc/maild chmod 06755 /etc/maild cp maildp /etc/maildp -chown $(OWNER) /etc/maildp -chgrp $(GROUP) /etc/maildp chmod 06755 /etc/maildp cpall send msg creat_mbox sig_maild mail_init /bin -chgrp $(GROUP) /bin/send chmod 03755 /bin/send chmod 01755 /bin/msg # Lastly, the documentation: manual pages and user's guide docs: manual user_guide manual: troff -e $(MAN)man0/kaa $(MAN)man6/mail_init.6 dover $(COPIES) t.v troff -e $(MAN)man0/kaa $(MAN)man6/msg.6 dover $(COPIES) t.v troff -e $(MAN)man0/kaa $(MAN)man6/send.6 dover $(COPIES) t.v troff -e $(MAN)man0/kaa $(MAN)man8/maild.8 dover $(COPIES) t.v rm t.v >/dev/null user_guide: troff -md $(DOC)mail.doc $(DOC)msg.doc $(DOC)send.doc \ $(DOC)mail_init.doc $(DOC)end.doc dover $(COPIES) t.v rm t.v >/dev/null