BSD 4 development
[unix-history] / usr / src / cmd / learn / makefile
CommitLineData
e6ad6f9a
BJ
1LESSONS = files editor morefiles macros eqn C
2
3FILES = 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
10OBJECTS = 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
14CFLAGS = -O
15LIBRARY =
16LLIB = $(DESTDIR)/usr/lib/learn
17
18all: learn tee lcount
19
20install: 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
27clean:
28 rm -f *.o learn tee lcount
29cmp: all
30 cmp learn /bin/learn
31 cmp tee $(LLIB)/tee
32 cmp lcount $(LLIB)/lcount
33 rm learn tee lcount *.o
34
35learn: $(OBJECTS)
36 cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY)
37
38$(OBJECTS): lrnref
39learn.o: lrndef
40
41lcount tee:
42 cc $(CFLAGS) $@.c -o $@ $(LIBRARY)
43
44lessons: $(LESSONS)
45
46$(LESSONS):
47 -rm -r $(LLIB)/$@
48 mkdir $(LLIB)/$@
49 (cd $(LLIB)/$@; ar x ../$@.a)
50
51play log:
52 -rm -r $(LLIB)/$@; mkdir $(LLIB)/$@; chmod +w $(LLIB)/$@
53
54check:
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