1# @(#)Makefile 4.3 (Berkeley) 83/06/19 2# 3DESTDIR= 4 5LESSONS = files editor morefiles macros eqn C 6 7FILES = lrnref.h \ 8 copy.c dounit.c getlesson.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 lrntee.c \ 12 makefile 13 14OBJECTS = copy.o dounit.o getlesson.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/bin 21 22all: learn lrntee lcount 23 24install: all 25 install -c -s learn $(DESTDIR)/usr/bin 26 install -s learn $(LLIB) 27 install -s lrntee $(LLIB) 28 install -s lcount $(LLIB) 29 30ccinstall: all 31 cp learn lrntee lcount $(LLIB) 32 chmod 755 $(LLIB)/* 33 strip $(LLIB)/* 34 35clean: 36 rm -f *.o learn lrntee lcount errs 37 38cmp: all 39 cmp learn $(DESTDIR)/usr/bin/learn 40 cmp learn $(LLIB)/learn 41 cmp lrntee $(LLIB)/lrntee 42 cmp lcount $(LLIB)/lcount 43 rm learn lrntee lcount *.o 44 45learn: $(OBJECTS) 46 cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY) 47 48$(OBJECTS): lrnref.h 49 50lcount lrntee: 51 cc $(CFLAGS) $@.c -o $@ $(LIBRARY) 52 53log: 54 -rm -r $(LLIB)/../log; mkdir $(LLIB)/../log; chmod +w $(LLIB)/../log 55 56check: 57 -@test -r $(LLIB)/lrntee || echo 'lrntee not present; make lrntee' 58 -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount' 59 -@test -r $(LLIB)/../log || echo 'log directory not present; make log if you want logging' 60