diff --git a/pkg/jerryscript/Makefile b/pkg/jerryscript/Makefile
index 697438fbe6388c38324714c8743fdc0161992569..8e76cd979a82499c507abbd757b73865daa61b84 100644
--- a/pkg/jerryscript/Makefile
+++ b/pkg/jerryscript/Makefile
@@ -9,11 +9,10 @@ CFLAGS += -Wno-implicit-fallthrough
 
 # disable warnings when compiling with LLVM for board native
 ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
-export CFLAGS += -Wno-macro-redefined -Wno-gnu-folding-constant
+  CFLAGS += -Wno-macro-redefined -Wno-gnu-folding-constant
 endif
 
 all: git-download
-	@cp Makefile.jerryscript $(PKG_BUILDDIR)/Makefile
-	"$(MAKE)" -C $(PKG_BUILDDIR)
+	"$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.jerryscript all
 
 include $(RIOTBASE)/pkg/pkg.mk
diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript
index 438ba108a90c10e2f96e74e2670dddacf6c61600..504c79590ffbaac3ba106a6c66172bae07199121 100644
--- a/pkg/jerryscript/Makefile.jerryscript
+++ b/pkg/jerryscript/Makefile.jerryscript
@@ -1,4 +1,4 @@
-BUILD_DIR  ?= $(CURDIR)/riot
+BUILD_DIR  ?= $(BINDIR)/jerryscript
 
 JERRYHEAP  ?= 16
 
@@ -8,12 +8,11 @@ ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
   EXT_CFLAGS :=-D__TARGET_RIOT -Wno-conversion
 endif
 
-.PHONY: libjerry riot-jerry flash clean
+.PHONY: all libjerry
 
-# all: libjerry riot-jerry
+all: libjerry
 
 libjerry:
-	mkdir -p $(BUILD_DIR)
 	cmake -B$(BUILD_DIR) -H./ \
 	 -DCMAKE_SYSTEM_NAME=RIOT \
 	 -DCMAKE_SYSTEM_PROCESSOR="$(MCPU)" \
@@ -33,5 +32,3 @@ libjerry:
 	cp $(BUILD_DIR)/lib/libjerry-core.a $(BINDIR)/jerryscript.a
 	cp $(BUILD_DIR)/lib/libjerry-ext.a $(BINDIR)/jerryscript-ext.a
 	cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(BINDIR)/jerryport-minimal.a
-
-include $(RIOTBASE)/Makefile.base