mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
interpreters: lua: replace awk command with shell script
This commit is contained in:
parent
d364d7a810
commit
4043522daf
1 changed files with 5 additions and 3 deletions
|
|
@ -84,9 +84,11 @@ CSRCS += $(CORELIBS_SRCS)
|
|||
|
||||
register::
|
||||
# collect core module names from defines in lualib.h
|
||||
$(Q) awk '{ if (match($$0,/LUA_[A-Z]+LIBNAME\s"([a-z]+)"$$/,m)) \
|
||||
printf "{ \"%s\", luaopen_%s },\n", m[1], m[1] > "registry$(DELIM)"m[1]".bdat" }' \
|
||||
$(LUA_SRC)$(DELIM)lualib.h
|
||||
$(Q) while read -r line; do \
|
||||
name=$$(expr "$$line" : '#define LUA_[[:upper:]]\+LIBNAME[[:space:]]\+"\([[:lower:]]\+\)"'); \
|
||||
if [ ! -z $$name ]; then \
|
||||
printf '{ "%s", luaopen_%s },\n' $$name $$name > registry$(DELIM)$$name.bdat; \
|
||||
fi done < $(LUA_SRC)$(DELIM)lualib.h
|
||||
endif
|
||||
|
||||
# Lua builtin module registry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue