diff options
author | Christopher Haster <chaster@utexas.edu> | 2020-12-13 17:35:31 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2020-12-20 03:49:57 +0300 |
commit | d804c2d3b7389b6508993223f797d84720803c6c (patch) | |
tree | 8df979f1aa6510fde944cb6500cf182b0c25ceeb /Makefile | |
parent | 1a59954ec64ca168828a15242cc6de94ac75f9d1 (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-- | Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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/* |