Commit | Line | Data |
---|---|---|
ed71b044 | 1 | # @(#)Makefile 4.2 (Berkeley) 83/04/25 |
7aa40f92 KM |
2 | # |
3 | DESTDIR= | |
4 | ||
5 | LESSONS = files editor morefiles macros eqn C | |
6 | ||
7 | FILES = lrnref.h \ | |
8 | copy.c dounit.c learn.c list.c \ | |
9 | makpipe.c maktee.c mem.c mysys.c selsub.c selunit.c \ | |
10 | start.c whatnow.c wrapup.c \ | |
11 | lcount.c tee.c \ | |
12 | makefile | |
13 | ||
14 | OBJECTS = copy.o dounit.o learn.o list.o mem.o \ | |
15 | makpipe.o maktee.o mysys.o selsub.o selunit.o \ | |
16 | start.o whatnow.o wrapup.o | |
17 | ||
18 | CFLAGS = -O | |
19 | LIBRARY = | |
20 | LLIB = $(DESTDIR)/usr/lib/learn | |
21 | ||
22 | all: learn tee lcount | |
23 | ||
24 | install: all | |
25 | install -s learn $(DESTDIR)/usr/bin | |
26 | install -s tee $(LLIB) | |
27 | install -s lcount $(LLIB) | |
28 | @echo "Then do 'make play; make log' to make playpen and log directories" | |
29 | ||
30 | clean: | |
31 | rm -f *.o learn tee lcount errs | |
32 | ||
33 | cmp: all | |
34 | cmp learn $(DESTDIR)/bin/learn | |
35 | cmp tee $(LLIB)/tee | |
36 | cmp lcount $(LLIB)/lcount | |
37 | rm learn tee lcount *.o | |
38 | ||
39 | learn: $(OBJECTS) | |
40 | cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY) | |
41 | ||
42 | $(OBJECTS): lrnref.h | |
43 | ||
44 | lcount tee: | |
45 | cc $(CFLAGS) $@.c -o $@ $(LIBRARY) | |
46 | ||
47 | lessons: $(LESSONS) | |
48 | ||
49 | $(LESSONS): | |
50 | -rm -r $(LLIB)/$@ | |
51 | mkdir $(LLIB)/$@ | |
52 | (cd $(LLIB)/$@; ar x ../$@.a) | |
53 | ||
54 | play log: | |
55 | -rm -r $(LLIB)/$@; mkdir $(LLIB)/$@; chmod +w $(LLIB)/$@ | |
56 | ||
57 | check: | |
58 | -@test -r $(LLIB)/tee || echo 'tee not present; make tee' | |
59 | -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount' | |
60 | -@test -r $(LLIB)/play || echo 'play directory not present; make play' | |
61 | -@test -r $(LLIB)/log || echo 'log directory not present; make log' | |
62 | -@for i in $(LESSONS); do test -r $(LLIB)/$$i/L0 || echo $$i not unarchived, make $$i; done |