Commit | Line | Data |
---|---|---|
7aa40f92 | 1 | # |
5fdf95cd KB |
2 | # Copyright (c) 1987 The Regents of the University of California. |
3 | # All rights reserved. | |
ba710df4 | 4 | # |
5fdf95cd KB |
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 4.10 (Berkeley) %G% | |
ba710df4 KB |
18 | # |
19 | # Flag BSD4_2 means 4.2 or later. | |
20 | CFLAGS= -O -DBSD4_2 | |
21 | LIBC= /lib/libc.a | |
22 | LLIB= ${DESTDIR}/usr/lib/learn/bin | |
23 | SRCS= copy.c dounit.c getlesson.c learn.c list.c mem.c makpipe.c maktee.c \ | |
24 | mysys.c selsub.c selunit.c start.c whatnow.c wrapup.c | |
25 | OBJS= copy.o dounit.o getlesson.o learn.o list.o mem.o makpipe.o maktee.o \ | |
26 | mysys.o selsub.o selunit.o start.o whatnow.o wrapup.o | |
5fdf95cd KB |
27 | LESSONS=C editor eqn files macros morefiles |
28 | MAN= learn.0 | |
7aa40f92 | 29 | |
af33acf0 | 30 | all: learn lrntee lcount getline.o getnum.o |
7aa40f92 | 31 | |
ba710df4 KB |
32 | learn: ${OBJS} ${LIBC} |
33 | ${CC} -o $@ ${CFLAGS} ${OBJS} | |
7aa40f92 | 34 | |
5fdf95cd KB |
35 | lcount lrntee: ${LIBC} |
36 | ${CC} ${CFLAGS} -o $@ $@.c | |
7aa40f92 | 37 | |
5fdf95cd | 38 | clean: |
af33acf0 | 39 | rm -f ${OBJS} core learn lrntee lcount getline.o getnum.o |
f9a082f0 | 40 | |
5fdf95cd KB |
41 | cleandir: clean |
42 | rm -f ${MAN} tags .depend | |
7aa40f92 | 43 | |
5fdf95cd KB |
44 | depend: ${SRCS} |
45 | mkdep -p ${CFLAGS} lcount.c lrntee.c | |
46 | mkdep -a ${CFLAGS} ${SRCS} getline.c getnum.c | |
47 | ||
48 | install: ${MAN} | |
ba710df4 KB |
49 | install -c -s -o bin -g bin -m 755 learn ${DESTDIR}/usr/bin/learn |
50 | install -s -o bin -g bin -m 755 learn ${LLIB}/learn | |
51 | install -s -o bin -g bin -m 755 lrntee ${LLIB}/lrntee | |
52 | install -s -o bin -g bin -m 755 lcount ${LLIB}/lcount | |
af33acf0 JK |
53 | install -o bin -g bin -m 644 getline.o ${LLIB}/getline.o |
54 | install -o bin -g bin -m 644 getnum.o ${LLIB}/getnum.o | |
55 | cd ${LLIB}; rm -f ../C/get*.o; ln getline.o getnum.o ../C | |
b0998160 KB |
56 | install -c -o bin -g bin -m 644 getline.c ${LLIB}/../C/getline.c |
57 | install -c -o bin -g bin -m 644 getnum.c ${LLIB}/../C/getnum.c | |
b1077c94 | 58 | chmod 755 ${LLIB}/../*/Init |
5fdf95cd KB |
59 | -[ -d ${DESTDIR}/usr/lib/learn ] || mkdir ${DESTDIR}/usr/lib/learn |
60 | -[ -d ${DESTDIR}/usr/lib/learn/log ] || mkdir ${DESTDIR}/usr/lib/learn/log | |
61 | -[ -d ${DESTDIR}/usr/lib/learn/bin ] || mkdir ${DESTDIR}/usr/lib/learn/bin | |
62 | chmod 755 ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \ | |
63 | ${DESTDIR}/usr/lib/learn/bin | |
64 | chown root.staff ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \ | |
65 | ${DESTDIR}/usr/lib/learn/bin | |
66 | install -c -o bin -g bin -m 644 learnlib/Linfo ${DESTDIR}/usr/lib/learn/Linfo | |
67 | install -c -o bin -g bin -m 644 learnlib/Xinfo ${DESTDIR}/usr/lib/learn/Xinfo | |
68 | cd learnlib; tar cf - ${LESSONS} | (cd ${DESTDIR}/usr/lib/learn; tar xpf -); | |
69 | install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 | |
7aa40f92 | 70 | |
5fdf95cd | 71 | lint: ${SRCS} |
ba710df4 KB |
72 | lint ${CFLAGS} ${SRCS} |
73 | lint ${CFLAGS} lcount.c | |
74 | lint ${CFLAGS} lrntee.c | |
af33acf0 | 75 | lint ${CFLAGS} getline.c getnum.c |
7aa40f92 | 76 | |
5fdf95cd | 77 | tags: ${SRCS} |
ba710df4 KB |
78 | ctags ${SRCS} |
79 | ctags -a lcount.c | |
80 | ctags -a lrntee.c | |
af33acf0 | 81 | ctags -a getline.c getnum.c |
ba710df4 | 82 | sort -o tags tags |