scorpiox-bot-plugin-sessionstats
←Makefiletext
62 lines · 2 KBHEADBlameDownload
1# plugin_sessionstats - SCORPIOX BOT open-source session runtime & turn analytics
2#
3# Targets:
4# make native build -> ./plugin_sessionstats
5# make musl static musl x86_64 -> ./plugin_sessionstats.musl
6# make arm64 static aarch64 musl -> ./plugin_sessionstats.arm64
7# make win64 MinGW-w64 static PE -> ./plugin_sessionstats.exe
8# make macos Apple clang (run on macOS)
9# make test build + run tests/run.sh
10# make clean
11
12CC ?= cc
13CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
14MUSL_CC ?= musl-gcc
15MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static -Wno-overlength-strings
16ARM_CC ?= aarch64-linux-gnu-gcc
17ARM_CFLAGS := -O2 -std=c99 -Wall -Wextra -static -Wno-overlength-strings
18WIN_CC ?= x86_64-w64-mingw32-gcc
19WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static -Wno-overlength-strings
20SRC := src/plugin_sessionstats.c
21BIN := plugin_sessionstats
22EXE := plugin_sessionstats.exe
23
24.PHONY: all native musl arm64 win64 macos test clean help
25
26all: native
27
28native: $(BIN)
29
30$(BIN): $(SRC)
31 @echo "==> native build ($(CC))"
32 $(CC) $(CFLAGS) -o $(BIN) $(SRC)
33
34# Static musl build - the universal Linux artifact (Alpine, Debian, Arch, Omarchy)
35musl: $(SRC)
36 @echo "==> static musl build ($(MUSL_CC))"
37 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN).musl $(SRC)
38
39# Static aarch64 build - Raspberry Pi 5 / ARM64 servers
40arm64: $(SRC)
41 @echo "==> static arm64 build ($(ARM_CC))"
42 $(ARM_CC) $(ARM_CFLAGS) -o $(BIN).arm64 $(SRC)
43
44# Native Win64 static PE - runs on any Windows 10/11 x64 node
45win64: $(SRC)
46 @echo "==> MinGW-w64 build ($(WIN_CC))"
47 $(WIN_CC) $(WIN_CFLAGS) -o $(EXE) $(SRC)
48
49# Apple clang build (run this on macOS)
50macos: $(SRC)
51 @echo "==> Apple clang build"
52 $(CC) -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -o $(BIN) $(SRC)
53
54test: native
55 @sh tests/run.sh
56
57clean:
58 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN).macos-arm64 $(BIN).macos-x86_64
59 rm -rf bin
60
61help:
62 @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"