interpreters: lua: replace awk command with shell script
This commit is contained in:
parent
d364d7a810
commit
4043522daf
@ -84,9 +84,11 @@ CSRCS += $(CORELIBS_SRCS)
|
|||||||
|
|
||||||
register::
|
register::
|
||||||
# collect core module names from defines in lualib.h
|
# collect core module names from defines in lualib.h
|
||||||
$(Q) awk '{ if (match($$0,/LUA_[A-Z]+LIBNAME\s"([a-z]+)"$$/,m)) \
|
$(Q) while read -r line; do \
|
||||||
printf "{ \"%s\", luaopen_%s },\n", m[1], m[1] > "registry$(DELIM)"m[1]".bdat" }' \
|
name=$$(expr "$$line" : '#define LUA_[[:upper:]]\+LIBNAME[[:space:]]\+"\([[:lower:]]\+\)"'); \
|
||||||
$(LUA_SRC)$(DELIM)lualib.h
|
if [ ! -z $$name ]; then \
|
||||||
|
printf '{ "%s", luaopen_%s },\n' $$name $$name > registry$(DELIM)$$name.bdat; \
|
||||||
|
fi done < $(LUA_SRC)$(DELIM)lualib.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Lua builtin module registry
|
# Lua builtin module registry
|
||||||
|
Loading…
Reference in New Issue
Block a user