xref: /original-bsd/usr.bin/learn/Makefile (revision b64b0d54)
1#	@(#)Makefile	4.1	(Berkeley)	83/02/24
2#
3DESTDIR=
4
5LESSONS = files editor morefiles macros eqn C
6
7FILES = 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
14OBJECTS = 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
18CFLAGS = -O
19LIBRARY =
20LLIB	= $(DESTDIR)/usr/lib/learn
21
22all:	learn tee lcount
23
24install:	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
30clean:
31	rm -f *.o learn tee lcount errs
32
33cmp:	all
34	cmp learn $(DESTDIR)/bin/learn
35	cmp tee $(LLIB)/tee
36	cmp lcount $(LLIB)/lcount
37	rm learn tee lcount *.o
38
39learn: $(OBJECTS)
40	cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY)
41
42$(OBJECTS): lrnref.h
43
44lcount tee:
45	cc $(CFLAGS) $@.c -o $@ $(LIBRARY)
46
47lessons:	$(LESSONS)
48
49$(LESSONS):
50	-rm -r $(LLIB)/$@
51	mkdir $(LLIB)/$@
52	(cd $(LLIB)/$@; ar x ../$@.a)
53
54play log:
55	-rm -r $(LLIB)/$@; mkdir $(LLIB)/$@; chmod +w $(LLIB)/$@
56
57check:
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
63