scorpiox-bot-plugin-services
←Makefiletext
66 lines · 2 KBHEADBlameDownload
1# plugin_services - SCORPIOX BOT open-source local service status board
2#
3# Targets:
4# make native build -> ./plugin_services
5# make musl static musl x86_64 -> ./plugin_services.musl
6# make arm64 static aarch64 -> ./plugin_services.arm64
7# make win64 MinGW-w64 static -> ./plugin_services.exe
8# make macos Apple clang -> ./plugin_services (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
16ARM64_CC ?= aarch64-linux-gnu-gcc
17ARM64_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_services.c
21HDRS := src/bot_theme_plugin.h src/ui_html.h
22BIN := plugin_services
23EXE := plugin_services.exe
24
25.PHONY: all native ui musl arm64 win64 macos test clean help
26
27all: native
28
29native: $(BIN)
30
31ui:
32 @python3 tools/gen_ui.py
33
34$(BIN): $(SRC) $(HDRS)
35 @echo "==> native build ($(CC))"
36 $(CC) $(CFLAGS) -I src -o $(BIN) $(SRC)
37
38# Static musl build - the universal Linux artifact (Alpine, Debian, Arch, Omarchy)
39musl: $(SRC) $(HDRS)
40 @echo "==> static musl build ($(MUSL_CC))"
41 $(MUSL_CC) $(MUSL_CFLAGS) -I src -o $(BIN).musl $(SRC)
42
43# Static aarch64 build - Raspberry Pi 5 / ARM64 servers
44arm64: $(SRC) $(HDRS)
45 @echo "==> static aarch64 build ($(ARM64_CC))"
46 $(ARM64_CC) $(ARM64_CFLAGS) -I src -o $(BIN).arm64 $(SRC)
47
48# Native Win64 static PE - runs on any Windows 10/11 x64 node
49win64: $(SRC) $(HDRS)
50 @echo "==> MinGW-w64 build ($(WIN_CC))"
51 $(WIN_CC) $(WIN_CFLAGS) -I src -o $(EXE) $(SRC)
52
53# Apple clang build (run this on macOS)
54macos: $(SRC) $(HDRS)
55 @echo "==> Apple clang build"
56 $(CC) $(CFLAGS) -I src -o $(BIN) $(SRC)
57
58test: native
59 @sh tests/run.sh
60
61clean:
62 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN).macos-arm64 $(BIN).macos-x86_64
63 rm -rf bin dist
64
65help:
66 @echo "make | make ui | make musl | make arm64 | make win64 | make macos | make test | make clean"