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