/[gxemul]/trunk/src/devices/makeautodev.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/makeautodev.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 19 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 27  Line 27 
27  #  SUCH DAMAGE.  #  SUCH DAMAGE.
28  #  #
29  #  #
30  #  $Id: makeautodev.sh,v 1.2 2005/02/22 13:23:43 debug Exp $  #  $Id: makeautodev.sh,v 1.5 2005/11/09 06:35:45 debug Exp $
31    
32    
33  printf "Generating autodev.c... "  printf "Generating autodev.c... "
34    
# Line 37  printf "/*\n *  DO NOT EDIT. AUTOMATICAL Line 38  printf "/*\n *  DO NOT EDIT. AUTOMATICAL
38    
39  cat autodev_head.c >> autodev.c  cat autodev_head.c >> autodev.c
40    
41  for a in `echo dev_*.o`; do  printf "4"
42    for a in dev_*.o; do
43          B=`echo $a|cut -c5-|sed s/\\\\.o//g`          B=`echo $a|cut -c5-|sed s/\\\\.o//g`
44          if grep devinit_$B dev_$B.c > /dev/null; then          if grep devinit_$B dev_$B.c > /dev/null; then
45                  printf "int devinit_$B(struct devinit *);\n" >> autodev.c                  printf "int devinit_$B(struct devinit *);\n" >> autodev.c
46          fi          fi
47  done  done
48    
49    printf "3"
50    for a in bus_pci.c; do
51            B=`grep PCIINIT $a`
52            if [ z"$B" != z ]; then
53                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
54                    for B in $C; do
55                            printf "void pciinit_$B(struct machine *, " >> autodev.c
56                            printf "struct memory *, struct pci_device *);\n" >> autodev.c
57                    done
58            fi
59    done
60    
61  cat autodev_middle.c >> autodev.c  cat autodev_middle.c >> autodev.c
62    
63  for a in `echo dev_*.o`; do  printf "2"
64    for a in dev_*.o; do
65          B=`echo $a|cut -c5-|sed s/\\\\.o//g`          B=`echo $a|cut -c5-|sed s/\\\\.o//g`
66          if grep devinit_$B dev_$B.c > /dev/null; then          if grep devinit_$B dev_$B.c > /dev/null; then
67                  printf "\tdevice_register(\""$B"\"," >> autodev.c                  printf "\tdevice_register(\""$B"\"," >> autodev.c
# Line 54  for a in `echo dev_*.o`; do Line 69  for a in `echo dev_*.o`; do
69          fi          fi
70  done  done
71    
72    printf "1"
73    for a in bus_pci.c; do
74            B=`grep PCIINIT $a`
75            if [ z"$B" != z ]; then
76                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
77                    for B in $C; do
78                            printf "\tpci_register(\""$B"\"," >> autodev.c
79                            printf " pciinit_$B);\n" >> autodev.c
80                    done
81            fi
82    done
83    
84  cat autodev_tail.c >> autodev.c  cat autodev_tail.c >> autodev.c
85    
86  printf "done\n"  printf " done\n"

Legend:
Removed from v.19  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26