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