scorpiox-bot-plugin-seqthink
←Makefiletext
79 lines · 2 KBHEADBlameDownload
1# plugin_seqthink - SCORPIOX BOT open-source sequential-thinking MCP connector
2#
3# Targets:
4# make native build -> ./plugin_seqthink
5# make musl static musl x86_64 -> ./plugin_seqthink (fully static)
6# make arm64 static aarch64 -> ./plugin_seqthink.arm64
7# make win64 MinGW-w64 static -> ./plugin_seqthink.exe
8# make macos Apple clang -> ./plugin_seqthink (run on macOS)
9# make asan -fsanitize=address build -> ./plugin_seqthink.asan
10# make fortify -D_FORTIFY_SOURCE=2 build -> ./plugin_seqthink.fortify
11# make ui regenerate src/ui_html.h from src/ui.html
12# make test build + run tests/run.sh
13# make clean
14
15CC ?= cc
16CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
17MUSL_CC ?= musl-gcc
18MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
19ARM64_CC ?= aarch64-linux-musl-gcc
20ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
21WIN_CC ?= x86_64-w64-mingw32-gcc
22WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
23SRC := src/plugin_seqthink.c vendor/yyjson.c
24HDR := src/bot_theme_plugin.h src/ui_html.h vendor/yyjson.h
25INC := -I src -I vendor
26BIN := plugin_seqthink
27EXE := plugin_seqthink.exe
28
29.PHONY: all native musl arm64 win64 macos asan fortify ui test clean help
30
31all: native
32
33native: $(BIN)
34
35$(BIN): $(SRC) $(HDR)
36 @echo "==> native build ($(CC))"
37 $(CC) $(CFLAGS) $(INC) -o $(BIN) $(SRC)
38
39# Static musl build - the universal Linux artifact (Alpine, Debian, Arch, Omarchy)
40musl: $(SRC) $(HDR)
41 @echo "==> static musl build ($(MUSL_CC))"
42 $(MUSL_CC) $(MUSL_CFLAGS) $(INC) -o $(BIN) $(SRC)
43
44# Static aarch64 build - Raspberry Pi 5 / ARM64 servers
45arm64: $(SRC) $(HDR)
46 @echo "==> static aarch64 build ($(ARM64_CC))"
47 $(ARM64_CC) $(ARM64_CFLAGS) $(INC) -o $(BIN).arm64 $(SRC)
48
49# Native Win64 static PE - runs on any Windows 10/11 x64 node
50win64: $(SRC) $(HDR)
51 @echo "==> MinGW-w64 build ($(WIN_CC))"
52 $(WIN_CC) $(WIN_CFLAGS) $(INC) -o $(EXE) $(SRC)
53
54# Apple clang build (run this on macOS)
55macos: $(SRC) $(HDR)
56 @echo "==> Apple clang build"
57 $(CC) $(CFLAGS) $(INC) -o $(BIN) $(SRC)
58
59asan: $(SRC) $(HDR)
60 @echo "==> ASan build"
61 $(CC) -g -O0 -std=c99 -Wall -Wextra -fsanitize=address $(INC) -o $(BIN).asan $(SRC)
62
63fortify: $(SRC) $(HDR)
64 @echo "==> fortify build"
65 $(CC) -O2 -std=c99 -Wall -Wextra -D_FORTIFY_SOURCE=2 $(INC) -o $(BIN).fortify $(SRC)
66
67ui:
68 python3 tools/gen_ui.py
69
70test: native asan fortify
71 @sh tests/run.sh
72
73clean:
74 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN).asan $(BIN).fortify
75 rm -f $(BIN).macos-arm64 $(BIN).macos-x86_64
76 rm -rf bin dist
77
78help:
79 @echo "make | make musl | make arm64 | make win64 | make macos | make asan | make fortify | make ui | make test | make clean"