scorpiox-bot-plugin-codex-login
←Makefiletext
76 lines · 2 KBHEADBlameDownload
1# plugin_codex_login - SCORPIOX BOT open-source OpenAI Codex login for your node
2#
3# Targets:
4# make native build -> ./plugin_codex_login
5# make musl static musl x86_64 -> ./plugin_codex_login.musl
6# make arm64 static arm64 musl (aarch64 cross) -> ./plugin_codex_login.arm64
7# make win64 MinGW-w64 static -> ./plugin_codex_login.exe
8# make macos Apple clang -> ./plugin_codex_login (run this on macOS)
9# make ui regenerate src/ui_html.h from src/ui.html
10# make test build + run tests/run.sh
11# make clean
12
13CC ?= cc
14CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings -Wno-format-truncation -I src
15MUSL_CC ?= musl-gcc
16MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -Wno-format-truncation -I src -static
17ARM_CC ?= aarch64-linux-gnu-gcc
18ARM_CFLAGS := -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -Wno-format-truncation -I src -static
19WIN_CC ?= x86_64-w64-mingw32-gcc
20WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -Wno-format-truncation -I src -static
21SRC := src/plugin_codex_login.c
22UI_SRC := src/ui.html
23UI_HDR := src/ui_html.h
24BIN := plugin_codex_login
25EXE := plugin_codex_login.exe
26
27.PHONY: all native musl arm64 win64 macos ui test clean help
28
29all: native
30
31$(UI_HDR): $(UI_SRC) tools/gen_ui.py
32 @echo "==> regenerating $(UI_HDR)"
33 python3 tools/gen_ui.py
34
35ui: $(UI_HDR)
36
37native: $(BIN)
38
39$(BIN): $(SRC) $(UI_HDR)
40 @echo "==> native build ($(CC))"
41 $(CC) $(CFLAGS) -o $(BIN) $(SRC)
42
43# Static musl build - the universal Linux artifact (Alpine, Debian, Arch, Omarchy)
44musl: $(SRC) $(UI_HDR)
45 @echo "==> static musl build ($(MUSL_CC))"
46 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN).musl $(SRC)
47
48# Static aarch64 build - Raspberry Pi 5 / ARM64 servers
49arm64: $(SRC) $(UI_HDR)
50 @echo "==> static arm64 build ($(ARM_CC))"
51 $(ARM_CC) $(ARM_CFLAGS) -o $(BIN).arm64 $(SRC)
52
53# Native Win64 static PE - runs on any Windows 10/11 x64 node
54win64: $(SRC) $(UI_HDR)
55 @echo "==> MinGW-w64 build ($(WIN_CC))"
56 $(WIN_CC) $(WIN_CFLAGS) -o $(EXE) $(SRC)
57
58# Apple clang build (run this on macOS)
59macos: $(SRC) $(UI_HDR)
60 @echo "==> Apple clang build"
61 clang -O2 -std=c99 -Wall -Wextra -Wno-overlength-strings -Wno-format-truncation -I src -o $(BIN) $(SRC)
62
63install: $(BIN)
64 @dest="$${HOME}/.scorpiox/plugins"; [ -d /workspace ] && dest="/workspace/.scorpiox/plugins"; \
65 mkdir -p "$$dest" && cp $(BIN) "$$dest/$(BIN)" && chmod 0755 "$$dest/$(BIN)" && \
66 echo "==> installed $$dest/$(BIN)"
67
68test: $(BIN)
69 sh tests/run.sh
70
71clean:
72 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64
73 rm -rf tests/__pycache__
74
75help:
76 @sed -n '2,14p' $(MAKEFILE_LIST)