get winsz via ioctl and respond to SIGWINCH.
[unix-history] / usr / src / bin / csh / Makefile
index b23c514..f570b21 100644 (file)
@@ -1,70 +1,69 @@
 #
 #
-#      Makefile        4.2     %G%
+# Copyright (c) 1980 Regents of the University of California.
+# All rights reserved.  The Berkeley Software License Agreement
+# specifies the terms and conditions for redistribution.
+#
+#      @(#)Makefile    5.3 (Berkeley) %G%
 #
 # C Shell with process control; VM/UNIX VAX Makefile
 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
 #
 #
 # C Shell with process control; VM/UNIX VAX Makefile
 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
 #
-CFLAGS=        -O -DTELL -DVMUNIX -Ddebug -DVFORK
+# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
+
+DEFS=  -DTELL -DVFORK -DFILEC
+CFLAGS=        $(DEFS) -O
 XSTR=  /usr/ucb/xstr
 XSTR=  /usr/ucb/xstr
-ED=    -ed
-AS=    -as
+AS=    as
 RM=    -rm
 CXREF= /usr/ucb/cxref
 RM=    -rm
 CXREF= /usr/ucb/cxref
-VGRIND=        csh /usr/ucb/vgrind
+VGRIND=        /usr/ucb/vgrind
 CTAGS= /usr/ucb/ctags
 LIBES=
 CTAGS= /usr/ucb/ctags
 LIBES=
-SCCS=  /usr/local/sccs
+SCCS=  sccs
 
 
-# strings.o must be last in OBJS since it can change when previous files compile
-OBJS=  sh.o sh.dol.o sh.err.o sh.exec.o sh.exp.o sh.func.o sh.glob.o \
-       sh.hist.o sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.sem.o sh.set.o \
-       sh.proc.o sh.dir.o sh.time.o alloc.o sh.init.o printf.o \
-       strings.o doprnt.o
+OBJS=  alloc.o doprnt.o printf.o sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
+       sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
+       sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o \
+       sh.time.o
 
 # Special massaging of C files for sharing of strings
 .c.o:
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
        ${CC} -c ${CFLAGS} x.c 
 
 # Special massaging of C files for sharing of strings
 .c.o:
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
        ${CC} -c ${CFLAGS} x.c 
-       mv x.o $*.o
+       mv -f x.o $*.o
+       rm -f x.c
 
 
-csh: ${OBJS} sh.local.h
+# strings.o must be last since it can change when previous files compile
+csh: ${OBJS} strings.o
        rm -f csh
        rm -f csh
-       cc ${OBJS} -o csh ${LIBES}
-
-csh.prof: ${OBJS} sh.prof.o sh.local.h mcrt0.o
-       rm -f csh.prof
-       ld -X mcrt0.o ${OBJS} -o csh.prof ${LIBES} -lc
-
-sh.o.prof:
-       cp sh.c sh.prof.c
-       cc -c ${CFLAGS} -DPROF sh.prof.c
+       ${CC} ${CFLAGS} ${OBJS} strings.o -o csh ${LIBES}
 
 .DEFAULT:
        ${SCCS} get $<
 
 # need an old doprnt, whose output we can trap
 doprnt.o: doprnt.c
 
 .DEFAULT:
        ${SCCS} get $<
 
 # need an old doprnt, whose output we can trap
 doprnt.o: doprnt.c
-       cc -E doprnt.c > doprnt.s
-       as -o doprnt.o doprnt.s
-       rm -f doprnt.s
+       ${CC} -E doprnt.c | ${AS} -o doprnt.o
 
 
-# strings.o and sh.init.o are specially processed to be shared
+# strings.o, sh.init.o, and sh.char.o are specially processed to be shared
 strings.o: strings
        ${XSTR}
        ${CC} -c -R xs.c
 strings.o: strings
        ${XSTR}
        ${CC} -c -R xs.c
