add offsets, new fields
[unix-history] / usr / src / usr.bin / ex / Makefile
index b66534a..0b0a9d4 100644 (file)
@@ -1,6 +1,27 @@
-VERSION=3.4
 #
 #
-# Ex skeletal makefile for VAX VM/Unix version 7
+# 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    7.13.1.1 (Berkeley) %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    7.13.1.1 (Berkeley) %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    7.13.1.1 (Berkeley) %G%
+#
+VERSION=3.7
+#
+# Ex skeletal makefile for VAX VM/Unix 4.2BSD
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
@@ -25,67 +46,71 @@ FOLD=       ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
 DEBUGFLAGS=    -DTRACE -g
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
 DEBUGFLAGS=    -DTRACE -g
-#
-# D O   N O T   D I S T R I B U T E   E X    W I T H   H O R S E   I N   I T!!!
-NONDEBUGFLAGS= -O -DHORSE
+NONDEBUGFLAGS= -O
 DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
 DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
-CFLAGS=        -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB}
+OPTIONS= -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX -DFASTTAG
+CFLAGS=        -DTABS=8 ${OPTIONS} ${DEB}
 LDFLAGS=       -z              # or -i or -n
 LDFLAGS=       -z              # or -i or -n
-TERMLIB=       -ltermlib
+TERMLIB=       -ltermcap
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
 OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
 OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
-       ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
-       ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
-       ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
+       ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
+       ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
+       ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
-       printf.o bcopy.o horse.o strings.o
+       printf.o bcopy.o strings.o
 HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
 SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
 SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
 HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
 SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
 SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
-SRC3=  ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
-SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c
+SRC3=  ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c
+SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
 SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
 SRC6=  printf.c bcopy.c expreserve.c exrecover.c
 SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
 SRC6=  printf.c bcopy.c expreserve.c exrecover.c
-MISC=  makefile READ_ME :rofix
+MISC=  makefile READ_ME rofix
 VGRIND=        csh /usr/ucb/vgrind
 VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
 VGRIND=        csh /usr/ucb/vgrind
 VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
-#      ${MKSTR} - ex${VERSION}strings x $*.c
+# ifdef VMUNIX
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
+# else
+#      ${MKSTR} - ex${VERSION}strings x $*.c
+#      ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
 #      rm -f x$*.c
 #      rm -f x$*.c
+# endif
        ${CC} ${CFLAGS} -c x.c 
        mv x.o $*.o
 
        ${CC} ${CFLAGS} -c x.c 
        mv x.o $*.o
 
