vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

AUTOGEN (3595B)


      1 #!/bin/sh
      2 
      3 # Most of the kernel and library files come in virtually unchanged.
      4 # Rather than maintain the few changes by hand, we keep a set
      5 # of ed scripts that we can run on the originals to produce 
      6 # the versions we need.
      7 #
      8 # This directory also contains a few files that aren't 
      9 # autogenerated, but are extracted from elsewhere and 
     10 # would distract from vxplan9 itself if placed in the main
     11 # directory (utf.[ch], fmt.[ch], latin1.h, arg.h).
     12 
     13 autofiles="
     14 /386/include/ureg.h
     15 /sys/include/a.out.h
     16 /sys/include/authsrv.h
     17 /sys/include/cursor.h
     18 /sys/include/draw.h
     19 /sys/include/fcall.h
     20 /sys/include/ip.h
     21 /sys/include/keyboard.h
     22 /sys/include/libsec.h
     23 /sys/include/memdraw.h
     24 /sys/include/memlayer.h
     25 /sys/include/mouse.h
     26 /sys/include/tos.h
     27 /sys/include/trace.h
     28 /sys/src/9/pc/dat.h
     29 /sys/src/9/pc/devether.c
     30 /sys/src/9/pc/etherif.h
     31 /sys/src/9/pc/fns.h
     32 /sys/src/9/pc/io.h
     33 /sys/src/9/pc/mem.h
     34 /sys/src/9/pc/sdscsi.c
     35 /sys/src/9/port/allocb.c
     36 #/sys/src/9/port/aoe.h
     37 /sys/src/9/port/auth.c
     38 /sys/src/9/port/chan.c
     39 /sys/src/9/port/dev.c
     40 #/sys/src/9/port/devaoe.c
     41 /sys/src/9/port/devcap.c
     42 /sys/src/9/port/devcons.c
     43 /sys/src/9/port/devdraw.c
     44 /sys/src/9/port/devdup.c
     45 /sys/src/9/port/devenv.c
     46 /sys/src/9/port/devmnt.c
     47 /sys/src/9/port/devpipe.c
     48 /sys/src/9/port/devproc.c
     49 /sys/src/9/port/devroot.c
     50 /sys/src/9/port/devsd.c
     51 /sys/src/9/port/devssl.c
     52 /sys/src/9/port/devsrv.c
     53 /sys/src/9/port/devtls.c
     54 /sys/src/9/port/error.h
     55 /sys/src/9/port/fault.c
     56 /sys/src/9/port/latin1.c
     57 /sys/src/9/port/lib.h
     58 /sys/src/9/port/netif.c
     59 /sys/src/9/port/netif.h
     60 /sys/src/9/port/page.c
     61 /sys/src/9/port/parse.c
     62 /sys/src/9/port/pgrp.c
     63 /sys/src/9/port/portdat.h
     64 /sys/src/9/port/portfns.h
     65 /sys/src/9/port/print.c
     66 /sys/src/9/port/proc.c
     67 /sys/src/9/port/qio.c
     68 /sys/src/9/port/qlock.c
     69 /sys/src/9/port/sd.h
     70 #/sys/src/9/port/sdaoe.c
     71 /sys/src/9/port/segment.c
     72 /sys/src/9/port/swap.c
     73 /sys/src/9/port/sysfile.c
     74 /sys/src/9/port/sysproc.c
     75 /sys/src/9/port/systab.h
     76 /sys/src/9/port/thwack.c
     77 /sys/src/9/port/thwack.h
     78 /sys/src/libc/port/u16.c
     79 /sys/src/libc/port/u32.c
     80 /sys/src/9/port/unthwack.c
     81 /sys/src/boot/pc/fs.h
     82 /sys/src/boot/pc/dosfs.h
     83 /sys/src/boot/pc/kfs.h
     84 /sys/src/boot/pc/part.c
     85 /sys/src/libc/9syscall/sys.h
     86 /sys/src/libc/9sys/convD2M.c
     87 /sys/src/libc/9sys/convM2D.c
     88 /sys/src/libc/9sys/convM2S.c
     89 /sys/src/libc/9sys/convS2M.c
     90 /sys/src/libc/9sys/fcallfmt.c
     91 /sys/src/libc/port/cleanname.c
     92 /sys/src/libc/port/encodefmt.c
     93 /sys/src/libc/port/getfields.c
     94 /sys/src/libc/port/strecpy.c
     95 /sys/src/libc/port/tokenize.c
     96 /sys/src/libc/port/u64.c
     97 /sys/src/libip/bo.c
     98 /sys/src/libip/classmask.c
     99 /sys/src/libip/eipfmt.c
    100 /sys/src/libip/ipaux.c
    101 /sys/src/libip/parseip.c
    102 "
    103 
    104 plan9=/usr/local/9vx
    105 if [ $# -gt 1 ] && [ $1 == "-r" ]; then
    106 	plan9=`ls -d $2` || exit 1
    107 	shift 2
    108 fi
    109 
    110 case "$#" in
    111 0)
    112 	;;
    113 *)
    114 	autofiles="$*"
    115 esac
    116 
    117 errors=0
    118 
    119 for f in $autofiles
    120 do
    121 	in=`echo $plan9$f | sed 's;//;/;'`
    122 	out=`echo $f | sed 's;.*/;;;'`
    123 	ed=`echo $f | sed 's;.*/;;; s;$;.ed;'`
    124 	test -f $ed || ed=`echo $ed | sed 's;\.[ch]\.ed$;.ed;'`
    125 	if test -f $in; then
    126 		echo -n $f '->' $out
    127 		test -f $ed && echo ' ('$ed')' || echo
    128 		test -f $out && chmod +w $out
    129 		(
    130 			echo ',s;"../ip/;"ip/;g'
    131 			echo ',s;"../port/;";g'
    132 			echo ',s;#include.*<;#include ";g'
    133 			echo ',s;#include.*>;&FIXINCLUDEME;g'
    134 			echo ',s;>FIXINCLUDEME;";g'
    135 			echo ',s;"libc.h";"lib.h";g'
    136 			echo ',s;SET(\(.*\));;g'
    137 			echo 'g/#pragma/d'
    138 			test -f $ed && cat $ed
    139 			echo w $out
    140 			echo q
    141 		) | ed -s $in 2>&1 | egrep -v '^[0-9?]+$'
    142 	else
    143 		echo "ERROR: $in not found" 1>&2
    144 		errors=`echo $errors + 1 | bc`
    145 	fi
    146 done
    147 
    148 test $errors -gt 0 && echo -n $errors error &&
    149 	(test $errors -gt 1 && echo s || echo)
    150 exit 0