mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-05 16:32:58 +00:00
interpreters: add Lua support
This commit is contained in:
parent
282e44e3e0
commit
87df63d367
9 changed files with 367 additions and 0 deletions
36
interpreters/lua/Module.mk
Normal file
36
interpreters/lua/Module.mk
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
############################################################################
|
||||
# apps/interpreters/lua/Module.mk
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
LUAMOD_REGISTRY = $(APPDIR)$(DELIM)interpreters$(DELIM)lua$(DELIM)registry
|
||||
|
||||
define LUAMOD_REGISTER
|
||||
$(Q) echo Register Lua Module: $1
|
||||
$(Q) echo { \"$1\", $2 }, > "$(LUAMOD_REGISTRY)$(DELIM)$1.bdat"
|
||||
$(Q) echo "int $2(lua_State *L);" > "$(LUAMOD_REGISTRY)$(DELIM)$1.pdat"
|
||||
$(Q) touch "$(LUAMOD_REGISTRY)$(DELIM).updated"
|
||||
endef
|
||||
|
||||
ifneq ($(LUAMODNAME),)
|
||||
LUAMODLIST := $(addprefix $(LUAMOD_REGISTRY)$(DELIM),$(addsuffix .bdat,$(LUAMODNAME)))
|
||||
$(LUAMODLIST): $(DEPCONFIG) Makefile
|
||||
$(call LUAMOD_REGISTER,$(LUAMODNAME),luaopen_$(LUAMODNAME))
|
||||
|
||||
register:: $(LUAMODLIST)
|
||||
endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue