BSD 2 development
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Sun, 6 May 1979 16:22:17 +0000 (08:22 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Sun, 6 May 1979 16:22:17 +0000 (08:22 -0800)
Work on file src/ex/:rofix
Work on file src/ex/doprnt.s
Work on file src/ex/make.script
Work on file src/ex/ex_vars.lisp
Work on file src/ex/ex_vars.nolisp
Work on file src/ex/makeoptions
Work on file src/ex/makefile.v6

Synthesized-from: 2bsd

src/ex/:rofix [new file with mode: 0644]
src/ex/doprnt.s [new file with mode: 0644]
src/ex/ex_vars.lisp [new file with mode: 0644]
src/ex/ex_vars.nolisp [new file with mode: 0644]
src/ex/make.script [new file with mode: 0644]
src/ex/makefile.v6 [new file with mode: 0644]
src/ex/makeoptions [new file with mode: 0755]

diff --git a/src/ex/:rofix b/src/ex/:rofix
new file mode 100644 (file)
index 0000000..cd5fa24
--- /dev/null
@@ -0,0 +1,3 @@
+g/^[   ]*\.data/s//.text/
+w
+q
diff --git a/src/ex/doprnt.s b/src/ex/doprnt.s
new file mode 100644 (file)
index 0000000..ac8ffa4
--- /dev/null
@@ -0,0 +1,332 @@
+/ C library -- conversions
+
+width=-8.
+formp=-10.
+rjust=-12.
+ndfnd=-14.
+ndigit=-16.
+zfill=-18.
+.globl __doprnt
+
+.globl pfloat
+.globl pscien
+.globl pgen
+
+.globl __strout
+.globl csv
+.globl cret
+
+__doprnt:
+       jsr     r5,csv
+       sub     $128.+12.,sp
+       mov     4(r5),formp(r5)         / format
+       mov     6(r5),r4
+loop:
+       mov     sp,r3
+       mov     formp(r5),r1
+2:
+       movb    (r1)+,r2
+       beq     2f
+       cmp     r2,$'%
+       beq     2f
+       movb    r2,(r3)+
+       br      2b
+2:
+       mov     r1,formp(r5)
+       cmp     r3,sp
+       beq     2f
+       mov     sp,r0
+       mov     8(r5),-(sp)
+       clr     -(sp)
+       mov     r3,-(sp)
+       sub     r0,(sp)
+       mov     r0,-(sp)
+       jsr     pc,__strout
+       add     $8,sp
+2:
+       tst     r2
+       bne     2f
+       jmp     cret
+2:
+       mov     sp,r3
+2:
+       clr     rjust(r5)
+       clr     ndigit(r5)
+       mov     $' ,zfill(r5)
+       cmpb    *formp(r5),$'-
+       bne     2f
+       inc     formp(r5)
+       inc     rjust(r5)
+2:
+       cmpb    *formp(r5),$'0
+       bne     2f
+       mov     $'0,zfill(r5)
+2:
+       jsr     r3,gnum
+       mov     r1,width(r5)
+       clr     ndfnd(r5)
+       cmp     r0,$'.
+       bne     1f
+       jsr     r3,gnum
+       mov     r1,ndigit(r5)
+1:
+       mov     $swtab,r1
+1:
+       mov     (r1)+,r2
+       bne     2f
+       movb    r0,(r3)+
+       jmp     prbuf
+2:
+       cmp     r0,(r1)+
+       bne     1b
+       jmp     (r2)
+       .data
+swtab:
+       decimal;        'd
+       octal;          'o
+       hex;            'x
+       float;          'f
+       scien;          'e
+       general;        'g
+       charac;         'c
+       string;         's
+       longorunsg;     'l
+       longorunsg;     'L
+       unsigned;       'u
+       remote;         'r
+       long;           'D
+       loct;           'O
+       lhex;           'X
+       lunsigned;      'U
+       0;  0
+       .text
+
+general:
+       mov     ndigit(r5),r0
+       mov     ndfnd(r5),r2
+       jsr     pc,pgen
+       jbr     prbuf
+
+longorunsg:
+       movb    *formp(r5),r0
+       inc     formp(r5)
+       cmp     r0,$'o
+       beq     loct
+       cmp     r0,$'x
+       beq     lhex
+       cmp     r0,$'d
+       beq     long
+       cmp     r0,$'u
+       beq     lunsigned
+       dec     formp(r5)
+       br      unsigned
+
+octal:
+       clr     r0
+       br      1f
+loct:
+       mov     (r4)+,r0
+1:
+       mov     $8.,r2
+       br      2f
+
+hex:
+       clr     r0
+       br      1f
+
+lhex:
+       mov     (r4)+,r0
+1:
+       mov     $16.,r2
+2:
+       mov     (r4)+,r1
+       br      compute
+
+decimal:
+       mov     (r4)+,r1
+       sxt     r0
+       bmi     3f
+       br      2f
+
+unsigned:
+       clr     r0
+       br      1f
+
+long:
+       mov     (r4)+,r0
+       bge     1f
+       mov     (r4)+,r1
+3:
+       neg     r0
+       neg     r1
+       sbc     r0
+       movb    $'-,(r3)+
+       br      2f
+
+lunsigned:
+       mov     (r4)+,r0
+1:
+       mov     (r4)+,r1
+2:
+       mov     $10.,r2
+
+/
+/ Algorithm courtesy Keith Davis
+/
+compute:
+       mov     r5,-(sp)
+       mov     r4,-(sp)
+       mov     r0,r4
+       mov     ndigit(r5),r0   / patch
+       mov     r1,r5
+       ashc    $0,r4
+       beq     1f
+/      tst     ndigit(r5)
+       tst     r0              / patch
+       beq     1f
+       movb    $'0,(r3)+
+1:
+       jsr     pc,1f
+       mov     (sp)+,r4
+       mov     (sp)+,r5
+       br      prbuf
+
+1:
+       clr     r0
+       mov     r4,r1
+       beq     2f
+       div     r2,r0
+       mov     r0,r4
+       mov     r1,r0
+2:
+       mov     r5,r1
+       asl     r2
+       div     r2,r0
+       asr     r2
+       asl     r0
+       cmp     r2,r1
+       bgt     2f
+       sub     r2,r1
+       inc     r0
+2:
+       mov     r1,-(sp)
+       mov     r0,r5
+       bne     2f
+       tst     r4
+       beq     1f
+2:
+       jsr     pc,1b
+1:
+       mov     (sp)+,r0
+       add     $'0,r0
+       cmp     r0,$'9
+       ble     1f
+       add     $'a-'0-10.,r0
+1:
+       movb    r0,(r3)+
+       rts     pc
+       
+charac:
+       movb    (r4)+,(r3)+
+       bne     1f
+       dec     r3
+1:
+       movb    (r4)+,(r3)+
+       bne     prbuf
+       dec     r3
+       br      prbuf
+
+string:
+       mov     ndigit(r5),r1
+       mov     (r4),r2
+       mov     r2,r3
+       bne     1f
+       mov     $nulstr,r2
+       mov     r2,r3
+       mov     r2,(r4)
+1:
+       tstb    (r2)+
+       beq     1f
+       inc     r3
+       sob     r1,1b
+1:
+       mov     (r4)+,r2
+       br      prstr
+
+float:
+       mov     ndigit(r5),r0
+       mov     ndfnd(r5),r2
+       jsr     pc,pfloat
+       br      prbuf
+
+scien:
+       mov     ndigit(r5),r0
+       inc     r0
+       tst     ndfnd(r5)
+       bne     1f
+       mov     $7,r0
+1:
+       mov     pc,r2
+       jsr     pc,pscien
+       br      prbuf
+
+remote:
+       mov     (r4)+,r4
+       mov     (r4)+,formp(r5)
+       jmp     loop
+
+prbuf:
+       mov     sp,r2
+prstr:
+       sub     r2,r3
+       mov     width(r5),r1
+       sub     r3,r1
+       bge     1f
+       clr     r1
+1:
+       tst     rjust(r5)
+       bne     1f
+       neg     r1
+1:
+       mov     zfill(r5),-(sp)
+       mov     8(r5),-(sp)
+       mov     r1,-(sp)
+       mov     r3,-(sp)
+       mov     r2,-(sp)
+       jsr     pc,__strout
+       add     $10.,sp
+       jmp     loop
+
+gnum:
+       clr     ndfnd(r5)
+       clr     r1
+1:
+       movb    *formp(r5),r0
+       inc     formp(r5)
+       sub     $'0,r0
+       cmp     r0,$'*-'0
+       bne     2f
+       mov     (r4)+,r0
+       br      3f
+2:
+       cmp     r0,$9.
+       bhi     1f
+3:
+       inc     ndfnd(r5)
+       mul     $10.,r1
+       add     r0,r1
+       br      1b
+1:
+       add     $'0,r0
+       rts     r3
+
+/.bss
+/width:        .=.+2
+/formp:        .=.+2
+/rjust:        .=.+2
+/ndfnd:        .=.+2
+/ndigit:       .=.+2
+/zfill:        .=.+2
+.data
+nulstr:
+       <(null)\0>
diff --git a/src/ex/ex_vars.lisp b/src/ex/ex_vars.lisp
new file mode 100644 (file)
index 0000000..5c2809c
--- /dev/null
@@ -0,0 +1,33 @@
+#define AUTOINDENT      0
+#define AUTOPRINT       1
+#define BEAUTIFY        2
+#define DIRECTORY       3
+#define ERRORBELLS      4
+#define IGNORECASE      5
+#define LISP            6
+#define LIST            7
+#define MAGIC           8
+#define NUMBER          9
+#define OPEN            10
+#define OPTIMIZE        11
+#define PARAGRAPHS      12
+#define PROMPT          13
+#define REDRAW          14
+#define REPORT          15
+#define SCROLL          16
+#define SECTIONS        17
+#define SHELL           18
+#define SHIFTWIDTH      19
+#define SHOWMATCH       20
+#define SLOWOPEN        21
+#define TABSTOP         22
+#define TTYTYPE         23
+#define TERM            24
+#define TERSE           25
+#define WARN            26
+#define WINDOW          27
+#define WRAPSCAN        28
+#define WRAPMARGIN      29
+#define WRITEANY        30
+
+#define        NOPTS   31
diff --git a/src/ex/ex_vars.nolisp b/src/ex/ex_vars.nolisp
new file mode 100644 (file)
index 0000000..cad5085
--- /dev/null
@@ -0,0 +1,31 @@
+#define AUTOINDENT      0
+#define AUTOPRINT       1
+#define BEAUTIFY        2
+#define DIRECTORY       3
+#define ERRORBELLS      4
+#define IGNORECASE      5
+#define LIST            6
+#define MAGIC           7
+#define NUMBER          8
+#define OPEN            9
+#define OPTIMIZE        10
+#define PARAGRAPHS      11
+#define PROMPT          12
+#define REDRAW          13
+#define REPORT          14
+#define SCROLL          15
+#define SECTIONS        16
+#define SHELL           17
+#define SHIFTWIDTH      18
+#define SLOWOPEN        19
+#define TABSTOP         20
+#define TTYTYPE         21
+#define TERM            22
+#define TERSE           23
+#define WARN            24
+#define WINDOW          25
+#define WRAPSCAN        26
+#define WRAPMARGIN      27
+#define WRITEANY        28
+
+#define        NOPTS   29
diff --git a/src/ex/make.script b/src/ex/make.script
new file mode 100644 (file)
index 0000000..6bc040a
--- /dev/null
@@ -0,0 +1,148 @@
+/usr/ucb/mkstr - ex2.0strings x ex.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex.c | /usr/ucb/xstr -c -
+rm -f xex.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex.o
+/usr/ucb/mkstr - ex2.0strings x ex_addr.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_addr.c | /usr/ucb/xstr -c -
+rm -f xex_addr.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_addr.o
+/usr/ucb/mkstr - ex2.0strings x ex_cmds.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_cmds.c | /usr/ucb/xstr -c -
+rm -f xex_cmds.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_cmds.o
+/usr/ucb/mkstr - ex2.0strings x ex_cmds2.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_cmds2.c | /usr/ucb/xstr -c -
+rm -f xex_cmds2.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_cmds2.o
+/usr/ucb/mkstr - ex2.0strings x ex_cmdsub.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_cmdsub.c | /usr/ucb/xstr -c -
+rm -f xex_cmdsub.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_cmdsub.o
+/usr/ucb/mkstr - ex2.0strings x ex_data.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_data.c | /usr/ucb/xstr -c -
+rm -f xex_data.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_data.o
+/usr/ucb/mkstr - ex2.0strings x ex_get.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_get.c | /usr/ucb/xstr -c -
+rm -f xex_get.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_get.o
+/usr/ucb/mkstr - ex2.0strings x ex_io.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_io.c | /usr/ucb/xstr -c -
+rm -f xex_io.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_io.o
+/usr/ucb/mkstr - ex2.0strings x ex_put.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_put.c | /usr/ucb/xstr -c -
+rm -f xex_put.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_put.o
+/usr/ucb/mkstr - ex2.0strings x ex_re.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_re.c | /usr/ucb/xstr -c -
+rm -f xex_re.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_re.o
+/usr/ucb/mkstr - ex2.0strings x ex_set.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_set.c | /usr/ucb/xstr -c -
+rm -f xex_set.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_set.o
+/usr/ucb/mkstr - ex2.0strings x ex_subr.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_subr.c | /usr/ucb/xstr -c -
+rm -f xex_subr.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_subr.o
+/usr/ucb/mkstr - ex2.0strings x ex_temp.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_temp.c | /usr/ucb/xstr -c -
+rm -f xex_temp.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_temp.o
+/usr/ucb/mkstr - ex2.0strings x ex_tty.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_tty.c | /usr/ucb/xstr -c -
+rm -f xex_tty.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_tty.o
+/usr/ucb/mkstr - ex2.0strings x ex_v.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_v.c | /usr/ucb/xstr -c -
+rm -f xex_v.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_v.o
+/usr/ucb/mkstr - ex2.0strings x ex_vadj.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vadj.c | /usr/ucb/xstr -c -
+rm -f xex_vadj.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vadj.o
+/usr/ucb/mkstr - ex2.0strings x ex_vget.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vget.c | /usr/ucb/xstr -c -
+rm -f xex_vget.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vget.o
+/usr/ucb/mkstr - ex2.0strings x ex_vmain.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vmain.c | /usr/ucb/xstr -c -
+rm -f xex_vmain.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vmain.o
+/usr/ucb/mkstr - ex2.0strings x ex_voperate.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_voperate.c | /usr/ucb/xstr -c -
+rm -f xex_voperate.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_voperate.o
+/usr/ucb/mkstr - ex2.0strings x ex_vops.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vops.c | /usr/ucb/xstr -c -
+rm -f xex_vops.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vops.o
+/usr/ucb/mkstr - ex2.0strings x ex_vops2.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vops2.c | /usr/ucb/xstr -c -
+rm -f xex_vops2.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vops2.o
+/usr/ucb/mkstr - ex2.0strings x ex_vops3.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vops3.c | /usr/ucb/xstr -c -
+rm -f xex_vops3.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vops3.o
+/usr/ucb/mkstr - ex2.0strings x ex_vput.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vput.c | /usr/ucb/xstr -c -
+rm -f xex_vput.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vput.o
+/usr/ucb/mkstr - ex2.0strings x ex_vwind.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL xex_vwind.c | /usr/ucb/xstr -c -
+rm -f xex_vwind.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o ex_vwind.o
+/usr/ucb/mkstr - ex2.0strings x 11printf.c
+cc -E -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL x11printf.c | /usr/ucb/xstr -c -
+rm -f x11printf.c
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -O -c x.c 
+mv x.o 11printf.o
+/usr/ucb/xstr
+cc -c xs.c
+mv xs.o strings.o
+/usr/ucb/ctags ex.c ex_*.c
+cc -i 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_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o  ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o  11printf.o strings.o -ltermlib -lretro -lS
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -c -O exrecover.c
+cc -o exrecover exrecover.o -lretro -lS
+cc -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL -c expreserve.c
+cc -o expreserve expreserve.o -lretro -lS
+mkdir /usr/preserve
+cp exrecover /usr/lib/ex2.0recover
+cp expreserve /usr/lib/ex2.0preserve
+chown root /usr/lib/ex2.0recover /usr/lib/ex2.0preserve
+chmod 4755 /usr/lib/ex2.0recover
+chmod 4755 /usr/lib/ex2.0preserve
+chmod 755 /usr/ucb/ex
+/usr/ucb/ex </dev/null
+rm -f /usr/ucb/ex /usr/ucb/edit //usr/ucb/vi
+cp a.out /usr/ucb/ex
+ln /usr/ucb/ex /usr/ucb/edit
+ln /usr/ucb/ex /usr/ucb/vi
+cp ex2.0strings /usr/lib/ex2.0strings
+chmod 1755 /usr/ucb/ex
diff --git a/src/ex/makefile.v6 b/src/ex/makefile.v6
new file mode 100644 (file)
index 0000000..453f8a0
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# Ex skeletal makefile for version 6
+#
+# NB: This makefile doesn't indicate any dependencies on header files.
+#
+# Compiles in both the LISP code and (the undocumented) chdir
+# command within the editor; take these out of CFLAGS to make some
+# breathing room in the text space if necessary.  If you take out -DLISP
+# you should move ex_vars.nolisp to ex_vars.h
+#
+# If your system expands tabs to 4 spaces you should -DTABS=4 below
+#
+# Ex is likely to overflow the symbol table in your C compiler, so
+# it uses -t0 which is (purportedly) a C compiler with a larger
+# symbol table.  -t1 compiles switches into instructions making larger
+# text, but saving data space.
+#
+# Ex wants stdio only to get the doprnt.o routine; if other stdio stuff
+# gets dragged in that is a mistake.
+#
+.c.o:
+       ${MKSTR} - ex2.0strings x $*.c
+       ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
+       rm -f x$*.c
+       ${CC} ${CFLAGS} -O -c x.c 
+       mv x.o $*.o
+BINDIR=        /usr/ucb
+LIBDIR=        /usr/lib
+FOLD=  /usr/ucb/fold
+CTAGS= /usr/ucb/ctags
+AS=    -as
+XSTR=  /usr/ucb/xstr
+CFLAGS=        -DTABS=8 -I/usr/include/retrofit -t0 -t1 -DV6 -DLISP -DCHDIR -DUCVISUAL
+MKSTR= /usr/ucb/mkstr
+CXREF= /usr/ucb/cxref
+INCLUDE=/usr/include/retrofit
+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_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
+       ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
+       11printf.o strings.o
+
+all: a.out expreserve exrecover
+
+a.out: ${OBJS} tags
+       ${CC} -i ${OBJS} -ltermlib -lretro -lS
+
+tags:
+       ${CTAGS} ex.c ex_*.c
+
+strings.o: strings
+       ${XSTR}
+       ${CC} -c xs.c
+       mv xs.o strings.o
+       
+exrecover: exrecover.o
+       ${CC} -o exrecover exrecover.o -lretro -lS
+
+exrecover.o:
+       ${CC} ${CFLAGS} -c -O exrecover.c
+
+expreserve: expreserve.o
+       ${CC} -o expreserve expreserve.o -lretro -lS
+
+expreserve.o:
+       ${CC} ${CFLAGS} -c expreserve.c
+
+clean:
+       rm a.out exrecover expreserve ex2.0strings strings errs core trace
+       -rm *.o x*.[cs]
+
+install: a.out installutil
+       -chmod 755 ${BINDIR}/ex
+       -${BINDIR}/ex </dev/null
+       -rm -f ${BINDIR}/ex ${BINDIR}/edit /${BINDIR}/vi
+       cp a.out ${BINDIR}/ex
+       ln ${BINDIR}/ex ${BINDIR}/edit
+       ln ${BINDIR}/ex ${BINDIR}/vi
+       cp ex2.0strings ${LIBDIR}/ex2.0strings
+       chmod 1755 ${BINDIR}/ex
+
+installutil: exrecover expreserve
+       mkdir /usr/preserve
+       cp exrecover ${LIBDIR}/ex2.0recover
+       cp expreserve ${LIBDIR}/ex2.0preserve
+       chown root ${LIBDIR}/ex2.0recover ${LIBDIR}/ex2.0preserve
+       chmod 4755 ${LIBDIR}/ex2.0recover
+       chmod 4755 ${LIBDIR}/ex2.0preserve
+
+lint:
+       lint ex.c ex_?*.c
+       lint -u exrecover.c
+       lint expreserve.c
+
+print:
+       @-rm x.c xs.c >/dev/null
+       @${PR} READ* BUGS
+       @${PR} make*
+       @(size -l a.out ; size *.o) | ${PR} -h sizes
+       @${PR} termcap
+       @${PR} -h errno.h ${INCLUDE}/errno.h
+       @${PR} -h pwd.h ${INCLUDE}/pwd.h
+       @${PR} -h setjmp.h ${INCLUDE}/setjmp.h
+       @${PR} -h sgtty.h ${INCLUDE}/sgtty.h
+       @${PR} -h signal.h ${INCLUDE}/signal.h
+       @${PR} -h sys/dir.h ${INCLUDE}/sys/dir.h
+       @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
+       @${PR} -h sys/types.h ${INCLUDE}/sys/types.h
+       @ls -ls | ${PR}
+       @${CXREF} *.c | ${PR} -h XREF
+       @${PR} *.h *.c
diff --git a/src/ex/makeoptions b/src/ex/makeoptions
new file mode 100755 (executable)
index 0000000..84d2639
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# remake options -- this isn't necessary unless you add/delete options
+#
+       onintr ifintr
+       cp ex_data.c /tmp/$$.c
+       ex - /tmp/$$.c <<'%'
+               g/^#include/d
+               w
+               q
+'%'
+       cc -E $* /tmp/$$.c >/tmp/foo.c
+       ex - /tmp/foo.c <<'X'
+               g/^# /d
+               set sh=/bin/csh
+               g/^[    ]*$/d
+               1,/options/d
+               /}/-1,$d
+               1,$s/   "//
+               1,$s/".*//
+               1m$
+               w! ex_vars.h
+               !rm -f %; num ex_vars.h >%
+               e
+               $t0
+               1s/......../     0  /
+               1,$s/\(......\)\(.*\)/#define   \U\2\L  \1/
+               1,$s/    */     /g
+               g/  */s//       /g
+               w
+               !rm -f ex_vars.h; expand -8,24 % >ex_vars.h
+               e! ex_vars.h
+               $i
+
+.
+               $s/e[   ].*[    ]/e     NOPTS   /
+               w
+               q
+'X'
+ifintr:
+       rm /tmp/foo.c