1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 01:53:51 +01:00

examples/javascript: 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:
Juan Carrano 2018-11-22 16:30:29 +01:00
parent b9fa2b5bf6
commit 64fcfff9e2

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