scorpiox-bot-plugin-logs
←Makefiletext
62 lines · 2 KBHEADBlameDownload
1# plugin_logs - SCORPIOX BOT open-source local log viewer plugin
2#
3# Targets:
4# make native build -> ./plugin_logs
5# make musl static musl x86_64 -> ./plugin_logs (fully static)
6# make arm64 static aarch64 -> ./plugin_logs.arm64
7# make win64 MinGW-w64 static -> ./plugin_logs.exe
8# make macos Apple clang -> ./plugin_logs (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
16ARM64_CC ?= aarch64-linux-musl-gcc
17ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
18WIN_CC ?= x86_64-w64-mingw32-gcc
19WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
20SRC := src/plugin_logs.c
21BIN := plugin_logs
22EXE := plugin_logs.exe
23
24.PHONY: all native musl arm64 win64 macos test clean help
25
26all: native
27
28native: $(BIN)
29
30$(BIN): $(SRC) src/bot_theme_plugin.h
31 @echo "==> native build ($(CC))"
32 $(CC) $(CFLAGS) -I src -o $(BIN) $(SRC)
33
34# Static musl build - the universal Linux artifact (Alpine, Debian, Arch, Omarchy)
35musl: $(SRC) src/bot_theme_plugin.h
36 @echo "==> static musl build ($(MUSL_CC))"
37 $(MUSL_CC) $(MUSL_CFLAGS) -I src -o $(BIN) $(SRC)
38
39# Static aarch64 build - Raspberry Pi 5 / ARM64 servers
40arm64: $(SRC) src/bot_theme_plugin.h
41 @echo "==> static aarch64 build ($(ARM64_CC))"
42 $(ARM64_CC) $(ARM64_CFLAGS) -I src -o $(BIN).arm64 $(SRC)
43
44# Native Win64 static PE - runs on any Windows 10/11 x64 node
45win64: $(SRC) src/bot_theme_plugin.h
46 @echo "==> MinGW-w64 build ($(WIN_CC))"
47 $(WIN_CC) $(WIN_CFLAGS) -I src -o $(EXE) $(SRC)
48
49# Apple clang build (run this on macOS)
50macos: $(SRC) src/bot_theme_plugin.h
51 @echo "==> Apple clang build"
52 $(CC) $(CFLAGS) -I src -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 dist
60
61help:
62 @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"