xref: /original-bsd/games/fortune/Makefile (revision 54e6d6c7)
1#
2# Copyright (c) 1987 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)Makefile	1.6	(Berkeley)	03/05/89
7#
8CFLAGS=	-O
9LIBC=	/lib/libc.a
10SFLAGS=	-r
11TDEV=	-Pver
12TROFF=	ditroff ${TDEV}
13SRCS=	fortune.c rnd.c strfile.c unstr.c
14MAN=	fortune.0
15
16all: fortune strfile unstr fortunes.dat
17
18fortune: fortune.o rnd.o ${LIBC}
19	${CC} ${CFLAGS} -o $@ fortune.o rnd.o
20
21strfile: strfile.o rnd.o ${LIBC}
22	${CC} ${CFLAGS} -o $@ strfile.o rnd.o
23
24unstr: unstr.o ${LIBC}
25	${CC} ${CFLAGS} -o $@ unstr.o
26
27fortunes.dat: fortunes strfile
28	./strfile ${SFLAGS} fortunes
29
30fortunes: scene obscene
31	(cat scene; echo "%-"; cat obscene) > fortunes
32
33clean:
34	rm -f fortune fortunes fortunes.dat strfile unstr core *.o
35	rm -f Oscene Oobscene
36
37cleandir: clean
38	rm -f ${MAN} tags .depend
39
40depend: ${SRCS}
41	mkdep ${CFLAGS} ${SRCS}
42
43install: ${MAN}
44	install -s -o games -g bin -m 4755 fortune ${DESTDIR}/usr/games
45	install -o games -g bin -m 600 fortunes.dat ${DESTDIR}/usr/games/lib
46	install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat6
47
48lint: ${SRCS}
49	lint ${CFLAGS} fortune.c rnd.c
50	lint ${CFLAGS} strfile.c rnd.c
51	lint ${CFLAGS} unstr.c
52
53tags: ${SRCS}
54	ctags ${SRCS}
55
56troff:
57	./Do_troff scene ${TROFF}
58	./Do_troff obscene ${TROFF}
59
60sort: sort.scene sort.obscene
61
62sort.scene: strfile unstr
63	strfile -oi scene
64	mv scene Oscene
65	unstr -o scene
66
67sort.obscene: strfile unstr
68	strfile -oi obscene
69	mv obscene Oobscene
70	unstr -o obscene
71