|
@@ -157,20 +157,37 @@ endif
|
|
|
|
|
|
|
|
|
|
|
|
|
# commands
|
|
# commands
|
|
|
|
|
+
|
|
|
|
|
+## Build littlefs
|
|
|
.PHONY: all build
|
|
.PHONY: all build
|
|
|
all build: $(TARGET)
|
|
all build: $(TARGET)
|
|
|
|
|
|
|
|
|
|
+## Build assembly files
|
|
|
.PHONY: asm
|
|
.PHONY: asm
|
|
|
asm: $(ASM)
|
|
asm: $(ASM)
|
|
|
|
|
|
|
|
|
|
+## Find the total size
|
|
|
.PHONY: size
|
|
.PHONY: size
|
|
|
size: $(OBJ)
|
|
size: $(OBJ)
|
|
|
$(SIZE) -t $^
|
|
$(SIZE) -t $^
|
|
|
|
|
|
|
|
|
|
+## Generate a ctags file
|
|
|
.PHONY: tags
|
|
.PHONY: tags
|
|
|
tags:
|
|
tags:
|
|
|
$(CTAGS) --totals --c-types=+p $(shell find -H -name '*.h') $(SRC)
|
|
$(CTAGS) --totals --c-types=+p $(shell find -H -name '*.h') $(SRC)
|
|
|
|
|
|
|
|
|
|
+## Show this help text
|
|
|
|
|
+.PHONY: help
|
|
|
|
|
+help:
|
|
|
|
|
+ @$(strip awk '/^## / { \
|
|
|
|
|
+ sub(/^## /,""); \
|
|
|
|
|
+ getline rule; \
|
|
|
|
|
+ while (rule ~ /^(#|\.PHONY|ifdef|ifndef)/) getline rule; \
|
|
|
|
|
+ gsub(/:.*/, "", rule); \
|
|
|
|
|
+ printf " "" %-25s %s\n", rule, $$0 \
|
|
|
|
|
+ }' $(MAKEFILE_LIST))
|
|
|
|
|
+
|
|
|
|
|
+## Build the test-runner
|
|
|
.PHONY: test-runner build-test
|
|
.PHONY: test-runner build-test
|
|
|
ifndef NO_COV
|
|
ifndef NO_COV
|
|
|
test-runner build-test: override CFLAGS+=--coverage
|
|
test-runner build-test: override CFLAGS+=--coverage
|
|
@@ -194,14 +211,17 @@ ifdef YES_PERFBD
|
|
|
rm -f $(TEST_TRACE)
|
|
rm -f $(TEST_TRACE)
|
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
|
|
+## Run the tests, -j enables parallel tests
|
|
|
.PHONY: test
|
|
.PHONY: test
|
|
|
test: test-runner
|
|
test: test-runner
|
|
|
./scripts/test.py $(TEST_RUNNER) $(TESTFLAGS)
|
|
./scripts/test.py $(TEST_RUNNER) $(TESTFLAGS)
|
|
|
|
|
|
|
|
|
|
+## List the tests
|
|
|
.PHONY: test-list
|
|
.PHONY: test-list
|
|
|
test-list: test-runner
|
|
test-list: test-runner
|
|
|
./scripts/test.py $(TEST_RUNNER) $(TESTFLAGS) -l
|
|
./scripts/test.py $(TEST_RUNNER) $(TESTFLAGS) -l
|
|
|
|
|
|
|
|
|
|
+## Build the bench-runner
|
|
|
.PHONY: bench-runner build-bench
|
|
.PHONY: bench-runner build-bench
|
|
|
ifdef YES_COV
|
|
ifdef YES_COV
|
|
|
bench-runner build-bench: override CFLAGS+=--coverage
|
|
bench-runner build-bench: override CFLAGS+=--coverage
|
|
@@ -225,30 +245,37 @@ ifndef NO_PERFBD
|
|
|
rm -f $(BENCH_TRACE)
|
|
rm -f $(BENCH_TRACE)
|
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
|
|
+## Run the benchmarks, -j enables parallel benchmarks
|
|
|
.PHONY: bench
|
|
.PHONY: bench
|
|
|
bench: bench-runner
|
|
bench: bench-runner
|
|
|
./scripts/bench.py $(BENCH_RUNNER) $(BENCHFLAGS)
|
|
./scripts/bench.py $(BENCH_RUNNER) $(BENCHFLAGS)
|
|
|
|
|
|
|
|
|
|
+## List the benchmarks
|
|
|
.PHONY: bench-list
|
|
.PHONY: bench-list
|
|
|
bench-list: bench-runner
|
|
bench-list: bench-runner
|
|
|
./scripts/bench.py $(BENCH_RUNNER) $(BENCHFLAGS) -l
|
|
./scripts/bench.py $(BENCH_RUNNER) $(BENCHFLAGS) -l
|
|
|
|
|
|
|
|
|
|
+## Find the per-function code size
|
|
|
.PHONY: code
|
|
.PHONY: code
|
|
|
code: $(OBJ)
|
|
code: $(OBJ)
|
|
|
./scripts/code.py $^ -Ssize $(CODEFLAGS)
|
|
./scripts/code.py $^ -Ssize $(CODEFLAGS)
|
|
|
|
|
|
|
|
|
|
+## Find the per-function data size
|
|
|
.PHONY: data
|
|
.PHONY: data
|
|
|
data: $(OBJ)
|
|
data: $(OBJ)
|
|
|
./scripts/data.py $^ -Ssize $(DATAFLAGS)
|
|
./scripts/data.py $^ -Ssize $(DATAFLAGS)
|
|
|
|
|
|
|
|
|
|
+## Find the per-function stack usage
|
|
|
.PHONY: stack
|
|
.PHONY: stack
|
|
|
stack: $(CI)
|
|
stack: $(CI)
|
|
|
./scripts/stack.py $^ -Slimit -Sframe $(STACKFLAGS)
|
|
./scripts/stack.py $^ -Slimit -Sframe $(STACKFLAGS)
|
|
|
|
|
|
|
|
|
|
+## Find the struct sizes
|
|
|
.PHONY: struct
|
|
.PHONY: struct
|
|
|
struct: $(OBJ)
|
|
struct: $(OBJ)
|
|
|
./scripts/struct_.py $^ -Ssize $(STRUCTFLAGS)
|
|
./scripts/struct_.py $^ -Ssize $(STRUCTFLAGS)
|
|
|
|
|
|
|
|
|
|
+## Find the line/branch coverage after a test run
|
|
|
.PHONY: cov
|
|
.PHONY: cov
|
|
|
cov: $(GCDA)
|
|
cov: $(GCDA)
|
|
|
$(strip ./scripts/cov.py \
|
|
$(strip ./scripts/cov.py \
|
|
@@ -256,6 +283,7 @@ cov: $(GCDA)
|
|
|
-slines -sbranches \
|
|
-slines -sbranches \
|
|
|
$(COVFLAGS))
|
|
$(COVFLAGS))
|
|
|
|
|
|
|
|
|
|
+## Find the perf results after bench run with YES_PERF
|
|
|
.PHONY: perf
|
|
.PHONY: perf
|
|
|
perf: $(BENCH_PERF)
|
|
perf: $(BENCH_PERF)
|
|
|
$(strip ./scripts/perf.py \
|
|
$(strip ./scripts/perf.py \
|
|
@@ -263,6 +291,7 @@ perf: $(BENCH_PERF)
|
|
|
-Scycles \
|
|
-Scycles \
|
|
|
$(PERFFLAGS))
|
|
$(PERFFLAGS))
|
|
|
|
|
|
|
|
|
|
+## Find the perfbd results after a bench run
|
|
|
.PHONY: perfbd
|
|
.PHONY: perfbd
|
|
|
perfbd: $(BENCH_TRACE)
|
|
perfbd: $(BENCH_TRACE)
|
|
|
$(strip ./scripts/perfbd.py \
|
|
$(strip ./scripts/perfbd.py \
|
|
@@ -270,6 +299,7 @@ perfbd: $(BENCH_TRACE)
|
|
|
-Serased -Sproged -Sreaded \
|
|
-Serased -Sproged -Sreaded \
|
|
|
$(PERFBDFLAGS))
|
|
$(PERFBDFLAGS))
|
|
|
|
|
|
|
|
|
|
+## Find a summary of compile-time sizes
|
|
|
.PHONY: summary sizes
|
|
.PHONY: summary sizes
|
|
|
summary sizes: $(BUILDDIR)/lfs.csv
|
|
summary sizes: $(BUILDDIR)/lfs.csv
|
|
|
$(strip ./scripts/summary.py -Y $^ \
|
|
$(strip ./scripts/summary.py -Y $^ \
|
|
@@ -355,7 +385,7 @@ $(BUILDDIR)/%.b.c: %.toml
|
|
|
$(BUILDDIR)/%.b.c: %.c $(BENCHES)
|
|
$(BUILDDIR)/%.b.c: %.c $(BENCHES)
|
|
|
./scripts/bench.py -c $(BENCHES) -s $< $(BENCHCFLAGS) -o $@
|
|
./scripts/bench.py -c $(BENCHES) -s $< $(BENCHCFLAGS) -o $@
|
|
|
|
|
|
|
|
-# clean everything
|
|
|
|
|
|
|
+## Clean everything
|
|
|
.PHONY: clean
|
|
.PHONY: clean
|
|
|
clean:
|
|
clean:
|
|
|
rm -f $(BUILDDIR)/lfs
|
|
rm -f $(BUILDDIR)/lfs
|