Commit | Line | Data |
---|---|---|
e63bfae4 KB |
1 | # |
2 | # Copyright (c) 1987 The Regents of the University of California. | |
3 | # All rights reserved. | |
4 | # | |
5 | # Redistribution and use in source and binary forms are permitted | |
6 | # provided that the above copyright notice and this paragraph are | |
7 | # duplicated in all such forms and that any documentation, | |
8 | # advertising materials, and other materials related to such | |
9 | # distribution and use acknowledge that the software was developed | |
10 | # by the University of California, Berkeley. The name of the | |
11 | # University may not be used to endorse or promote products derived | |
12 | # from this software without specific prior written permission. | |
13 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
16 | # | |
17 | # @(#)Makefile 5.19 (Berkeley) %G% | |
11ece1e5 SL |
18 | # |
19 | # This version expects the 4.2BSD directory reading routines to | |
20 | # located in libc.a. If they aren't, augment LIBS. Also, LIBS | |
21 | # can be set to reference other object modules and libraries needed | |
22 | # by uucico, such as -lunet (needed when UNET is defined). | |
23 | # | |
24 | # Common object files are assembled into a library {uulib.a} | |
25 | # | |
1a85e9d2 RC |
26 | ALL= uucico uucp uux uuxqt uulog uuclean uuname uupoll uusnap \ |
27 | uuencode uudecode uusend uucpd uuq acucntrl | |
11ece1e5 | 28 | # Common object files placed in uulib.a |
e63bfae4 KB |
29 | COMMON= anlwrk.o anyread.o cfgets.o chkpth.o cpmv.o expfile.o gename.o \ |
30 | getargs.o getprm.o getpwinfo.o gnxseq.o lastpart.o logent.o \ | |
31 | mailst.o prefix.o setline.o subdir.o sysacct.o systat.o ulockf.o \ | |
32 | uucpdefs.o uucpname.o versys.o xqt.o | |
281ecb58 JB |
33 | SRCS= ${USRCS} ${OSRCS} ${LSRCS} |
34 | USRCS= cico.c cntrl.c conn.c condevs.c gnsys.c pk0.c chksum.c pk1.c tio.c \ | |
35 | fio.c gio.c imsg.c | |
36 | OSRCS= uuclean.c uucp.c uulog.c uuname.c uupoll.c \ | |
37 | uusend.c uusnap.c uux.c uuxqt.c uuq.c acucntrl.c | |
e63bfae4 KB |
38 | LSRCS= anlwrk.c anyread.c cfgets.c chkpth.c cpmv.c expfile.c gename.c \ |
39 | getargs.c getprm.c getpwinfo.c gnxseq.c lastpart.c logent.c \ | |
40 | mailst.c prefix.c setline.c subdir.c sysacct.c systat.c ulockf.c \ | |
281ecb58 | 41 | uucpdefs.c uucpname.c versys.c xqt.c |
e63bfae4 KB |
42 | MAN1= uucp.0 uuencode.0 uulog.0 uuname.0 uux.0 uuq.0 uusend.0 |
43 | MAN8= uucico.0 uuclean.0 uupoll.0 uusnap.0 uuxqt.0 | |
281ecb58 | 44 | |
907f54c1 RA |
45 | #These might be useful on non 4.3bsd systems. |
46 | MISC= htonl.c ioctl.c index.c mkdir.c strpbrk.c | |
88db71e9 | 47 | |
11ece1e5 | 48 | DESTDIR= |
281ecb58 | 49 | |
eddee743 RA |
50 | # Define P=& if your make supports parallelism (e.g. Sequent) |
51 | P= | |
52 | ||
11ece1e5 SL |
53 | OWNER= uucp |
54 | GROUP= daemon | |
55 | CFLAGS= -O | |
56 | LDFLAGS= | |
281ecb58 | 57 | LINTFLAGS= -chbap |
e63bfae4 KB |
58 | LIBS= |
59 | LIBC= /lib/libc.a | |
88db71e9 RC |
60 | LIBDIR= ${DESTDIR}/usr/lib/uucp |
61 | BIN= ${DESTDIR}/usr/bin | |
602b7055 | 62 | ETC= ${DESTDIR}/etc |
88db71e9 RC |
63 | PUBDIR= ${DESTDIR}/usr/spool/uucppublic |
64 | SPOOL= ${DESTDIR}/usr/spool/uucp | |
65 | XQTDIR= ${SPOOL}/XTMP | |
66 | CORRUPT= ${SPOOL}/CORRUPT | |
67 | AUDIT= ${SPOOL}/AUDIT | |
281ecb58 JB |
68 | LCK= ${SPOOL}/LCK |
69 | LOG= ${SPOOL}/LOG | |
88db71e9 | 70 | STST= ${SPOOL}/STST |
1a85e9d2 | 71 | # The six subdirs {not counting XTMP}. |
281ecb58 JB |
72 | HOSTNAME=`uuname -l | sed 's/\(.......\).*/\1/'` |
73 | SUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM. | |
11ece1e5 | 74 | |
e63bfae4 | 75 | all: $(P) ${ALL} |
11ece1e5 | 76 | |
e63bfae4 | 77 | print: $(SRCS) |
88db71e9 RC |
78 | vgrind $? |
79 | vgrind -x index | |
80 | touch print | |
81 | ||
e63bfae4 KB |
82 | uucp uux uuxqt uulog uuclean uuname uupoll uusend uuq: uulib.a ${LIBS} ${LIBC} |
83 | ${CC} -o $@ ${LDFLAGS} $@.c uulib.a ${LIBS} | |
11ece1e5 | 84 | |
e63bfae4 KB |
85 | uusnap uuencode uudecode uucpd acucntrl: ${LIBS} ${LIBC} |
86 | ${CC} -o $@ ${LDFLAGS} $@.c ${LIBS} | |
11ece1e5 | 87 | |
eddee743 | 88 | uucico: $(P) cico.o cntrl.o conn.o condevs.o gnsys.o pk0.o chksum.o pk1.o \ |
e63bfae4 | 89 | tio.o fio.o gio.o imsg.o uulib.a $(P) aculib/aculib.a ${LIBC} |
281ecb58 JB |
90 | ${CC} -o uucico ${LDFLAGS} cico.o cntrl.o conn.o condevs.o gnsys.o \ |
91 | pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \ | |
92 | uulib.a aculib/aculib.a ${LIBS} | |
11ece1e5 | 93 | |
11ece1e5 SL |
94 | # Note: mode 700 on ${LIBDIR} would be safer. |
95 | # Also, L.sys etc should be 600. | |
88db71e9 | 96 | |
11ece1e5 | 97 | mkdirs: |
88db71e9 | 98 | -for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \ |
1a85e9d2 | 99 | ${AUDIT} ${LCK} ${LOG} ${STST} ; do \ |
88db71e9 | 100 | rm -f $$i ; mkdir $$i ; \ |
b2c1852d | 101 | chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \ |
88db71e9 RC |
102 | done |
103 | chmod 777 ${PUBDIR} ${LCK} | |
1a85e9d2 RC |
104 | -cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\ |
105 | rm -f $$i ; mkdir $$i ; \ | |
b2c1852d | 106 | chmod 755 $$i; /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \ |
1a85e9d2 | 107 | done |
88db71e9 | 108 | -cd ${SPOOL}; for i in ${SUBDIRS} ; do \ |
11ece1e5 | 109 | mkdir $$i; \ |
b2c1852d | 110 | /etc/chown ${OWNER} $$i; chgrp ${GROUP} $$i; chmod 755 $$i; \ |
11ece1e5 SL |
111 | done |
112 | ||
113 | # The lorder...tsort below is for systems w/o ranlib | |
114 | # But it doesnt hurt to use it. Ignore the spurious "cycle" messages | |
eddee743 | 115 | uulib.a: $(P) ${COMMON} |
11ece1e5 SL |
116 | rm -f $@ |
117 | ar cr $@ `lorder ${COMMON} | tsort` | |
118 | ranlib $@ | |
119 | ||
88db71e9 | 120 | aculib/aculib.a: |
eddee743 | 121 | cd aculib; make ${MFLAGS} "CFLAGS=${CFLAGS}" "P=${P}" |
88db71e9 | 122 | |
e63bfae4 | 123 | install: ${MAN1} ${MAN8} |
b2c1852d | 124 | /etc/chown ${OWNER} ${LIBDIR} |
88db71e9 RC |
125 | chgrp ${GROUP} ${LIBDIR} |
126 | chmod 755 ${LIBDIR} | |
e63bfae4 KB |
127 | install -s -m 6111 -o ${OWNER} -g ${GROUP} uucico uuclean ${LIBDIR} |
128 | install -s -m 6111 -o ${OWNER} -g ${GROUP} \ | |
129 | uucp uux uulog uuname uusnap uupoll uuq ${BIN} | |
88db71e9 | 130 | install -s -m 6110 -o ${OWNER} -g ${GROUP} uuxqt ${LIBDIR} |
1a85e9d2 | 131 | install -s -m 6110 -o root -g ${GROUP} acucntrl ${LIBDIR} |
602b7055 | 132 | install -s -m 500 -o uucp uucpd ${ETC} |
281ecb58 JB |
133 | @echo Dont forget to fork off /etc/uucpd in /etc/rc.local |
134 | @echo if you are not running /etc/inetd | |
eddee743 RA |
135 | install -s -m 755 -o bin -g bin uusend ${BIN} |
136 | install -s -m 755 -o bin -g bin uuencode ${BIN} | |
137 | install -s -m 755 -o bin -g bin uudecode ${BIN} | |
138 | rm -f ${BIN}/ruusend | |
139 | ln ${BIN}/uusend ${BIN}/ruusend | |
e63bfae4 KB |
140 | install -c -o bin -g bin -m 444 ${MAN1} ${DESTDIR}/usr/man/cat1 |
141 | install -c -o bin -g bin -m 444 ${MAN8} ${DESTDIR}/usr/man/cat8 | |
142 | rm -f ${DESTDIR}/usr/man/cat1/uudecode.0 | |
143 | ln ${DESTDIR}/usr/man/cat1/uuencode.0 ${DESTDIR}/usr/man/cat1/uudecode.0 | |
11ece1e5 SL |
144 | |
145 | clean: | |
146 | rm -f *.o ${ALL} uulib.a | |
1a85e9d2 | 147 | cd aculib; make ${MFLAGS} clean |
11ece1e5 | 148 | |
e63bfae4 KB |
149 | cleandir: clean |
150 | rm -f ${MAN} tags .depend | |
151 | cd aculib; make ${MFLAGS} cleandir | |
8f59f016 | 152 | |
e63bfae4 KB |
153 | depend: ${SRCS} |
154 | mkdep ${CFLAGS} ${USRCS} ${LSRCS} | |
155 | mkdep -a -p ${CFLAGS} ${OSRCS} | |
156 | cd aculib; make ${MFLAGS} depend | |
8f59f016 | 157 | |
e63bfae4 KB |
158 | lint: ${SRCS} |
159 | lint ${LINTFLAGS} ${USRCS} ${LSRCS} | |
160 | -for i in ${OSRCS} ; do \ | |
161 | lint ${LINTFLAGS} $$i ${LSRCS} ;\ | |
162 | done | |
8f59f016 | 163 | |
e63bfae4 KB |
164 | tags: ${SRCS} |
165 | ctags ${SRCS} |