BSD 4_3_Tahoe release
[unix-history] / usr / src / usr.bin / learn / Makefile
index 390c716..108e5ba 100644 (file)
@@ -1,56 +1,92 @@
-#      @(#)Makefile    4.4     (Berkeley)      86/05/15
 #
 #
-DESTDIR=
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.  The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
+#
+#      @(#)Makefile    4.9     (Berkeley)      6/10/88
+#
+# Flag BSD4_2 means 4.2 or later.
+CFLAGS=        -O -DBSD4_2
+LIBC=  /lib/libc.a
+LLIB=  ${DESTDIR}/usr/lib/learn/bin
+SRCS=  copy.c dounit.c getlesson.c learn.c list.c mem.c makpipe.c maktee.c \
+       mysys.c selsub.c selunit.c start.c whatnow.c wrapup.c
+OBJS=  copy.o dounit.o getlesson.o learn.o list.o mem.o makpipe.o maktee.o \
+       mysys.o selsub.o selunit.o start.o whatnow.o wrapup.o
 
 
-# The vi lessons come with the user-contributed software.
-LESSONS = files editor morefiles macros eqn C
+all: learn lrntee lcount getline.o getnum.o
 
 
-FILES = lrnref.h \
-       copy.c dounit.c getlesson.c learn.c list.c \
-       makpipe.c maktee.c mem.c mysys.c selsub.c selunit.c \
-       start.c whatnow.c wrapup.c \
-       lcount.c lrntee.c \
-       makefile
+learn: ${OBJS} ${LIBC}
+       ${CC} -o $@ ${CFLAGS} ${OBJS}
 
 
-OBJECTS = copy.o dounit.o getlesson.o learn.o list.o mem.o \
-       makpipe.o maktee.o mysys.o selsub.o selunit.o \
-       start.o whatnow.o wrapup.o
+lcount: lcount.c ${LIBC}
+       ${CC} ${CFLAGS} -o $@ lcount.c
 
 
-# Flag BSD4_2 means 4.2 or later.
-CFLAGS = -O -DBSD4_2
-LIBRARY =
-LLIB   = $(DESTDIR)/usr/lib/learn/bin
+lrntee: lrntee.c ${LIBC}
+       ${CC} ${CFLAGS} -o $@ lrntee.c
 
 
-all:   learn lrntee lcount
+clean: FRC
+       rm -f ${OBJS} core learn lrntee lcount getline.o getnum.o
 
 
-install:       all
-       install -c -s learn $(DESTDIR)/usr/bin
-       install -s learn $(LLIB)
-       install -s lrntee $(LLIB)
-       install -s lcount $(LLIB)
+depend: FRC
+       mkdep ${CFLAGS} ${SRCS} lcount.c lrntee.c getline.c getnum.c
 
 
-clean:
-       rm -f *.o learn lrntee lcount errs
+install: FRC
+       install -c -s -o bin -g bin -m 755 learn ${DESTDIR}/usr/bin/learn
+       install -s -o bin -g bin -m 755 learn ${LLIB}/learn
+       install -s -o bin -g bin -m 755 lrntee ${LLIB}/lrntee
+       install -s -o bin -g bin -m 755 lcount ${LLIB}/lcount
+       install -o bin -g bin -m 644 getline.o ${LLIB}/getline.o
+       install -o bin -g bin -m 644 getnum.o ${LLIB}/getnum.o
+       cd ${LLIB}; rm -f ../C/get*.o; ln getline.o getnum.o ../C
+       install -c -o bin -g bin -m 644 getline.c ${LLIB}/../C/getline.c
+       install -c -o bin -g bin -m 644 getnum.c ${LLIB}/../C/getnum.c
+       chmod 755 ${LLIB}/../*/Init
 
 
-cmp:   all
-       cmp learn $(DESTDIR)/usr/bin/learn
-       cmp learn $(LLIB)/learn
-       cmp lrntee $(LLIB)/lrntee
-       cmp lcount $(LLIB)/lcount
-       rm learn lrntee lcount *.o
+lint: FRC
+       lint ${CFLAGS} ${SRCS}
+       lint ${CFLAGS} lcount.c
+       lint ${CFLAGS} lrntee.c
+       lint ${CFLAGS} getline.c getnum.c
 
 
-learn: $(OBJECTS)
-       cc -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY)
+tags: FRC
+       ctags ${SRCS}
+       ctags -a lcount.c
+       ctags -a lrntee.c
+       ctags -a getline.c getnum.c
+       sort -o tags tags
 
 
-$(OBJECTS): lrnref.h
+FRC:
 
 
-lcount lrntee:
-       cc $(CFLAGS) $@.c -o $@ $(LIBRARY)
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
 
 
-log:
-       -rm -r $(LLIB)/../log; mkdir $(LLIB)/../log; chmod +w $(LLIB)/../log
+copy.o: copy.c /usr/include/stdio.h /usr/include/signal.h
+copy.o: /usr/include/machine/trap.h lrnref.h
+dounit.o: dounit.c /usr/include/stdio.h lrnref.h
+getlesson.o: getlesson.c /usr/include/stdio.h lrnref.h
+learn.o: learn.c /usr/include/stdio.h lrnref.h /usr/include/signal.h
+learn.o: /usr/include/machine/trap.h
+list.o: list.c /usr/include/stdio.h lrnref.h /usr/include/signal.h
+list.o: /usr/include/machine/trap.h
+mem.o: mem.c /usr/include/stdio.h lrnref.h
+makpipe.o: makpipe.c /usr/include/stdio.h
+maktee.o: maktee.c /usr/include/stdio.h /usr/include/signal.h
+maktee.o: /usr/include/machine/trap.h lrnref.h
+mysys.o: mysys.c /usr/include/stdio.h /usr/include/signal.h
+mysys.o: /usr/include/machine/trap.h
+selsub.o: selsub.c /usr/include/stdio.h /usr/include/sys/types.h
+selsub.o: /usr/include/sys/file.h /usr/include/sys/stat.h lrnref.h
+selsub.o: /usr/include/sys/dir.h
+selunit.o: selunit.c /usr/include/stdio.h lrnref.h
+start.o: start.c /usr/include/stdio.h lrnref.h /usr/include/sys/types.h
+start.o: /usr/include/sys/dir.h
+whatnow.o: whatnow.c /usr/include/stdio.h lrnref.h
+wrapup.o: wrapup.c /usr/include/signal.h /usr/include/machine/trap.h
+wrapup.o: /usr/include/stdio.h lrnref.h
+lcount.o: lcount.c /usr/include/stdio.h
+lrntee.o: lrntee.c
+getline.o: getline.c /usr/include/stdio.h
+getnum.o: getnum.c /usr/include/stdio.h
 
 
-check:
-       -@test -r $(LLIB)/lrntee || echo 'lrntee not present; make lrntee'
-       -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount'
-       -@test -r $(LLIB)/../log || echo 'log directory not present; make log if you want logging'
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY