Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2020-12-13 17:35:31 +0300
committerChristopher Haster <chaster@utexas.edu>2020-12-20 03:49:57 +0300
commitd804c2d3b7389b6508993223f797d84720803c6c (patch)
tree8df979f1aa6510fde944cb6500cf182b0c25ceeb /Makefile
parent1a59954ec64ca168828a15242cc6de94ac75f9d1 (diff)
Added scripts/code_size.py, for more in-depth code-size reportingscript-code-size
Inspired by Linux's Bloat-O-Meter, code_size.py wraps nm to provide function-level code size, and supports detailed comparison between different builds. One difference is that code_size.py invokes littlefs's build system similarly to test.py, creating a duplicate build in the "sizes" directory. This makes it easy to monitor a cross-compiled build size while simultaneously testing on the host machine.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 879b767..e5107bb 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ endif
CC ?= gcc
AR ?= ar
SIZE ?= size
+NM ?= nm
SRC += $(wildcard *.c bd/*.c)
OBJ := $(SRC:.c=.o)
@@ -29,6 +30,7 @@ override CFLAGS += -Wextra -Wshadow -Wjump-misses-init -Wundef
ifdef VERBOSE
override TFLAGS += -v
+override SFLAGS += -v
endif
@@ -39,6 +41,9 @@ asm: $(ASM)
size: $(OBJ)
$(SIZE) -t $^
+code_size:
+ ./scripts/code_size.py $(SFLAGS)
+
test:
./scripts/test.py $(TFLAGS)
.SECONDEXPANSION:
@@ -65,3 +70,4 @@ clean:
rm -f $(DEP)
rm -f $(ASM)
rm -f tests/*.toml.*
+ rm -f sizes/*