mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/lua_basic: 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.)
This commit is contained in:
parent
16261a2f7c
commit
b9fa2b5bf6
@ -36,13 +36,7 @@ endif
|
|||||||
|
|
||||||
USEPKG += lua
|
USEPKG += lua
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
LUA_PATH = $(BINDIR)/lua
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# add directory of generated *.lua.h files to include path
|
# add directory of generated *.lua.h files to include path
|
||||||
CFLAGS += -I$(LUA_PATH)
|
CFLAGS += -I$(LUA_PATH)
|
||||||
@ -50,14 +44,20 @@ CFLAGS += -I$(LUA_PATH)
|
|||||||
# generate .lua.h header files of .lua files
|
# generate .lua.h header files of .lua files
|
||||||
LUA = $(wildcard *.lua)
|
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)/:
|
$(LUA_PATH)/:
|
||||||
@mkdir -p $@
|
$(Q)mkdir -p $@
|
||||||
|
|
||||||
$(LUA_H): | $(LUA_PATH)/
|
# FIXME: This way of embedding lua code is not robust. A proper script will
|
||||||
$(LUA_H): $(LUA_PATH)/%.lua.h: %.lua
|
# be included later.
|
||||||
|
$(LUA_H): $(LUA_PATH)/%.lua.h: %.lua | $(LUA_PATH)/
|
||||||
xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
|
$(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
|
||||||
|
|
||||||
$(RIOTBUILD_CONFIG_HEADER_C): $(LUA_H)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user