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