-       mv xs.o strings.o
+       mv -f xs.o strings.o
+       rm -f xs.c
 
 
-sh.init.o:
-       ${CC} -E ${CFLAGS} sh.init.c | ${XSTR} -c -
+sh.char.o sh.init.o:
+       ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
        ${CC} ${CFLAGS} -c -R x.c
        ${CC} ${CFLAGS} -c -R x.c
-       mv x.o sh.init.o
+       mv -f x.o $*.o
+       rm -f x.c
        
 lint:
        
 lint:
-       lint ${CFLAGS} sh*.c
+       lint -z ${DEFS} sh*.c alloc.c
 
 print:
        @pr READ_ME
 
 print:
        @pr READ_ME
-       @pr makefile makefile.*
+       @pr Makefile Makefile.*
        @(size -l a.out; size *.o) | pr -h SIZES
        @${CXREF} sh*.c | pr -h XREF
        @ls -l | pr 
        @(size -l a.out; size *.o) | pr -h SIZES
        @${CXREF} sh*.c | pr -h XREF
        @ls -l | pr 
@@ -72,7 +71,7 @@ print:
 
 vprint:
        @pr -l84 READ_ME TODO
 
 vprint:
        @pr -l84 READ_ME TODO
-       @pr -l84 makefile makefile.*
+       @pr -l84 Makefile Makefile.*
        @(size -l a.out; size *.o) | pr -l84 -h SIZES
        @${CXREF} sh*.c | pr -l84 -h XREF
        @ls -l | pr -l84
        @(size -l a.out; size *.o) | pr -l84 -h SIZES
        @${CXREF} sh*.c | pr -l84 -h XREF
        @ls -l | pr -l84
@@ -81,16 +80,39 @@ vprint:
 
 vgrind:
        @cp /dev/null index
 
 vgrind:
        @cp /dev/null index
-       @for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
-       @for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
-       @vgrind -t -x -h Index index >/crp/bill/csh/index.t
+       @-mkdir grind
+       for i in *.h; do ${VGRIND} -t -h "C Shell" $$i >grind/$$i.t; done
+       for i in *.c; do ${VGRIND} -t -h "C Shell" $$i >grind/$$i.t; done
+       ${VGRIND} -t -x -h Index index >grind/index.t
 
 
-install: csh sh.local.h
+install: csh
        install -s csh ${DESTDIR}/bin/csh
 
 clean:
        install -s csh ${DESTDIR}/bin/csh
 
 clean:
-       ${RM} -f a.out strings x.c xs.c csh
-       ${RM} -f *.o sh.prof.c
+       ${RM} -f a.out strings x.c xs.c csh errs
+       ${RM} -f *.o
+       ${RM} -rf vgrind
+
+tags:
+       ${CTAGS} -t *.h sh*.c
 
 
-tags:  /tmp
-       ${CTAGS} sh*.c
+sh.o: sh.h sh.local.h sh.char.h
+sh.char.o: sh.char.h
+sh.dir.o: sh.h sh.local.h sh.dir.h
+sh.dol.o: sh.h sh.local.h sh.char.h
+sh.err.o: sh.h sh.local.h sh.char.h
+sh.exec.o: sh.h sh.local.h sh.char.h
+sh.exp.o: sh.h sh.local.h sh.char.h
+sh.file.o: sh.h sh.local.h sh.char.h
+sh.func.o: sh.h sh.local.h sh.char.h
+sh.glob.o: sh.h sh.local.h sh.char.h
+sh.hist.o: sh.h sh.local.h sh.char.h
+sh.init.o: sh.local.h
+sh.lex.o: sh.h sh.local.h sh.char.h
+sh.misc.o: sh.h sh.local.h sh.char.h
+sh.parse.o: sh.h sh.local.h sh.char.h
+sh.print.o: sh.h sh.local.h sh.char.h
+sh.proc.o: sh.h sh.local.h sh.dir.h sh.proc.h sh.char.h
+sh.sem.o: sh.h sh.local.h sh.proc.h sh.char.h
+sh.set.o: sh.h sh.local.h sh.char.h
+sh.time.o: sh.h sh.local.h sh.char.h