diff --git a/scripts/generate_header.sh b/scripts/generate_header.sh index 469d4dbf..c4789e15 100755 --- a/scripts/generate_header.sh +++ b/scripts/generate_header.sh @@ -66,6 +66,9 @@ decl_export() { uncomment $1 | onelineize | export_sym } +print_self() { + cat "$0" | sed -e 's#^#// #' +} generate_header() { local LUA_PATH="$1" @@ -83,10 +86,10 @@ generate_header() { echo "In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!" echo "Due to the way the API is structured, you *should not* link or include lua libraries." echo "This file was automatically generated by the below code. DO NOT MODIFY DIRECTLY." - echo - echo - cat "$0" echo "**/" + echo + print_self + echo echo "#include " decl "$LUA_PATH/lua.h" @@ -112,7 +115,10 @@ generate_api_require() { echo "returns a function pointer with it's corresponding name." echo echo "This file is automatically generated. DO NOT MODIFY." - echo "*/" + echo "**/" + echo + print_self + echo echo "#include " echo "#include " echo '#include "lua.h"'