nuclear@10: #!/bin/sh nuclear@10: nuclear@10: gen_module_init() nuclear@10: { nuclear@10: # collect all src/file_whatever.c files nuclear@10: modules=`ls src/file_*.c 2>/dev/null | sort | sed 's/src\/file_//' | sed 's/\.c//'` nuclear@10: nuclear@10: echo "/* this file is generated by $0, do not edit */" nuclear@10: for m in $modules; do nuclear@10: echo "int img_register_$m();" nuclear@10: done nuclear@10: nuclear@10: echo nuclear@10: echo 'void img_modules_init(void)' nuclear@10: echo '{' nuclear@10: nuclear@10: for m in $modules; do nuclear@10: echo " img_register_$m();" nuclear@10: done nuclear@10: nuclear@10: echo '}' nuclear@10: } nuclear@10: nuclear@10: gen_module_init >src/modules.c nuclear@10: nuclear@10: echo 'PREFIX = /usr/local' >Makefile nuclear@10: cat Makefile.in >>Makefile