-a.out: ${OBJS}
-       cc ${LDFLAGS} ${OBJS} ${TERMLIB}
+all:   a.out exrecover expreserve
 
 
-all:   a.out exrecover expreserve tags
+a.out: ${OBJS}
+       @echo loading a.out
+       @${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
 
 tags:  /tmp
        ${CTAGS} -w ex.[hc] ex_*.[hc]
 
 
 tags:  /tmp
        ${CTAGS} -w ex.[hc] ex_*.[hc]
 
-${OBJS}: ex_vars.h
+${OBJS}: ${HDRS}
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
 bcopy.o:       bcopy.c
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
 bcopy.o:       bcopy.c
-       cc -c ${CFLAGS} bcopy.c
+       ${CC} -c ${CFLAGS} bcopy.c
 
 # xstr: hands off!
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
 
 # xstr: hands off!
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
-       ed - <:rofix xs.s
-       as -o strings.o xs.s
+       ed - <rofix xs.s
+       ${AS} -o strings.o xs.s
        rm xs.s
        
 exrecover: exrecover.o
        rm xs.s
        
 exrecover: exrecover.o
-       ${CC} ${CFLAGS} exrecover.o -o exrecover
+       ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
 
 exrecover.o: exrecover.c
        ${CC} ${CFLAGS} -c -O exrecover.c
 
 exrecover.o: exrecover.c
        ${CC} ${CFLAGS} -c -O exrecover.c
@@ -97,7 +122,7 @@ expreserve.o:
        ${CC} ${CFLAGS} -c -O expreserve.c
 
 clean:
        ${CC} ${CFLAGS} -c -O expreserve.c
 
 clean:
-#      If we dont have ex we cant make it so dont rm ex_vars.h
+#      If we dont have ex we cant make it so don't rm ex_vars.h
        -rm -f a.out exrecover expreserve strings core errs trace
        -rm -f *.o x*.[cs]
 
        -rm -f a.out exrecover expreserve strings core errs trace
        -rm -f *.o x*.[cs]
 
@@ -112,40 +137,39 @@ ninstall: a.out
 
 # install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
 
 # install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
-       -rm -f ${DESTDIR}${BINDIR}/ex
-       -rm -f ${DESTDIR}${BINDIR}/vi
-       -rm -f ${DESTDIR}${BINDIR}/view
-       -rm -f ${DESTDIR}${BINDIR}/edit
-       -rm -f ${DESTDIR}${BINDIR}/e
+       -rm -f ${DESTDIR}/${BINDIR}/ex
+       -rm -f ${DESTDIR}/${BINDIR}/vi
+       -rm -f ${DESTDIR}/${BINDIR}/view
+       -rm -f ${DESTDIR}/${BINDIR}/edit
+       -rm -f ${DESTDIR}/${BINDIR}/e
        -rm -f ${DESTDIR}/usr/bin/ex
        -rm -f ${DESTDIR}/usr/bin/ex
-       cp a.out ${DESTDIR}${BINDIR}/ex
+       install -s -m 1755 a.out ${DESTDIR}/${BINDIR}/ex
 #      cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
 #      cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
-       chmod 1755 ${DESTDIR}${BINDIR}/ex
-       cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
-       cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
-       chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
+       chmod 1755 ${DESTDIR}/${BINDIR}/ex
+       install -s -o root -m 4755 exrecover ${DESTDIR}/${LIBDIR}/ex${VERSION}recover
+       install -s -o root -m 4755 expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve
 # The following line normally fails.  This is OK.
 # The following line normally fails.  This is OK.
-       mkdir ${DESTDIR}/usr/preserve
+       -mkdir ${DESTDIR}/usr/preserve
 
 # move from /usr/new to /usr/ucb
 newucb: a.out
 
 # move from /usr/new to /usr/ucb
 newucb: a.out
-       -rm -f ${DESTDIR}${BINDIR}/ex
-       -rm -f ${DESTDIR}${BINDIR}/vi
-       -rm -f ${DESTDIR}${BINDIR}/edit
-       -rm -f ${DESTDIR}${BINDIR}/e
+       -rm -f ${DESTDIR}/${BINDIR}/ex
+       -rm -f ${DESTDIR}/${BINDIR}/vi
+       -rm -f ${DESTDIR}/${BINDIR}/edit
+       -rm -f ${DESTDIR}/${BINDIR}/e
        -rm -f ${DESTDIR}/usr/bin/ex
        -rm -f ${DESTDIR}/usr/bin/ex
-       mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
-       -rm -f ${DESTDIR}${NBINDIR}/vi
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
-       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
-       chmod 1755 ${DESTDIR}${BINDIR}/ex
+       mv ${DESTDIR}/${NBINDIR}/ex ${DESTDIR}/${NBINDIR}/ex
+       -rm -f ${DESTDIR}/${NBINDIR}/vi
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
+       ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
+       chmod 1755 ${DESTDIR}/${BINDIR}/ex
 
 lint:
        lint ${CFLAGS} ex.c ex_?*.c
 
 lint:
        lint ${CFLAGS} ex.c ex_?*.c
@@ -168,12 +192,12 @@ print:
        @${PR} *.h *.c
 vgrind:
        tee index < /dev/null
        @${PR} *.h *.c
 vgrind:
        tee index < /dev/null
-#      ${VGRIND} -h ${VHDR} ${HDRS}
-#      ${VGRIND} -h ${VHDR} ${SRC1}
-#      ${VGRIND} -h ${VHDR} ${SRC2}
+       ${VGRIND} -h ${VHDR} ${HDRS}
+       ${VGRIND} -h ${VHDR} ${SRC1}
+       ${VGRIND} -h ${VHDR} ${SRC2}
        ${VGRIND} -h ${VHDR} ${SRC3}
        ${VGRIND} -h ${VHDR} ${SRC4}
        ${VGRIND} -h ${VHDR} ${SRC5}
        ${VGRIND} -h ${VHDR} ${SRC6}
        ${VGRIND} -h ${VHDR} ${SRC3}
        ${VGRIND} -h ${VHDR} ${SRC4}
        ${VGRIND} -h ${VHDR} ${SRC5}
        ${VGRIND} -h ${VHDR} ${SRC6}
-#      ${VGRIND} -n -h ${VHDR} ${MISC}
+       ${VGRIND} -n -h ${VHDR} ${MISC}
        ${VGRIND} -i -h ${VHDR} index
        ${VGRIND} -i -h ${VHDR} index