diff --git a/examples/javascript/Makefile b/examples/javascript/Makefile
index da8971c909a6ebe9140dffce60b69cc184bdca1b..144850489fe250517e65e50050beb3242e2b8a5c 100644
--- a/examples/javascript/Makefile
+++ b/examples/javascript/Makefile
@@ -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)
 
-$(JS_PATH)/:
-	@mkdir -p $@
+BUILDDEPS += $(JS_H) $(JS_PATH)/
 
-$(JS_H): | $(JS_PATH)/
-$(JS_H): $(JS_PATH)/%.js.h: %.js
-	xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
+include $(RIOTBASE)/Makefile.include
+
+$(JS_PATH)/:
+	$(Q)mkdir -p $@
 
-$(RIOTBUILD_CONFIG_HEADER_C): $(JS_H)
+$(JS_H): $(JS_PATH)/%.js.h: %.js | $(JS_PATH)/
+	$(Q)xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
diff --git a/examples/lua_REPL/Makefile b/examples/lua_REPL/Makefile
index cbdccb97895e2079f749749e977a1d11d429c3e1..1c803638906b23a81da5bb18284464b8761a200c 100644
--- a/examples/lua_REPL/Makefile
+++ b/examples/lua_REPL/Makefile
@@ -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' > $@
diff --git a/examples/lua_basic/Makefile b/examples/lua_basic/Makefile
index 21793cae59d59ed90f64d5ad8087c917e2673003..212c31f99a690c7b778da7d1f8950f2972e309b2 100644
--- a/examples/lua_basic/Makefile
+++ b/examples/lua_basic/Makefile
@@ -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)
 
-$(LUA_PATH)/:
-	@mkdir -p $@
+BUILDDEPS += $(LUA_H) $(LUA_PATH)/
 
-$(LUA_H): | $(LUA_PATH)/
-$(LUA_H): $(LUA_PATH)/%.lua.h: %.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.
 
-	xxd -i $< | sed 's/^unsigned/const unsigned/g' > $@
+$(LUA_PATH)/:
+	$(Q)mkdir -p $@
 
-$(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' > $@