-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.55 KB
/
Makefile
File metadata and controls
55 lines (43 loc) · 1.55 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
BINARY = age-sharp
CLI_PROJ = Age.Cli/Age.Cli.csproj
BENCH_PROJ = Age.Benchmarks/Age.Benchmarks.csproj
OUT_DIR = dist
AOT_FLAGS = -p:PublishAot=true
.PHONY: all build test interop bench bench-list clean
# Default: build universal macOS binary
all: $(OUT_DIR)/$(BINARY)
# Universal macOS binary (arm64 + x86_64)
$(OUT_DIR)/$(BINARY): $(OUT_DIR)/$(BINARY)-arm64 $(OUT_DIR)/$(BINARY)-x64
lipo -create $^ -output $@
@echo "Built universal binary: $@ ($$(du -sh $@ | cut -f1))"
$(OUT_DIR)/$(BINARY)-arm64:
@mkdir -p $(OUT_DIR)
dotnet publish $(CLI_PROJ) -r osx-arm64 $(AOT_FLAGS) -o $(OUT_DIR)/arm64
mv $(OUT_DIR)/arm64/Age.Cli $@
rm -rf $(OUT_DIR)/arm64
$(OUT_DIR)/$(BINARY)-x64:
@mkdir -p $(OUT_DIR)
dotnet publish $(CLI_PROJ) -r osx-x64 $(AOT_FLAGS) -o $(OUT_DIR)/x64
mv $(OUT_DIR)/x64/Age.Cli $@
rm -rf $(OUT_DIR)/x64
# Framework-dependent build (no AOT, for development)
build:
dotnet build
# Unit + integration tests
test:
dotnet test
# Interoperability test vs Go age CLI
interop: $(OUT_DIR)/$(BINARY)
./scripts/interop_test.sh $(OUT_DIR)/$(BINARY)
# Run all benchmarks
bench:
dotnet run -c Release --project $(BENCH_PROJ)
# Run benchmarks matching a filter (usage: make bench-filter F=*KeyGen*)
bench-filter:
dotnet run -c Release --project $(BENCH_PROJ) -- --filter $(F)
# List available benchmarks
bench-list:
dotnet run -c Release --project $(BENCH_PROJ) -- --list flat
clean:
rm -rf $(OUT_DIR) Age/bin Age.Cli/bin Age.Tests/bin Age.TestKit/bin Age.Benchmarks/bin \
Age/obj Age.Cli/obj Age.Tests/obj Age.TestKit/obj Age.Benchmarks/obj