fixes fom rick adams and new make depend
[unix-history] / usr / src / usr.bin / uucp / Makefile
CommitLineData
281ecb58 1# Makefile 5.9 85/06/24
11ece1e5
SL
2#
3# This version expects the 4.2BSD directory reading routines to
4# located in libc.a. If they aren't, augment LIBS. Also, LIBS
5# can be set to reference other object modules and libraries needed
6# by uucico, such as -lunet (needed when UNET is defined).
7#
8# Common object files are assembled into a library {uulib.a}
9#
1a85e9d2
RC
10ALL= uucico uucp uux uuxqt uulog uuclean uuname uupoll uusnap \
11 uuencode uudecode uusend uucpd uuq acucntrl
11ece1e5
SL
12# Common object files placed in uulib.a
13COMMON= anlwrk.o anyread.o assert.o cfgets.o chkpth.o \
88db71e9 14 cpmv.o expfile.o gename.o getargs.o getprm.o \
281ecb58
JB
15 getpwinfo.o gnamef.o gnxseq.o lastpart.o logent.o mailst.o \
16 prefix.o setline.o strpbrk.o subdir.o sysacct.o systat.o \
17 ulockf.o uucpname.o versys.o xqt.o uucpdefs.o
18SRCS= ${USRCS} ${OSRCS} ${LSRCS}
19USRCS= cico.c cntrl.c conn.c condevs.c gnsys.c pk0.c chksum.c pk1.c tio.c \
20 fio.c gio.c imsg.c
21OSRCS= uuclean.c uucp.c uulog.c uuname.c uupoll.c \
22 uusend.c uusnap.c uux.c uuxqt.c uuq.c acucntrl.c
23LSRCS= anlwrk.c anyread.c assert.c cfgets.c chkpth.c \
24 cpmv.c expfile.c \
88db71e9 25 gename.c getargs.c getprm.c getpwinfo.c \
281ecb58
JB
26 gnamef.c gnxseq.c \
27 lastpart.c logent.c mailst.c prefix.c \
28 setline.c strpbrk.c subdir.c sysacct.c systat.c ulockf.c \
29 uucpdefs.c uucpname.c versys.c xqt.c
30
88db71e9 31#These might be useful on non 4.2bsd systems.
281ecb58 32MISC= htonl.c ioctl.c index.c mkdir.c getwd.c
88db71e9 33
11ece1e5 34DESTDIR=
281ecb58 35
11ece1e5
SL
36OWNER= uucp
37GROUP= daemon
38CFLAGS= -O
39LDFLAGS=
281ecb58 40LINTFLAGS= -chbap
88db71e9
RC
41LIBS=
42LIBDIR= ${DESTDIR}/usr/lib/uucp
43BIN= ${DESTDIR}/usr/bin
44PUBDIR= ${DESTDIR}/usr/spool/uucppublic
45SPOOL= ${DESTDIR}/usr/spool/uucp
46XQTDIR= ${SPOOL}/XTMP
47CORRUPT= ${SPOOL}/CORRUPT
48AUDIT= ${SPOOL}/AUDIT
281ecb58
JB
49LCK= ${SPOOL}/LCK
50LOG= ${SPOOL}/LOG
88db71e9 51STST= ${SPOOL}/STST
1a85e9d2 52# The six subdirs {not counting XTMP}.
281ecb58
JB
53HOSTNAME=`uuname -l | sed 's/\(.......\).*/\1/'`
54SUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM.
11cfcb47 55# for make depend
88db71e9 56UNDEF= -UNDIR -UUNET -USYSIII -UUNAME -UCCWHOAMI -UGETMYHNAME -UDATAKIT \
281ecb58 57 -DBSD4_2 -UUSG -UVMS -UBSD2_9
11ece1e5
SL
58
59all: ${ALL}
60
281ecb58
JB
61lint: ${SRCS}
62 lint ${LINTFLAGS} ${USRCS} ${LSRCS}
63 -for i in ${OSRCS} ; do \
64 lint ${LINTFLAGS} $$i ${LSRCS} ;\
65 done
88db71e9
RC
66print: $(SRCS)
67 vgrind $?
68 vgrind -x index
69 touch print
70
11ece1e5 71uucp: uucp.o uulib.a
281ecb58 72 ${CC} -o uucp ${LDFLAGS} uucp.o uulib.a ${LIBS}
11ece1e5
SL
73
74uux: uux.o uulib.a
281ecb58 75 ${CC} -o uux ${LDFLAGS} uux.o uulib.a ${LIBS}
11ece1e5
SL
76
77uuxqt: uuxqt.o uulib.a
78 ${CC} -o uuxqt ${LDFLAGS} uuxqt.o uulib.a ${LIBS}
79
281ecb58
JB
80uucico: cico.o cntrl.o conn.o condevs.o gnsys.o pk0.o chksum.o pk1.o tio.o \
81 fio.o gio.o imsg.o uulib.a aculib/aculib.a
82 ${CC} -o uucico ${LDFLAGS} cico.o cntrl.o conn.o condevs.o gnsys.o \
83 pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \
84 uulib.a aculib/aculib.a ${LIBS}
11ece1e5
SL
85
86uulog: uulog.o uulib.a
281ecb58 87 ${CC} -o uulog ${LDFLAGS} uulog.o uulib.a ${LIBS}
11ece1e5
SL
88
89uuclean: uuclean.o uulib.a
88db71e9 90 ${CC} -o uuclean ${LDFLAGS} uuclean.o uulib.a ${LIBS}
11ece1e5
SL
91
92uuname: uuname.o uulib.a
281ecb58 93 ${CC} -o uuname ${LDFLAGS} uuname.o uulib.a ${LIBS}
88db71e9 94
11ece1e5 95uupoll: uupoll.o uulib.a
281ecb58 96 ${CC} -o uupoll ${LDFLAGS} uupoll.o uulib.a ${LIBS}
11ece1e5 97
88db71e9
RC
98uusnap: uusnap.o
99 ${CC} -o uusnap ${LDFLAGS} uusnap.o ${LIBS}
11ece1e5 100
88db71e9 101uuencode: uuencode.o
281ecb58 102 ${CC} -o uuencode ${LDFLAGS} uuencode.o ${LIBS}
11ece1e5 103
88db71e9 104uudecode: uudecode.o
281ecb58 105 ${CC} -o uudecode ${LDFLAGS} uudecode.o ${LIBS}
11ece1e5 106
88db71e9 107uusend: uusend.o
281ecb58 108 ${CC} -o uusend ${LDFLAGS} uusend.o uulib.a ${LIBS}
11ece1e5 109
88db71e9 110uucpd: uucpd.o uucp.h
281ecb58 111 ${CC} -o uucpd ${LDFLAGS} uucpd.o ${LIBS}
480fe9de 112
88db71e9 113uuq: uuq.o uulib.a
281ecb58 114 ${CC} -o uuq ${LDFLAGS} uuq.o uulib.a ${LIBS}
88db71e9 115
1a85e9d2 116acucntrl: acucntrl.o
281ecb58 117 ${CC} -o acucntrl ${LDFLAGS} acucntrl.o ${LIBS}
1a85e9d2 118
11ece1e5
SL
119# Note: mode 700 on ${LIBDIR} would be safer.
120# Also, L.sys etc should be 600.
88db71e9 121
11ece1e5 122mkdirs:
88db71e9 123 -for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \
1a85e9d2 124 ${AUDIT} ${LCK} ${LOG} ${STST} ; do \
88db71e9
RC
125 rm -f $$i ; mkdir $$i ; \
126 chmod 755 $$i; chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
127 done
128 chmod 777 ${PUBDIR} ${LCK}
1a85e9d2
RC
129 -cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\
130 rm -f $$i ; mkdir $$i ; \
131 chmod 755 $$i; chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
132 done
88db71e9 133 -cd ${SPOOL}; for i in ${SUBDIRS} ; do \
11ece1e5 134 mkdir $$i; \
11cfcb47 135 chown ${OWNER} $$i; chgrp ${GROUP} $$i; chmod 755 $$i; \
11ece1e5
SL
136 done
137
138# The lorder...tsort below is for systems w/o ranlib
139# But it doesnt hurt to use it. Ignore the spurious "cycle" messages
140uulib.a: ${COMMON}
141 rm -f $@
142 ar cr $@ `lorder ${COMMON} | tsort`
143 ranlib $@
144
88db71e9 145aculib/aculib.a:
1a85e9d2 146 cd aculib; make ${MFLAGS} "CFLAGS=${CFLAGS}"
88db71e9 147
1a85e9d2 148install: ${ALL}
88db71e9
RC
149 chown ${OWNER} ${LIBDIR}
150 chgrp ${GROUP} ${LIBDIR}
151 chmod 755 ${LIBDIR}
152 for i in uucico uuclean; do \
153 install -s -m 6111 -o ${OWNER} -g ${GROUP} $$i ${LIBDIR} ;\
154 done
155 for i in uucp uux uulog uuname uusnap uupoll uuq uusend; do \
156 install -s -m 6111 -o ${OWNER} -g ${GROUP} $$i ${BIN} ;\
157 done
158 rm -f ${BIN}/ruusend
159 ln ${BIN}/uusend ${BIN}/ruusend
160 install -s -m 6110 -o ${OWNER} -g ${GROUP} uuxqt ${LIBDIR}
1a85e9d2 161 install -s -m 6110 -o root -g ${GROUP} acucntrl ${LIBDIR}
88db71e9 162 install -s -m 700 -o root uucpd /etc/uucpd
281ecb58
JB
163 @echo Dont forget to fork off /etc/uucpd in /etc/rc.local
164 @echo if you are not running /etc/inetd
88db71e9
RC
165 install -s uuencode ${BIN}
166 install -s uudecode ${BIN}
11ece1e5
SL
167
168clean:
169 rm -f *.o ${ALL} uulib.a
1a85e9d2 170 cd aculib; make ${MFLAGS} clean
11ece1e5
SL
171
172depend:
173 for i in *.c; do \
174 (echo `basename $$i .c`.o: $$i >>makedep; \
11cfcb47 175 unifdef ${UNDEF} $$i | \
11ece1e5
SL
176 /bin/grep '^#[ ]*include' | sed \
177 -e '/\.\.\/h/d' \
178 -e 's,<\(.*\)>,"/usr/include/\1",' \
179 -e 's/^[^"]*"\([^"]*\)".*/'"$$i"': \1/' \
180 -e 's/\.c/.o/' >>makedep); done
181 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
182 echo '$$r makedep' >>eddep
183 echo 'w' >>eddep
184 cp Makefile Makefile.bak
185 ed - Makefile < eddep
186 rm eddep makedep
187 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
188 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
189 echo '# see make depend above' >> Makefile
190
191# DO NOT DELETE THIS LINE -- make depend uses it
192# DEPENDENCIES MUST END AT END OF FILE
1a85e9d2
RC
193acucntrl.o: acucntrl.c
194acucntrl.o: uucp.h
281ecb58
JB
195acucntrl.o: /usr/include/sys/buf.h
196acucntrl.o: /usr/include/signal.h
197acucntrl.o: /usr/include/sys/conf.h
198acucntrl.o: /usr/include/vaxuba/ubavar.h
199acucntrl.o: /usr/include/sys/stat.h
200acucntrl.o: /usr/include/nlist.h
201acucntrl.o: /usr/include/sgtty.h
202acucntrl.o: /usr/include/utmp.h
203acucntrl.o: /usr/include/pwd.h
204acucntrl.o: /usr/include/stdio.h
11ece1e5
SL
205anlwrk.o: anlwrk.c
206anlwrk.o: uucp.h
281ecb58 207anlwrk.o: /usr/include/sys/stat.h
88db71e9 208anlwrk.o: uust.h
281ecb58
JB
209anlwrk.o: /usr/include/sys/dir.h
210anlwrk.o: /usr/include/ctype.h
11ece1e5
SL
211anyread.o: anyread.c
212anyread.o: uucp.h
281ecb58 213anyread.o: /usr/include/sys/stat.h
11ece1e5
SL
214assert.o: assert.c
215assert.o: uucp.h
281ecb58
JB
216assert.o: /usr/include/sys/time.h
217assert.o: /usr/include/errno.h
11ece1e5 218cfgets.o: cfgets.c
281ecb58 219cfgets.o: /usr/include/stdio.h
11ece1e5
SL
220chkpth.o: chkpth.c
221chkpth.o: uucp.h
281ecb58 222chkpth.o: /usr/include/sys/stat.h
88db71e9 223chksum.o: chksum.c
11ece1e5 224cico.o: cico.c
281ecb58 225cico.o: /usr/include/signal.h
11ece1e5 226cico.o: uucp.h
281ecb58
JB
227cico.o: /usr/include/setjmp.h
228cico.o: /usr/include/sgtty.h
229cico.o: /usr/include/netdb.h
230cico.o: /usr/include/netinet/in.h
231cico.o: /usr/include/sys/socket.h
232cico.o: /usr/include/sys/stat.h
88db71e9
RC
233cico.o: uust.h
234cico.o: uusub.h
11ece1e5
SL
235cntrl.o: cntrl.c
236cntrl.o: uucp.h
281ecb58 237cntrl.o: /usr/include/sys/stat.h
88db71e9 238cntrl.o: uust.h
11ece1e5 239condevs.o: condevs.c
1a85e9d2 240condevs.o: condevs.h
281ecb58 241condevs.o: /usr/include/sys/time.h
11ece1e5 242conn.o: conn.c
281ecb58 243conn.o: /usr/include/signal.h
11ece1e5 244conn.o: uucp.h
281ecb58
JB
245conn.o: /usr/include/setjmp.h
246conn.o: /usr/include/ctype.h
247conn.o: /usr/include/errno.h
248conn.o: /usr/include/sgtty.h
249conn.o: /usr/include/sys/time.h
11ece1e5
SL
250cpmv.o: cpmv.c
251cpmv.o: uucp.h
281ecb58 252cpmv.o: /usr/include/sys/stat.h
11ece1e5
SL
253expfile.o: expfile.c
254expfile.o: uucp.h
281ecb58 255expfile.o: /usr/include/sys/stat.h
88db71e9 256fio.o: fio.c
281ecb58 257fio.o: /usr/include/signal.h
88db71e9 258fio.o: uucp.h
281ecb58
JB
259fio.o: /usr/include/sgtty.h
260fio.o: /usr/include/setjmp.h
11ece1e5
SL
261gename.o: gename.c
262gename.o: uucp.h
263getargs.o: getargs.c
1a85e9d2 264getargs.o: uucp.h
11ece1e5 265getprm.o: getprm.c
281ecb58 266getprm.o: uucp.h
11ece1e5
SL
267getpwinfo.o: getpwinfo.c
268getpwinfo.o: uucp.h
281ecb58
JB
269getpwinfo.o: /usr/include/pwd.h
270getwd.o: getwd.c
271getwd.o: uucp.h
11ece1e5 272gio.o: gio.c
11ece1e5 273gio.o: uucp.h
1a85e9d2 274gio.o: pk.h
281ecb58 275gio.o: /usr/include/setjmp.h
11ece1e5
SL
276gnamef.o: gnamef.c
277gnamef.o: uucp.h
281ecb58 278gnamef.o: /usr/include/sys/dir.h
11ece1e5
SL
279gnsys.o: gnsys.c
280gnsys.o: uucp.h
281ecb58 281gnsys.o: /usr/include/sys/dir.h
11ece1e5
SL
282gnxseq.o: gnxseq.c
283gnxseq.o: uucp.h
281ecb58 284gnxseq.o: /usr/include/sys/time.h
11ece1e5
SL
285imsg.o: imsg.c
286imsg.o: uucp.h
1a85e9d2 287index.o: index.c
281ecb58 288index.o: /usr/include/stdio.h
11ece1e5
SL
289ioctl.o: ioctl.c
290ioctl.o: uucp.h
281ecb58 291ioctl.o: /usr/include/sgtty.h
11ece1e5 292lastpart.o: lastpart.c
281ecb58 293lastpart.o: uucp.h
11ece1e5
SL
294logent.o: logent.c
295logent.o: uucp.h
281ecb58
JB
296logent.o: /usr/include/sys/time.h
297logent.o: /usr/include/fcntl.h
298logent.o: /usr/include/sgtty.h
11ece1e5 299mailst.o: mailst.c
281ecb58 300mailst.o: /usr/include/signal.h
11ece1e5 301mailst.o: uucp.h
1a85e9d2 302mkdir.o: mkdir.c
11ece1e5 303pk0.o: pk0.c
1a85e9d2 304pk0.o: uucp.h
11ece1e5 305pk0.o: pk.h
11ece1e5 306pk1.o: pk1.c
281ecb58 307pk1.o: /usr/include/signal.h
88db71e9 308pk1.o: uucp.h
1a85e9d2 309pk1.o: pk.h
281ecb58
JB
310pk1.o: /usr/include/setjmp.h
311pk1.o: /usr/include/sys/time.h
11ece1e5 312prefix.o: prefix.c
11ece1e5
SL
313setline.o: setline.c
314setline.o: uucp.h
281ecb58 315strpbrk.o: strpbrk.c
11ece1e5
SL
316subdir.o: subdir.c
317subdir.o: uucp.h
318sysacct.o: sysacct.c
281ecb58 319sysacct.o: /usr/include/sys/types.h
11ece1e5
SL
320systat.o: systat.c
321systat.o: uucp.h
88db71e9 322tio.o: tio.c
281ecb58 323tio.o: /usr/include/signal.h
88db71e9 324tio.o: uucp.h
281ecb58
JB
325tio.o: /usr/include/setjmp.h
326tio.o: /usr/include/sys/stat.h
11ece1e5
SL
327ulockf.o: ulockf.c
328ulockf.o: uucp.h
281ecb58 329ulockf.o: /usr/include/sys/stat.h
11ece1e5 330uuclean.o: uuclean.c
281ecb58 331uuclean.o: /usr/include/signal.h
11ece1e5 332uuclean.o: uucp.h
281ecb58
JB
333uuclean.o: /usr/include/pwd.h
334uuclean.o: /usr/include/sys/stat.h
335uuclean.o: /usr/include/sys/dir.h
11ece1e5
SL
336uucp.o: uucp.c
337uucp.o: uucp.h
281ecb58 338uucp.o: /usr/include/sys/stat.h
88db71e9
RC
339uucp.o: uust.h
340uucpd.o: uucpd.c
341uucpd.o: uucp.h
281ecb58
JB
342uucpd.o: /usr/include/netdb.h
343uucpd.o: /usr/include/signal.h
344uucpd.o: /usr/include/errno.h
345uucpd.o: /usr/include/sys/socket.h
346uucpd.o: /usr/include/netinet/in.h
347uucpd.o: /usr/include/sys/wait.h
348uucpd.o: /usr/include/sys/ioctl.h
349uucpd.o: /usr/include/pwd.h
350uucpd.o: /usr/include/lastlog.h
351uucpd.o: /usr/include/utmp.h
352uucpd.o: /usr/include/fcntl.h
11ece1e5
SL
353uucpdefs.o: uucpdefs.c
354uucpdefs.o: uucp.h
355uucpname.o: uucpname.c
356uucpname.o: uucp.h
281ecb58 357uucpname.o: /usr/include/sys/stat.h
11ece1e5 358uudecode.o: uudecode.c
281ecb58
JB
359uudecode.o: /usr/include/stdio.h
360uudecode.o: /usr/include/pwd.h
361uudecode.o: /usr/include/sys/types.h
362uudecode.o: /usr/include/sys/stat.h
11ece1e5 363uuencode.o: uuencode.c
281ecb58
JB
364uuencode.o: /usr/include/stdio.h
365uuencode.o: /usr/include/sys/types.h
366uuencode.o: /usr/include/sys/stat.h
11ece1e5
SL
367uulog.o: uulog.c
368uulog.o: uucp.h
369uuname.o: uuname.c
370uuname.o: uucp.h
281ecb58 371uuname.o: /usr/include/signal.h
11ece1e5
SL
372uupoll.o: uupoll.c
373uupoll.o: uucp.h
88db71e9
RC
374uuq.o: uuq.c
375uuq.o: uucp.h
281ecb58
JB
376uuq.o: /usr/include/stdio.h
377uuq.o: /usr/include/sys/dir.h
378uuq.o: /usr/include/sys/stat.h
11ece1e5 379uusend.o: uusend.c
281ecb58
JB
380uusend.o: /usr/include/stdio.h
381uusend.o: /usr/include/pwd.h
382uusend.o: /usr/include/sys/types.h
383uusend.o: /usr/include/sys/stat.h
11ece1e5
SL
384uusnap.o: uusnap.c
385uusnap.o: uucp.h
281ecb58
JB
386uusnap.o: /usr/include/sys/stat.h
387uusnap.o: /usr/include/sys/dir.h
388uusnap.o: /usr/include/ctype.h
11ece1e5
SL
389uux.o: uux.c
390uux.o: uucp.h
391uuxqt.o: uuxqt.c
392uuxqt.o: uucp.h
281ecb58
JB
393uuxqt.o: /usr/include/sys/stat.h
394uuxqt.o: /usr/include/sys/dir.h
395uuxqt.o: /usr/include/signal.h
11ece1e5
SL
396versys.o: versys.c
397versys.o: uucp.h
281ecb58
JB
398versys.o: /usr/include/stdio.h
399versys.o: /usr/include/ctype.h
11ece1e5 400xqt.o: xqt.c
281ecb58 401xqt.o: /usr/include/signal.h
11ece1e5 402xqt.o: uucp.h
11ece1e5
SL
403# DEPENDENCIES MUST END AT END OF FILE
404# IF YOU PUT STUFF HERE IT WILL GO AWAY
405# see make depend above