aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Jones <brian.j.jones@intel.com>2017-03-22 15:42:03 -0700
committerGeoff Gustafson <geoff@linux.intel.com>2017-03-22 15:42:03 -0700
commit3d5ff82e9c67e435319a835528b0a565c30620ce (patch)
treefbbb03148da139101810fd9f590aa494cac0329a
parenta8b1885f2fc106597f3e70459fd4a2c52284ce95 (diff)
[build] Creating new make targets for ide and ashell (#846)
This will allow faster building for ide and ashell (command line). It also cleans the makefile up a bit Signed-off-by: Brian J Jones <brian.j.jones@intel.com>
-rw-r--r--Makefile49
-rw-r--r--fragments/prj.conf.ashell1
2 files changed, 33 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index d24efcd..329ef24 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,21 @@ ROM ?= 256
# Dump memory information: on = print allocs, full = print allocs + dump pools
TRACE ?= off
+
# Generate and run snapshot as byte code instead of running JS directly
+ifneq (,$(filter $(MAKECMDGOALS),ide ashell linux))
+SNAPSHOT=off
+# if the user passes in SNAPSHOT=on for ide, ashell, or linux give an error
+ifeq ($(SNAPSHOT), on)
+$(error ide, ashell, and linux do not support SNAPSHOT=$(SNAPSHOT))
+endif
+else
+# snapshot is enabled by default
SNAPSHOT ?= on
+ifeq ($(SNAPSHOT), on)
+EXT_JERRY_FLAGS += -DFEATURE_JS_PARSER=OFF
+endif
+endif
ifndef ZJS_BASE
$(error ZJS_BASE not defined. You need to source zjs-env.sh)
@@ -51,11 +64,13 @@ EXT_JERRY_FLAGS ?= -DENABLE_ALL_IN_ONE=ON \
-DFEATURE_PROFILE=$(ZJS_BASE)/jerry_feature.profile \
-DFEATURE_ERROR_MESSAGES=OFF \
-DJERRY_LIBM=OFF
-ifneq ($(DEV), ashell)
-ifeq ($(SNAPSHOT), on)
-EXT_JERRY_FLAGS += -DFEATURE_JS_PARSER=OFF
-endif
+
+# Settings for ashell builds
+ifneq (,$(filter $(MAKECMDGOALS),ide ashell))
+CONFIG ?= fragments/zjs.conf.dev
+DEV=ashell
endif
+
ifeq ($(BOARD), arduino_101)
EXT_JERRY_FLAGS += -DENABLE_LTO=ON
$(info makecmd: $(MAKECMDGOALS))
@@ -73,12 +88,6 @@ $(info $() $() ROM allocation: $(ROM)KB for X86, $(shell echo $$((296 - $(ROM)))
endif
endif # BOARD = arduino_101
-# if no config file passed use the ashell default
-ifeq ($(DEV), ashell)
- CONFIG ?= fragments/zjs.conf.dev
- SNAPSHOT = off
-endif
-
# Print callback statistics during runtime
CB_STATS ?= off
# Print floats (uses -u _printf_float flag). This is a workaround on the A101
@@ -129,7 +138,8 @@ zephyr: analyze generate jerryscript $(ARC)
CB_STATS=$(CB_STATS) \
PRINT_FLOAT=$(PRINT_FLOAT) \
SNAPSHOT=$(SNAPSHOT) \
- BLE_ADDR=$(BLE_ADDR)
+ BLE_ADDR=$(BLE_ADDR) \
+ DEV=$(DEV)
ifeq ($(BOARD), arduino_101)
@echo
@echo -n Creating dfu images...
@@ -139,6 +149,12 @@ ifeq ($(BOARD), arduino_101)
@echo " done."
endif
+.PHONY: ide
+ide: zephyr
+
+.PHONY: ashell
+ashell: zephyr
+
# Flash Arduino 101 x86 and arc images
.PHONY: dfu
dfu:
@@ -170,10 +186,6 @@ analyze: $(JS)
@if [ "$(SNAPSHOT)" = "on" ]; then \
echo "ccflags-y += -DZJS_SNAPSHOT_BUILD" >> src/Makefile; \
fi
-ifeq ($(DEV), ashell)
- @cat fragments/prj.mdef.ashell >> prj.mdef
-endif
-
@echo "ccflags-y += $(shell ./scripts/analyze.sh $(BOARD) $(JS) $(CONFIG) $(DEV))" | tee -a src/Makefile arc/src/Makefile
@sed -i '/This is a generated file/r./zjs.conf.tmp' src/Makefile
@# Add the include for the OCF Makefile only if the script is using OCF
@@ -199,8 +211,13 @@ ifeq ($(BOARD), qemu_x86)
else
ifeq ($(DEV), ashell)
@cat fragments/prj.conf.ashell >> prj.conf
+ @cat fragments/prj.mdef.ashell >> prj.mdef
+ifeq ($(filter ide,$(MAKECMDGOALS)),ide)
+ @echo CONFIG_USB_CDC_ACM=n >> prj.conf
+else
+ @echo CONFIG_USB_CDC_ACM=y >> prj.conf
+endif
endif
-
ifeq ($(BOARD), arduino_101)
@cat fragments/prj.conf.arduino_101 >> prj.conf
@printf "CONFIG_PHYS_RAM_ADDR=0xA800%x\n" $$(((80 - $(RAM)) * 1024)) >> prj.conf
diff --git a/fragments/prj.conf.ashell b/fragments/prj.conf.ashell
index f9026b6..a256c6c 100644
--- a/fragments/prj.conf.ashell
+++ b/fragments/prj.conf.ashell
@@ -11,7 +11,6 @@ CONFIG_USB=y
CONFIG_USB_DW=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DW_DEBUG=n
-CONFIG_USB_CDC_ACM=n
CONFIG_USB_DEBUG=n
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y