/[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 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  ###############################################################################  ###############################################################################
3  #  #
4  #  Copyright (C) 2005  Anders Gavare.  All rights reserved.  #  Copyright (C) 2005-2007  Anders Gavare.  All rights reserved.
5  #  #
6  #  Redistribution and use in source and binary forms, with or without  #  Redistribution and use in source and binary forms, with or without
7  #  modification, are permitted provided that the following conditions are met:  #  modification, are permitted provided that the following conditions are met:
# 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.8 2007/06/15 18:13:04 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 "5"
42          B=`echo $a|cut -c5-|sed s/\\\\.o//g`  rm -f .index
43          if grep devinit_$B dev_$B.c > /dev/null; then  for a in *.c; do
44                  printf "int devinit_$B(struct devinit *);\n" >> autodev.c          B=`grep COMMENT $a`
45            if [ z"$B" != z ]; then
46                    printf "$a " >> .index
47                    echo "$B"|cut -d : -f 2- >> .index
48            fi
49    done
50    
51    printf "4"
52    for a in dev_*.c; do
53            B=`grep DEVINIT $a`
54            if [ z"$B" != z ]; then
55                    C=`grep DEVINIT $a | cut -d \( -f 2|cut -d \) -f 1`
56                    for B in $C; do
57                            printf "int devinit_$B(struct devinit *);\n" >> autodev.c
58                    done
59            fi
60    done
61    
62    printf "3"
63    for a in bus_pci.c; do
64            B=`grep PCIINIT $a`
65            if [ z"$B" != z ]; then
66                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
67                    for B in $C; do
68                            printf "void pciinit_$B(struct machine *, " >> autodev.c
69                            printf "struct memory *, struct pci_device *);\n" >> autodev.c
70                    done
71          fi          fi
72  done  done
73    
74  cat autodev_middle.c >> autodev.c  cat autodev_middle.c >> autodev.c
75    
76  for a in `echo dev_*.o`; do  printf "2"
77          B=`echo $a|cut -c5-|sed s/\\\\.o//g`  for a in dev_*.c; do
78          if grep devinit_$B dev_$B.c > /dev/null; then          B=`grep DEVINIT $a`
79                  printf "\tdevice_register(\""$B"\"," >> autodev.c          if [ z"$B" != z ]; then
80                  printf " devinit_$B);\n" >> autodev.c                  C=`grep DEVINIT $a | cut -d \( -f 2|cut -d \) -f 1`
81                    for B in $C; do
82                            printf "\tdevice_register(\""$B"\"," >> autodev.c
83                            printf " devinit_$B);\n" >> autodev.c
84                    done
85            fi
86    done
87    
88    printf "1"
89    for a in bus_pci.c; do
90            B=`grep PCIINIT $a`
91            if [ z"$B" != z ]; then
92                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
93                    for B in $C; do
94                            printf "\tpci_register(\""$B"\"," >> autodev.c
95                            printf " pciinit_$B);\n" >> autodev.c
96                    done
97          fi          fi
98  done  done
99    
100  cat autodev_tail.c >> autodev.c  cat autodev_tail.c >> autodev.c
101    
102  printf "done\n"  printf " done\n"

Legend:
Removed from v.4  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26