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