Tweaked Makefile aliases: make build-tests list-tests

- Renamed build-test -> build-tests
- Renamed build-bench -> build-benches
- Added list-tests alias
- Added list-benches alias

Also made the Makefile's help text generation a bit more robust to long
rule names, which are common in Makefiles. If the name is >=21 chars, we
just indent, similar to test/bench_runner --help.
This commit is contained in:
Christopher Haster
2024-05-28 13:44:46 -05:00
parent 9c9a409524
commit f334150cda
+22 -17
View File
@@ -202,7 +202,12 @@ help:
getline rule; \ getline rule; \
while (rule ~ /^(#|\.PHONY|ifdef|ifndef)/) getline rule; \ while (rule ~ /^(#|\.PHONY|ifdef|ifndef)/) getline rule; \
gsub(/:.*/, "", rule); \ gsub(/:.*/, "", rule); \
printf " "" %-25s %s\n", rule, $$0 \ if (length(rule) <= 21) { \
printf "%2s%-21s %s\n", "", rule, $$0; \
} else { \
printf "%2s%s\n", "", rule; \
printf "%24s%s\n", "", $$0; \
} \
}' $(MAKEFILE_LIST)) }' $(MAKEFILE_LIST))
## Find the per-function code size ## Find the per-function code size
@@ -361,11 +366,11 @@ summary-diff sizes-diff: $(OBJ) $(CI)
-q $(SUMMARYFLAGS) -o-)) -q $(SUMMARYFLAGS) -o-))
## Build the test-runner ## Build the test-runner
.PHONY: test-runner build-test .PHONY: test-runner build-tests
test-runner build-test: CFLAGS+=$(TEST_CFLAGS) test-runner build-tests: CFLAGS+=$(TEST_CFLAGS)
# note we remove some binary dependent files during compilation, # note we remove some binary dependent files during compilation,
# otherwise it's way to easy to end up with outdated results # otherwise it's way to easy to end up with outdated results
test-runner build-test: $(TEST_RUNNER) test-runner build-tests: $(TEST_RUNNER)
ifdef COVGEN ifdef COVGEN
rm -f $(TEST_GCDA) rm -f $(TEST_GCDA)
endif endif
@@ -382,11 +387,11 @@ test: test-runner
./scripts/test.py -R$(TEST_RUNNER) $(TESTFLAGS) ./scripts/test.py -R$(TEST_RUNNER) $(TESTFLAGS)
## List the tests ## List the tests
.PHONY: test-list .PHONY: test-list list-tests
test-list: test-runner test-list list-tests: test-runner
./scripts/test.py -R$(TEST_RUNNER) $(TESTFLAGS) -l ./scripts/test.py -R$(TEST_RUNNER) $(TESTFLAGS) -l
## Summarize the testmarks ## Summarize the test results
.PHONY: testmarks .PHONY: testmarks
testmarks: SUMMARYFLAGS+=-spassed testmarks: SUMMARYFLAGS+=-spassed
testmarks: $(TEST_CSV) $(BUILDDIR)/lfs.test.csv testmarks: $(TEST_CSV) $(BUILDDIR)/lfs.test.csv
@@ -395,7 +400,7 @@ testmarks: $(TEST_CSV) $(BUILDDIR)/lfs.test.csv
-fpassed=test_passed \ -fpassed=test_passed \
$(SUMMARYFLAGS)) $(SUMMARYFLAGS))
## Compare testmarks against a previous run ## Compare test results against a previous run
.PHONY: testmarks-diff .PHONY: testmarks-diff
testmarks-diff: $(TEST_CSV) testmarks-diff: $(TEST_CSV)
$(strip ./scripts/summary.py $^ \ $(strip ./scripts/summary.py $^ \
@@ -404,11 +409,11 @@ testmarks-diff: $(TEST_CSV)
$(SUMMARYFLAGS) -d $(BUILDDIR)/lfs.test.csv) $(SUMMARYFLAGS) -d $(BUILDDIR)/lfs.test.csv)
## Build the bench-runner ## Build the bench-runner
.PHONY: bench-runner build-bench .PHONY: bench-runner build-benches
bench-runner build-bench: CFLAGS+=$(BENCH_CFLAGS) bench-runner build-benches: CFLAGS+=$(BENCH_CFLAGS)
# note we remove some binary dependent files during compilation, # note we remove some binary dependent files during compilation,
# otherwise it's way to easy to end up with outdated results # otherwise it's way to easy to end up with outdated results
bench-runner build-bench: $(BENCH_RUNNER) bench-runner build-benches: $(BENCH_RUNNER)
ifdef COVGEN ifdef COVGEN
rm -f $(BENCH_GCDA) rm -f $(BENCH_GCDA)
endif endif
@@ -419,17 +424,17 @@ ifdef PERFBDGEN
rm -f $(BENCH_TRACE) rm -f $(BENCH_TRACE)
endif endif
## Run the benchmarks, -j enables parallel benchmarks ## Run the benches, -j enables parallel benches
.PHONY: bench .PHONY: bench
bench: bench-runner bench: bench-runner
./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) ./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS)
## List the benchmarks ## List the benches
.PHONY: bench-list .PHONY: bench-list list-benches
bench-list: bench-runner bench-list list-benches: bench-runner
./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) -l ./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) -l
## Summarize the benchmarks ## Summarize the bench results
.PHONY: benchmarks .PHONY: benchmarks
benchmarks: SUMMARYFLAGS+=-Serased -Sproged -Sreaded benchmarks: SUMMARYFLAGS+=-Serased -Sproged -Sreaded
benchmarks: $(BENCH_CSV) $(BUILDDIR)/lfs.bench.csv benchmarks: $(BENCH_CSV) $(BUILDDIR)/lfs.bench.csv
@@ -440,7 +445,7 @@ benchmarks: $(BENCH_CSV) $(BUILDDIR)/lfs.bench.csv
-ferased=bench_erased \ -ferased=bench_erased \
$(SUMMARYFLAGS)) $(SUMMARYFLAGS))
## Compare benchmarks against a previous run ## Compare bench results against a previous run
.PHONY: benchmarks-diff .PHONY: benchmarks-diff
benchmarks-diff: $(BENCH_CSV) benchmarks-diff: $(BENCH_CSV)
$(strip ./scripts/summary.py $^ \ $(strip ./scripts/summary.py $^ \