BSD 4_4 release
[unix-history] / usr / src / usr.bin / uucp / Makefile
index 208ab70..a560528 100644 (file)
-#
-# Copyright (c) 1987 The Regents of the University of California.
-# All rights reserved.
-#
-# 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.
-#
-#      @(#)Makefile    5.19 (Berkeley) %G%
-#
-# This version expects the 4.2BSD directory reading routines to
-# located in libc.a.  If they aren't, augment LIBS.  Also, LIBS
-# can be set to reference other object modules and libraries needed
-# by uucico, such as -lunet (needed when UNET is defined).
-#
-# Common object files are assembled into a library {uulib.a}
-#
-ALL=   uucico uucp uux uuxqt uulog uuclean uuname uupoll uusnap \
-       uuencode uudecode uusend uucpd uuq acucntrl
-# Common object files placed in uulib.a
-COMMON=        anlwrk.o anyread.o cfgets.o chkpth.o cpmv.o expfile.o gename.o \
-       getargs.o getprm.o getpwinfo.o gnxseq.o lastpart.o logent.o \
-       mailst.o prefix.o setline.o subdir.o sysacct.o systat.o ulockf.o \
-       uucpdefs.o uucpname.o versys.o xqt.o
-SRCS=  ${USRCS} ${OSRCS} ${LSRCS}
-USRCS= cico.c cntrl.c conn.c condevs.c gnsys.c pk0.c chksum.c pk1.c tio.c \
-       fio.c gio.c imsg.c 
-OSRCS= uuclean.c uucp.c uulog.c uuname.c uupoll.c \
-       uusend.c uusnap.c uux.c uuxqt.c uuq.c acucntrl.c
-LSRCS= anlwrk.c anyread.c cfgets.c chkpth.c cpmv.c expfile.c gename.c \
-       getargs.c getprm.c getpwinfo.c gnxseq.c lastpart.c logent.c \
-       mailst.c prefix.c setline.c subdir.c sysacct.c systat.c ulockf.c \
-       uucpdefs.c uucpname.c versys.c xqt.c
-MAN1=  uucp.0 uuencode.0 uulog.0 uuname.0 uux.0 uuq.0 uusend.0
-MAN8=  uucico.0 uuclean.0 uupoll.0 uusnap.0 uuxqt.0
+#      @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 
-#These might be useful on non 4.3bsd systems.
-MISC= htonl.c ioctl.c index.c mkdir.c strpbrk.c 
+SUBDIR=        libacu libuu uucico acucntrl man5 uuclean uucp uulog uuname uupoll \
+       uuq uusend uusnap uux uuxqt
 
 
-DESTDIR=
+.include "${.CURDIR}/Makefile.inc"
 
 
-# Define P=& if your make supports parallelism (e.g. Sequent)
-P=
-
-OWNER= uucp
-GROUP= daemon
-CFLAGS=        -O
-LDFLAGS=
-LINTFLAGS= -chbap
-LIBS=
-LIBC=  /lib/libc.a
-LIBDIR=        ${DESTDIR}/usr/lib/uucp
-BIN=   ${DESTDIR}/usr/bin
-ETC=   ${DESTDIR}/etc
-PUBDIR=        ${DESTDIR}/usr/spool/uucppublic
-SPOOL= ${DESTDIR}/usr/spool/uucp
-XQTDIR=        ${SPOOL}/XTMP
-CORRUPT= ${SPOOL}/CORRUPT
-AUDIT= ${SPOOL}/AUDIT
-LCK= ${SPOOL}/LCK
-LOG= ${SPOOL}/LOG
-STST=  ${SPOOL}/STST
-# The six subdirs {not counting XTMP}.
-HOSTNAME=`uuname -l | sed 's/\(.......\).*/\1/'`
-SUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM.
-
-all: $(P) ${ALL}
-
-print: $(SRCS)
-       vgrind $?
-       vgrind -x index
-       touch print
-
-uucp uux uuxqt uulog uuclean uuname uupoll uusend uuq: uulib.a ${LIBS} ${LIBC}
-       ${CC} -o $@ ${LDFLAGS} $@.c uulib.a ${LIBS}
-
-uusnap uuencode uudecode uucpd acucntrl: ${LIBS} ${LIBC}
-       ${CC} -o $@ ${LDFLAGS} $@.c ${LIBS}
-
-uucico:        $(P) cico.o cntrl.o conn.o condevs.o gnsys.o pk0.o chksum.o pk1.o \
-       tio.o fio.o gio.o imsg.o uulib.a $(P) aculib/aculib.a ${LIBC}
-       ${CC} -o uucico ${LDFLAGS} cico.o cntrl.o conn.o condevs.o gnsys.o \
-       pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \
-       uulib.a aculib/aculib.a ${LIBS}
+#HOSTNAME=     `uuname -l | sed 's/\(.......\).*/\1/'`
+HOSTNAME=      `hostname -s`
+SUBDIRS=       C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM.
 
 # Note: mode 700 on ${LIBDIR} would be safer.
 
 # Note: mode 700 on ${LIBDIR} would be safer.
