Research V7 development
[unix-history] / usr / src / cmd / learn / makefile
CommitLineData
1d22b2ea
BK
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 = /usr/lib/learn
17
18cp: all
19 cp learn /bin
20 cp tee $(LLIB)
21 cp lcount $(LLIB)
22 rm learn tee lcount *.o
23 @echo "Now do 'make lessons' if you need to extract the lesson archives"
24 @echo "Then do 'make play; make log' to make playpen and log directories"
25
26cmp: all
27 cmp learn /bin/learn
28 cmp tee $(LLIB)/tee
29 cmp lcount $(LLIB)/lcount
30 rm learn tee lcount *.o
31
32all: learn tee lcount
33
34learn: $(OBJECTS)
35 cc -n -s -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY)
36
37$(OBJECTS): lrnref
38learn.o: lrndef
39
40lcount tee:
41 cc $(CFLAGS) -s -n $@.c -o $@ $(LIBRARY)
42
43lessons: $(LESSONS)
44
45$(LESSONS):
46 -rm -r $(LLIB)/$@
47 mkdir $(LLIB)/$@
48 (cd $(LLIB)/$@; ar x ../$@.a)
49
50play log:
51 -rm -r $(LLIB)/$@; mkdir $(LLIB)/$@; chmod +w $(LLIB)/$@
52
53check:
54 -@test -r $(LLIB)/tee || echo 'tee not present; make tee'
55 -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount'
56 -@test -r $(LLIB)/play || echo 'play directory not present; make play'
57 -@test -r $(LLIB)/log || echo 'log directory not present; make log'
58 -@for i in $(LESSONS); do test -r $(LLIB)/$$i/L0 || echo $$i not unarchived, make $$i; done