From c5cc82d793c9f227d3e84c9ccca7ba988252fbc9 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Wed, 12 Nov 2014 15:46:15 +0300 Subject: [PATCH] Adding mem_stats build modifier. --- Makefile | 4 ++-- Makefile.mk | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9ec62b879..81fdebe5d 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,10 @@ export TARGET_RELEASE_MODES = release export TARGET_PC_SYSTEMS = linux export TARGET_MCU_SYSTEMS = $(addprefix stm32f,3 4) -export TARGET_PC_MODS = musl sanitize valgrind cp cp_minimal \ +export TARGET_PC_MODS = musl sanitize valgrind cp cp_minimal mem_stats \ musl-valgrind \ valgrind-cp \ - musl-cp_minimal + musl-cp_minimal musl-mem_stats musl-cp_minimal-mem_stats \ export TARGET_MCU_MODS = cp_minimal diff --git a/Makefile.mk b/Makefile.mk index 197fd1693..81af6219e 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -199,6 +199,12 @@ else OPTION_VALGRIND := disable endif +ifeq ($(filter mem_stats,$(TARGET_MODS)), mem_stats) + OPTION_MEM_STATS := enable +else + OPTION_MEM_STATS := disable +endif + # # Target CPU # @@ -282,7 +288,7 @@ GIT_HASH=$(shell git rev-parse HEAD) BUILD_DATE=$(shell date +'%d/%m/%Y') CFLAGS_JERRY = $(CFLAGS_WARNINGS) $(CFLAGS_WERROR) $(CFLAGS_WFATAL_ERRORS) -DEFINES_JERRY = -DMEM_STATS +DEFINES_JERRY = DEFINES_JERRY += -DJERRY_BUILD_DATE="\"$(BUILD_DATE)\"" \ -DJERRY_COMMIT_HASH="\"$(GIT_HASH)\"" \ @@ -392,6 +398,10 @@ else LDFLAGS += -Wl,--gc-sections endif +ifeq ($(OPTION_MEM_STATS),enable) + DEFINES_JERRY += -DMEM_STATS +endif + ifeq ($(OPTION_COLOR),enable) CFLAGS_COMMON += -fdiagnostics-color=always endif