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