-# Also,  L.sys etc should be 600.
-
-mkdirs:
-       -for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \
-               ${AUDIT} ${LCK} ${LOG} ${STST} ; do \
-               rm -f $$i ; mkdir $$i ; \
-               chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
-       done
-       chmod 777 ${PUBDIR} ${LCK}
-       -cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\
-               rm -f $$i ; mkdir $$i ; \
-               chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
+# Also, L.sys etc. should be 600.
+afterinstall:
+       @for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \
+           ${AUDIT} ${LCK} ${LOG} ${STST}; do \
+               if [ ! -d $$i ]; then \
+                       rm -f $$i; \
+                       mkdir -p $$i; \
+               fi; \
+               chmod 755 $$i; \
+               chown ${BINOWN}.${BINGRP} $$i; \
        done
        done
-       -cd ${SPOOL}; for i in ${SUBDIRS} ; do \
-               mkdir $$i; \
-               /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i; chmod 755 $$i; \
+       @chmod 777 ${PUBDIR} ${LCK}
+       @ls -ldg ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \
+           ${AUDIT} ${LCK} ${LOG} ${STST}
+       @cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\
+               if [ ! -d $$i ]; then \
+                       rm -f $$i; \
+                       mkdir $$i; \
+               fi; \
+               chmod 755 $$i; \
+               chown ${BINOWN}.${BINGRP} $$i; \
+               ls -ldg $$i; \
        done
        done
-
-# The lorder...tsort below is for systems w/o ranlib
-# But it doesnt hurt to use it. Ignore the spurious "cycle" messages
-uulib.a: $(P) ${COMMON}
-       rm -f $@
-       ar cr $@ `lorder ${COMMON} | tsort`
-       ranlib $@
-
-aculib/aculib.a:
-       cd aculib; make ${MFLAGS} "CFLAGS=${CFLAGS}" "P=${P}"
-
-install: ${MAN1} ${MAN8}
-       /etc/chown ${OWNER} ${LIBDIR}
-       chgrp ${GROUP} ${LIBDIR}
-       chmod 755 ${LIBDIR}
-       install -s -m 6111 -o ${OWNER} -g ${GROUP} uucico uuclean ${LIBDIR}
-       install -s -m 6111 -o ${OWNER} -g ${GROUP} \
-               uucp uux uulog uuname uusnap uupoll uuq ${BIN}
-       install -s -m 6110 -o ${OWNER} -g ${GROUP} uuxqt ${LIBDIR}
-       install -s -m 6110 -o root -g ${GROUP} acucntrl ${LIBDIR}
-       install -s -m 500 -o uucp uucpd ${ETC}
-       @echo Dont forget to fork off /etc/uucpd in /etc/rc.local
-       @echo if you are not running /etc/inetd
-       install -s -m 755 -o bin -g bin uusend ${BIN}
-       install -s -m 755 -o bin -g bin uuencode ${BIN}
-       install -s -m 755 -o bin -g bin uudecode ${BIN}
-       rm -f ${BIN}/ruusend
-       ln ${BIN}/uusend ${BIN}/ruusend
-       install -c -o bin -g bin -m 444 ${MAN1} ${DESTDIR}/usr/man/cat1
-       install -c -o bin -g bin -m 444 ${MAN8} ${DESTDIR}/usr/man/cat8
-       rm -f ${DESTDIR}/usr/man/cat1/uudecode.0
-       ln ${DESTDIR}/usr/man/cat1/uuencode.0 ${DESTDIR}/usr/man/cat1/uudecode.0
-
-clean:
-       rm -f *.o ${ALL} uulib.a
-       cd aculib; make ${MFLAGS} clean
-
-cleandir: clean
-       rm -f ${MAN} tags .depend
-       cd aculib; make ${MFLAGS} cleandir
-
-depend: ${SRCS}
-       mkdep ${CFLAGS} ${USRCS} ${LSRCS}
-       mkdep -a -p ${CFLAGS} ${OSRCS}
-       cd aculib; make ${MFLAGS} depend
-
-lint: ${SRCS}
-       lint ${LINTFLAGS} ${USRCS} ${LSRCS}
-       -for i in ${OSRCS} ; do \
-               lint ${LINTFLAGS} $$i ${LSRCS} ;\
+       @cd ${SPOOL}; for i in ${SUBDIRS}; do \
+               if [ ! -d $$i ]; then \
+                       mkdir $$i; \
+               fi; \
+               chown ${BINOWN}.${BINGRP} $$i; \
+               chmod 755 $$i; \
+               ls -ldg $$i; \
        done
 
        done
 
-tags: ${SRCS}
-       ctags ${SRCS}
+.include <bsd.subdir.mk>