xref: /original-bsd/usr.bin/uucp/Makefile (revision e4dd4c49)
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.20 (Berkeley) 04/05/90
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#
26ALL=	uucico uucp uux uuxqt uulog uuclean uuname uupoll uusnap \
27	uusend uuq acucntrl
28# Common object files placed in uulib.a
29COMMON=	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
33SRCS=	${USRCS} ${OSRCS} ${LSRCS}
34USRCS=	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
36OSRCS=	uuclean.c uucp.c uulog.c uuname.c uupoll.c \
37	uusend.c uusnap.c uux.c uuxqt.c uuq.c acucntrl.c
38LSRCS=	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 \
41	uucpdefs.c uucpname.c versys.c xqt.c
42MAN1=	uucp.0 uulog.0 uuname.0 uux.0 uuq.0 uusend.0
43MAN8=	uucico.0 uuclean.0 uupoll.0 uusnap.0 uuxqt.0
44MAN5=	L-devices.0 L-dialcodes.0 L.aliases.0 L.cmds.0 L.sys.0 \
45	USERFILE.0
46
47#These might be useful on non 4.3bsd systems.
48MISC= htonl.c ioctl.c index.c mkdir.c strpbrk.c
49
50DESTDIR=
51
52# Define P=& if your make supports parallelism (e.g. Sequent)
53P=
54
55OWNER=	uucp
56GROUP=	daemon
57CFLAGS=	-DUSE_OLD_TTY -O
58LDFLAGS=
59LINTFLAGS= -chbap
60LIBS=
61LIBC=	/lib/libc.a
62LIBDIR=	${DESTDIR}/usr/lib/uucp
63BIN=	${DESTDIR}/usr/bin
64ETC=	${DESTDIR}/etc
65PUBDIR=	${DESTDIR}/usr/spool/uucppublic
66SPOOL=	${DESTDIR}/usr/spool/uucp
67XQTDIR=	${SPOOL}/XTMP
68CORRUPT= ${SPOOL}/CORRUPT
69AUDIT=	${SPOOL}/AUDIT
70LCK= ${SPOOL}/LCK
71LOG= ${SPOOL}/LOG
72STST=	${SPOOL}/STST
73# The six subdirs {not counting XTMP}.
74HOSTNAME=`uuname -l | sed 's/\(.......\).*/\1/'`
75SUBDIRS=C. D.${HOSTNAME}X D.${HOSTNAME} D. X. TM.
76
77all: $(P) ${ALL}
78
79print: $(SRCS)
80	vgrind $?
81	vgrind -x index
82	touch print
83
84uucp uux uuxqt uulog uuclean uuname uupoll uusend uuq: uulib.a ${LIBS} ${LIBC}
85	${CC} -o $@ ${LDFLAGS} $@.c uulib.a ${LIBS} -lcompat
86
87uusnap acucntrl: ${LIBS} ${LIBC}
88	${CC} -o $@ ${LDFLAGS} $@.c ${LIBS}
89
90uucico:	$(P) cico.o cntrl.o conn.o condevs.o gnsys.o pk0.o chksum.o pk1.o \
91	tio.o fio.o gio.o imsg.o uulib.a $(P) aculib/aculib.a ${LIBC}
92	${CC} -o uucico ${LDFLAGS} cico.o cntrl.o conn.o condevs.o gnsys.o \
93	pk0.o chksum.o pk1.o tio.o fio.o gio.o imsg.o \
94	uulib.a aculib/aculib.a ${LIBS} -lcompat
95
96# Note: mode 700 on ${LIBDIR} would be safer.
97# Also,  L.sys etc should be 600.
98
99mkdirs:
100	-for i in ${LIBDIR} ${SPOOL} ${PUBDIR} ${XQTDIR} ${CORRUPT} \
101		${AUDIT} ${LCK} ${LOG} ${STST} ; do \
102		rm -f $$i ; mkdir $$i ; \
103		chmod 755 $$i; chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
104	done
105	chmod 777 ${PUBDIR} ${LCK}
106	-cd ${LOG}; for i in uucico uux uuxqt uucp xferstats; do\
107		rm -f $$i ; mkdir $$i ; \
108		chmod 755 $$i; chown ${OWNER} $$i; chgrp ${GROUP} $$i ; \
109	done
110	-cd ${SPOOL}; for i in ${SUBDIRS} ; do \
111		mkdir $$i; \
112		chown ${OWNER} $$i; chgrp ${GROUP} $$i; chmod 755 $$i; \
113	done
114
115# The lorder...tsort below is for systems w/o ranlib
116# But it doesnt hurt to use it. Ignore the spurious "cycle" messages
117uulib.a: $(P) ${COMMON}
118	rm -f $@
119	ar cr $@ `lorder ${COMMON} | tsort`
120	ranlib $@
121
122aculib/aculib.a:
123	cd aculib; make ${MFLAGS} "CFLAGS=${CFLAGS}" "P=${P}"
124
125install: ${MAN1} ${MAN8} ${MAN5}
126	chown ${OWNER} ${LIBDIR}
127	chgrp ${GROUP} ${LIBDIR}
128	chmod 755 ${LIBDIR}
129	install -s -m 6111 -o ${OWNER} -g ${GROUP} uucico uuclean ${LIBDIR}
130	install -s -m 6111 -o ${OWNER} -g ${GROUP} \
131		uucp uux uulog uuname uusnap uupoll uuq ${BIN}
132	install -s -m 6110 -o ${OWNER} -g ${GROUP} uuxqt ${LIBDIR}
133	install -s -m 6110 -o root -g ${GROUP} acucntrl ${LIBDIR}
134	install -s -m 755 -o bin -g bin uusend ${BIN}
135	rm -f ${BIN}/ruusend
136	ln ${BIN}/uusend ${BIN}/ruusend
137	install -c -o bin -g bin -m 444 ${MAN1} ${DESTDIR}/usr/man/cat1
138	install -c -o bin -g bin -m 444 ${MAN5} ${DESTDIR}/usr/man/cat5
139	install -c -o bin -g bin -m 444 ${MAN8} ${DESTDIR}/usr/man/cat8
140
141clean:
142	rm -f *.o ${ALL} uulib.a
143	cd aculib; make ${MFLAGS} clean
144
145cleandir: clean
146	rm -f ${MAN} tags .depend
147	cd aculib; make ${MFLAGS} cleandir
148
149depend: ${SRCS}
150	mkdep ${CFLAGS} ${USRCS} ${LSRCS}
151	mkdep -a -p ${CFLAGS} ${OSRCS}
152	cd aculib; make ${MFLAGS} depend
153
154lint: ${SRCS}
155	lint ${LINTFLAGS} ${USRCS} ${LSRCS}
156	-for i in ${OSRCS} ; do \
157		lint ${LINTFLAGS} $$i ${LSRCS} ;\
158	done
159
160tags: ${SRCS}
161	ctags ${SRCS}
162