From ead8b80cb9606d83c1f2a8d6b5c4958c2bb95e42 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 23 Jun 2020 08:45:20 +0200 Subject: [PATCH] examples/lua*: adapt to the blob mechanism --- examples/lua_REPL/Makefile | 23 +---------------------- examples/lua_REPL/main.c | 2 +- examples/lua_basic/Makefile | 23 +---------------------- examples/lua_basic/main.c | 2 +- 4 files changed, 4 insertions(+), 46 deletions(-) diff --git a/examples/lua_REPL/Makefile b/examples/lua_REPL/Makefile index abf99eb8ac..4aab7dff84 100644 --- a/examples/lua_REPL/Makefile +++ b/examples/lua_REPL/Makefile @@ -25,28 +25,7 @@ CFLAGS += -DTHREAD_STACKSIZE_MAIN='(THREAD_STACKSIZE_DEFAULT+7000)' USEPKG += lua -LUA_PATH = $(BINDIR)/lua - -# add directory of generated *.lua.h files to include path -CFLAGS += -I$(LUA_PATH) - # generate .lua.h header files of .lua files -LUA = $(wildcard *.lua) - -LUA_H = $(LUA:%.lua=$(LUA_PATH)/%.lua.h) - -BUILDDEPS += $(LUA_H) $(LUA_PATH)/ +BLOBS += $(wildcard *.lua) include $(RIOTBASE)/Makefile.include - -# The code below generates a header file from any .lua scripts in the -# example directory. The header file contains a byte array of the -# ASCII characters in the .lua script. - -$(LUA_PATH)/: - $(Q)mkdir -p $@ - -# FIXME: This way of embedding lua code is not robust. A proper script will -# be included later. -$(LUA_H): $(LUA_PATH)/%.lua.h: %.lua | $(LUA_PATH)/ - $(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@ diff --git a/examples/lua_REPL/main.c b/examples/lua_REPL/main.c index 558b5af814..c24eaa8b5f 100644 --- a/examples/lua_REPL/main.c +++ b/examples/lua_REPL/main.c @@ -23,7 +23,7 @@ #include "lua_run.h" #include "lua_builtin.h" -#include "repl.lua.h" +#include "blob/repl.lua.h" /* The basic interpreter+repl needs about 13k ram AT Minimum but we need more * memory in order to do interesting stuff. diff --git a/examples/lua_basic/Makefile b/examples/lua_basic/Makefile index 05361d8236..8395759403 100644 --- a/examples/lua_basic/Makefile +++ b/examples/lua_basic/Makefile @@ -22,28 +22,7 @@ endif USEPKG += lua -LUA_PATH = $(BINDIR)/lua - -# add directory of generated *.lua.h files to include path -CFLAGS += -I$(LUA_PATH) - # generate .lua.h header files of .lua files -LUA = $(wildcard *.lua) - -LUA_H = $(LUA:%.lua=$(LUA_PATH)/%.lua.h) - -BUILDDEPS += $(LUA_H) $(LUA_PATH)/ +BLOBS += $(wildcard *.lua) include $(RIOTBASE)/Makefile.include - -# The code below generates a header file from any .lua scripts in the -# example directory. The header file contains a byte array of the -# ASCII characters in the .lua script. - -$(LUA_PATH)/: - $(Q)mkdir -p $@ - -# FIXME: This way of embedding lua code is not robust. A proper script will -# be included later. -$(LUA_H): $(LUA_PATH)/%.lua.h: %.lua | $(LUA_PATH)/ - $(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@ diff --git a/examples/lua_basic/main.c b/examples/lua_basic/main.c index 0763ab4dae..5d71fbca9f 100644 --- a/examples/lua_basic/main.c +++ b/examples/lua_basic/main.c @@ -25,7 +25,7 @@ #include "lualib.h" #include "lua_run.h" -#include "main.lua.h" +#include "blob/main.lua.h" #define LUA_MEM_SIZE (11000) static char lua_mem[LUA_MEM_SIZE] __attribute__ ((aligned(__BIGGEST_ALIGNMENT__)));