Commit | Line | Data |
---|---|---|
a8629c9c | 1 | # @(#)Makefile 4.5 (Berkeley) 87/05/31 |
7aa40f92 KM |
2 | # |
3 | DESTDIR= | |
4 | ||
0acfbe6a | 5 | # The vi lessons come with the user-contributed software. |
7aa40f92 KM |
6 | LESSONS = files editor morefiles macros eqn C |
7 | ||
8 | FILES = lrnref.h \ | |
f9a082f0 | 9 | copy.c dounit.c getlesson.c learn.c list.c \ |
7aa40f92 KM |
10 | makpipe.c maktee.c mem.c mysys.c selsub.c selunit.c \ |
11 | start.c whatnow.c wrapup.c \ | |
f9a082f0 | 12 | lcount.c lrntee.c \ |
7aa40f92 KM |
13 | makefile |
14 | ||
f9a082f0 | 15 | OBJECTS = copy.o dounit.o getlesson.o learn.o list.o mem.o \ |
7aa40f92 KM |
16 | makpipe.o maktee.o mysys.o selsub.o selunit.o \ |
17 | start.o whatnow.o wrapup.o | |
18 | ||
0acfbe6a JB |
19 | # Flag BSD4_2 means 4.2 or later. |
20 | CFLAGS = -O -DBSD4_2 | |
7aa40f92 | 21 | LIBRARY = |
f9a082f0 KM |
22 | LLIB = $(DESTDIR)/usr/lib/learn/bin |
23 | ||
24 | all: learn lrntee lcount | |
7aa40f92 | 25 | |
7aa40f92 | 26 | install: all |
1c14ff4d | 27 | install -c -s learn $(DESTDIR)/usr/bin |
f9a082f0 KM |
28 | install -s learn $(LLIB) |
29 | install -s lrntee $(LLIB) | |
7aa40f92 | 30 | install -s lcount $(LLIB) |
f9a082f0 | 31 | |
7aa40f92 | 32 | clean: |
f9a082f0 | 33 | rm -f *.o learn lrntee lcount errs |
7aa40f92 KM |
34 | |
35 | cmp: all | |
f9a082f0 KM |
36 | cmp learn $(DESTDIR)/usr/bin/learn |
37 | cmp learn $(LLIB)/learn | |
38 | cmp lrntee $(LLIB)/lrntee | |
7aa40f92 | 39 | cmp lcount $(LLIB)/lcount |
f9a082f0 | 40 | rm learn lrntee lcount *.o |
7aa40f92 KM |
41 | |
42 | learn: $(OBJECTS) | |
43 | cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY) | |
44 | ||
45 | $(OBJECTS): lrnref.h | |
46 | ||
f9a082f0 | 47 | lcount lrntee: |
7aa40f92 KM |
48 | cc $(CFLAGS) $@.c -o $@ $(LIBRARY) |
49 | ||
f9a082f0 KM |
50 | log: |
51 | -rm -r $(LLIB)/../log; mkdir $(LLIB)/../log; chmod +w $(LLIB)/../log | |
7aa40f92 KM |
52 | |
53 | check: | |
f9a082f0 | 54 | -@test -r $(LLIB)/lrntee || echo 'lrntee not present; make lrntee' |
7aa40f92 | 55 | -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount' |
f9a082f0 | 56 | -@test -r $(LLIB)/../log || echo 'log directory not present; make log if you want logging' |
a8629c9c KB |
57 | |
58 | depend: |