From b7aa55b721c51dbd11a775b2a4fd9aa711709c18 Mon Sep 17 00:00:00 2001 From: cladmi Date: Fri, 24 Aug 2018 17:14:32 +0200 Subject: [PATCH 1/6] pkg/jerryscript: do not use Makefile.base Do not include Makefile.base as 'DIRS' are not used here. Also if 'all' target was to be used, there would be two rules creating `$(BINDIR)/jerryscript.a`. By default `Makefile.jerryscript` executes `libjerry` as it is the first target. --- pkg/jerryscript/Makefile.jerryscript | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript index 438ba108a9..b4f4f4df0d 100644 --- a/pkg/jerryscript/Makefile.jerryscript +++ b/pkg/jerryscript/Makefile.jerryscript @@ -33,5 +33,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 From da3c075d1d87ff558a38f184727c81078f6711bd Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 22 Aug 2018 16:00:28 +0200 Subject: [PATCH 2/6] pkg/jerryscript: update rules Remove unknown rules from .PHONY. Make 'all' be the default target for jerryscript and execute `all` target. This way no definition order issue could happen in the future. --- pkg/jerryscript/Makefile | 2 +- pkg/jerryscript/Makefile.jerryscript | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/jerryscript/Makefile b/pkg/jerryscript/Makefile index 697438fbe6..86aa22fcc0 100644 --- a/pkg/jerryscript/Makefile +++ b/pkg/jerryscript/Makefile @@ -14,6 +14,6 @@ endif all: git-download @cp Makefile.jerryscript $(PKG_BUILDDIR)/Makefile - "$(MAKE)" -C $(PKG_BUILDDIR) + "$(MAKE)" -C $(PKG_BUILDDIR) all include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript index b4f4f4df0d..2d30d9c95a 100644 --- a/pkg/jerryscript/Makefile.jerryscript +++ b/pkg/jerryscript/Makefile.jerryscript @@ -8,9 +8,9 @@ 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) From c4f8c006c4a6a274f139cfdada3b2964bfeecc04 Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 22 Aug 2018 16:07:52 +0200 Subject: [PATCH 3/6] pkg/jerryscript: use 'make -f' instead of copying makefile --- pkg/jerryscript/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/jerryscript/Makefile b/pkg/jerryscript/Makefile index 86aa22fcc0..8bc5c8c2e4 100644 --- a/pkg/jerryscript/Makefile +++ b/pkg/jerryscript/Makefile @@ -13,7 +13,6 @@ export CFLAGS += -Wno-macro-redefined -Wno-gnu-folding-constant endif all: git-download - @cp Makefile.jerryscript $(PKG_BUILDDIR)/Makefile - "$(MAKE)" -C $(PKG_BUILDDIR) all + "$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.jerryscript all include $(RIOTBASE)/pkg/pkg.mk From d55ae9c7f960800e12d7611c7bb5078a918e892e Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 22 Aug 2018 16:16:28 +0200 Subject: [PATCH 4/6] pkg/jerryscript: remove unnecessary export and fix indent --- pkg/jerryscript/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/jerryscript/Makefile b/pkg/jerryscript/Makefile index 8bc5c8c2e4..8e76cd979a 100644 --- a/pkg/jerryscript/Makefile +++ b/pkg/jerryscript/Makefile @@ -9,7 +9,7 @@ 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 From 097575117c9232bc09771b4423879b242fa0cc0c Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 22 Aug 2018 18:05:16 +0200 Subject: [PATCH 5/6] pkg/jerryscript: build directory does not need to exist with -B --- pkg/jerryscript/Makefile.jerryscript | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript index 2d30d9c95a..8e252c26b5 100644 --- a/pkg/jerryscript/Makefile.jerryscript +++ b/pkg/jerryscript/Makefile.jerryscript @@ -13,7 +13,6 @@ endif all: libjerry libjerry: - mkdir -p $(BUILD_DIR) cmake -B$(BUILD_DIR) -H./ \ -DCMAKE_SYSTEM_NAME=RIOT \ -DCMAKE_SYSTEM_PROCESSOR="$(MCPU)" \ From 3a125b6396b5a0ed0a4efb44935b3e830013c128 Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 22 Aug 2018 17:20:48 +0200 Subject: [PATCH 6/6] pkg/jerryscript: build into '$(BINDIR)' Build into the BINDIR directory instead of the source repository. This makes 'clean' work as expected without other intervention. Also it goes in the direction of having the package source repository board independent. --- pkg/jerryscript/Makefile.jerryscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript index 8e252c26b5..504c79590f 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