Debian Codegraph @

Makefile

raw
1 # Root Makefile for go-sieve.
2 #
3 # Each target runs the root-module operation first, then cascades into
4 # bench/ via `$(MAKE) -C bench $@` so a single `make bench` (etc.) covers
5 # both the parent module and the comparison module.
6 #
7 # Targets:
8 # test - go test on parent module + bench module
9 # race - go test -race on parent module + bench module
10 # bench - internal SIEVE micro-benchmarks + SIEVE-vs-LRU-vs-ARC synth
11 # trace - trace replay benchmarks (requires bench/fetch-traces.sh data)
12 # all - everything above, in order
13 # clean - clean results
14 #
15 # NOTE: per project guidance we only test `.` and `./bench`; never
16 # `./...` — exp/ deadlocks under -race, and bench is a separate module
17 # that must be invoked through its own Makefile.
18
19 SHELL := /bin/bash
20 GOTEST := go test
21 COUNT := 3
22
23 .DEFAULT_GOAL := help
24 .PHONY: help all test race bench trace clean
25
26 help:
27 @echo "go-sieve — root Makefile"
28 @echo ""
29 @echo "Each target runs the parent module operation then cascades into bench/."
30 @echo ""
31 @echo "Targets:"
32 @echo " test - go test on parent module + bench compile-check"
33 @echo " race - go test -race on parent module + bench race compile-check"
34 @echo " bench - SIEVE internal micro-benches + SIEVE-vs-LRU-vs-ARC synth"
35 @echo " trace - trace replay (delegates to bench/; needs bench/data/)"
36 @echo " all - test + race + bench + trace"
37 @echo " clean - remove generated result files"
38 @echo " help - this message (default)"
39
40 all: test race bench trace
41
42 test:
43 $(GOTEST) . -count=1
44 $(MAKE) -C bench $@
45
46 race:
47 $(GOTEST) -race . -count=1
48 $(MAKE) -C bench $@
49
50 bench:
51 $(GOTEST) -bench=. -benchmem -count=$(COUNT) .
52 $(MAKE) -C bench $@
53
54 trace:
55 $(MAKE) -C bench $@
56
57 clean:
58 $(MAKE) -C bench $@