scorpiox-bot-plugin-sglang
←Makefiletext
59 lines · 1 KBHEADBlameDownload
1# plugin_sglang - SCORPIOX BOT open-source SGLang server metrics monitor
2#
3# Targets:
4# make native build -> ./plugin_sglang
5# make musl static musl x86_64 -> ./plugin_sglang.musl
6# make arm64 static aarch64 musl -> ./plugin_sglang.arm64
7# make win64 MinGW-w64 static PE -> ./plugin_sglang.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_sglang.c
21HDR := src/bot_theme_plugin.h
22BIN := plugin_sglang
23EXE := plugin_sglang.exe
24
25.PHONY: all native musl arm64 win64 macos test clean help
26
27all: native
28
29native: $(BIN)
30
31$(BIN): $(SRC) $(HDR)
32 @echo "==> native build ($(CC))"
33 $(CC) $(CFLAGS) -o $(BIN) $(SRC)
34
35musl: $(SRC) $(HDR)
36 @echo "==> static musl build ($(MUSL_CC))"
37 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN).musl $(SRC)
38
39arm64: $(SRC) $(HDR)
40 @echo "==> static arm64 build ($(ARM_CC))"
41 $(ARM_CC) $(ARM_CFLAGS) -o $(BIN).arm64 $(SRC)
42
43win64: $(SRC) $(HDR)
44 @echo "==> MinGW-w64 build ($(WIN_CC))"
45 $(WIN_CC) $(WIN_CFLAGS) -o $(EXE) $(SRC)
46
47macos: $(SRC) $(HDR)
48 @echo "==> Apple clang build"
49 $(CC) -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -o $(BIN) $(SRC)
50
51test: native
52 @sh tests/run.sh
53
54clean:
55 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN).macos-arm64 $(BIN).macos-x86_64
56 rm -rf bin
57
58help:
59 @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"