Skip to content
Snippets Groups Projects
Commit 16261a2f authored by Juan Carrano's avatar Juan Carrano
Browse files

examples/lua_REPL: Correctly declare dependency on script files.

Custom targets should be added to BUILDDEPS. Without this patch
`make -j clean all" fails because of weird race condition (trying
to clean while building is kind of contradictory anyways.)
parent 79b0a550
No related branches found
No related tags found
No related merge requests found
......@@ -51,13 +51,7 @@ CFLAGS += -DTHREAD_STACKSIZE_MAIN='(THREAD_STACKSIZE_DEFAULT+7000)'
USEPKG += 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 := $(BINDIR)/lua
LUA_PATH = $(BINDIR)/lua
# add directory of generated *.lua.h files to include path
CFLAGS += -I$(LUA_PATH)
......@@ -65,16 +59,20 @@ CFLAGS += -I$(LUA_PATH)
# generate .lua.h header files of .lua files
LUA = $(wildcard *.lua)
LUA_H := $(LUA:%.lua=$(LUA_PATH)/%.lua.h)
LUA_H = $(LUA:%.lua=$(LUA_PATH)/%.lua.h)
BUILDDEPS += $(LUA_H) $(LUA_PATH)/
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)/:
@mkdir -p $@
$(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_PATH)/%.lua.h: %.lua
xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
$(RIOTBUILD_CONFIG_HEADER_C): $(LUA_H)
$(LUA_H): $(LUA_PATH)/%.lua.h: %.lua | $(LUA_PATH)/
$(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment