4 # The first argument is the output filename.
11 # The second argument is the directory in which the source files live.
17 # All subsequent arguments are the files to scan.
20 echo '/* Do not modify this file. */' >${outfile}-tmp
21 echo '/* It is created automatically by the Makefile. */'>>${outfile}-tmp
22 echo '#include "register.h"' >>${outfile}-tmp
25 # Build code to call all the protocol registration routines.
27 echo 'void register_all_protocols(void) {' >>${outfile}-tmp
36 grep '^proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
37 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
46 grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
47 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
48 echo '}' >>${outfile}-tmp
51 # Build code to call all the protocol handoff registration routines.
53 echo 'void register_all_protocol_handoffs(void) {' >>${outfile}-tmp
62 grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
63 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
72 grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
73 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
74 echo '}' >>${outfile}-tmp
75 mv ${outfile}-tmp ${outfile}