1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #10456 from jcarrano/script-builddeps-fix

examples/{javascript/lua}: correctly declare rules to embed scripts.
This commit is contained in:
Gaëtan Harter 2018-11-23 15:47:14 +01:00 committed by GitHub
commit 29acd4028d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 39 deletions

View File

@ -35,21 +35,21 @@ endif
# Add the package for Jerryscript
USEPKG += jerryscript
include $(RIOTBASE)/Makefile.include
JS_PATH = $(BINDIR)/js/$(MODULE)
JS_PATH := $(BINDIR)/js/$(MODULE)
# add directory of generated *.js.h files to include path
CFLAGS += -I$(JS_PATH)
# generate .js.h header files of .js files
JS = $(wildcard *.js)
JS_H := $(JS:%.js=$(JS_PATH)/%.js.h)
JS_H = $(JS:%.js=$(JS_PATH)/%.js.h)
BUILDDEPS += $(JS_H) $(JS_PATH)/
include $(RIOTBASE)/Makefile.include
$(JS_PATH)/:
@mkdir -p $@
$(Q)mkdir -p $@
$(JS_H): | $(JS_PATH)/
$(JS_H): $(JS_PATH)/%.js.h: %.js
xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
$(RIOTBUILD_CONFIG_HEADER_C): $(JS_H)
$(JS_H): $(JS_PATH)/%.js.h: %.js | $(JS_PATH)/
$(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@

View File

@ -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' > $@

View File

@ -36,13 +36,7 @@ endif
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)
@ -50,14 +44,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 $@
$(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)
# 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' > $@