-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (58 loc) · 1.76 KB
/
Makefile
File metadata and controls
70 lines (58 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.PHONY: all build test fuzz clean help seqls seqinfo grammar
# Build output directory
BIN_DIR ?= bin
# Default fuzz time
FUZZ_TIME ?= 10s
# All fuzz tests disabled - they keep finding pathological edge cases
# that aren't real-world issues. The defensive limits added to frameset.go
# are sufficient to prevent hangs/crashes.
FUZZ_TESTS :=
help:
@echo "Available targets:"
@echo " all - Build all executables (seqls, seqinfo)"
@echo " build - Alias for 'all'"
@echo " seqls - Build seqls executable"
@echo " seqinfo - Build seqinfo executable"
@echo " test - Run all unit tests"
@echo " fuzz - Run all fuzz tests for $(FUZZ_TIME) each (set FUZZ_TIME=30s to customize)"
@echo " grammar - Regenerate Go and C++ parsers from ANTLR grammar"
@echo " clean - Remove built executables"
@echo ""
@echo "Examples:"
@echo " make build"
@echo " make test"
@echo " make fuzz"
@echo " make fuzz FUZZ_TIME=30s"
@echo " make grammar"
all: seqls seqinfo
build: all
seqls:
@echo "Building seqls..."
@mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/seqls ./cmd/seqls
seqinfo:
@echo "Building seqinfo..."
@mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/seqinfo ./cmd/seqinfo
test:
go test -v ./...
fuzz:
ifeq ($(FUZZ_TESTS),)
@echo "⚠️ Fuzz testing disabled"
@echo "All fuzz tests have been disabled."
else
@echo "Running all fuzz tests for $(FUZZ_TIME) each..."
@for test in $(FUZZ_TESTS); do \
echo ""; \
echo "==> Fuzzing $$test for $(FUZZ_TIME)..."; \
go test -fuzz=$$test -fuzztime=$(FUZZ_TIME) || exit 1; \
done
@echo ""
@echo "✅ All fuzz tests passed!"
endif
grammar:
@echo "Regenerating parsers from ANTLR grammar..."
$(MAKE) -C grammar all
clean:
@echo "Cleaning build artifacts..."
rm -rf $(BIN_DIR)