scorpiox-bot-plugin-gitstat
←Makefiletext
62 lines · 1 KBHEADBlameDownload
1# plugin_gitstat - SCORPIOX BOT open-source local git repository status board
2#
3# Targets:
4# make native build -> ./plugin_gitstat
5# make musl static musl x86_64 -> ./plugin_gitstat.musl
6# make arm64 static aarch64 -> ./plugin_gitstat.arm64
7# make win64 MinGW-w64 static -> ./plugin_gitstat.exe
8# make macos Apple clang -> ./plugin_gitstat (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_gitstat.c
21HDRS := src/bot_theme_plugin.h src/ui_html.h
22BIN := plugin_gitstat
23EXE := plugin_gitstat.exe
24
25.PHONY: all native ui musl arm64 win64 macos test clean help
26
27all: native
28
29native: $(BIN)
30
31ui: src/ui.html tools/gen_ui.py
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
38musl: $(SRC) $(HDRS)
39 @echo "==> static musl build ($(MUSL_CC))"
40 $(MUSL_CC) $(MUSL_CFLAGS) -I src -o $(BIN).musl $(SRC)
41
42arm64: $(SRC) $(HDRS)
43 @echo "==> static arm64 build ($(ARM64_CC))"
44 $(ARM64_CC) $(ARM64_CFLAGS) -I src -o $(BIN).arm64 $(SRC)
45
46win64: $(SRC) $(HDRS)
47 @echo "==> MinGW-w64 build ($(WIN_CC))"
48 $(WIN_CC) $(WIN_CFLAGS) -I src -o $(EXE) $(SRC)
49
50macos: $(SRC) $(HDRS)
51 @echo "==> Apple clang build"
52 $(CC) $(CFLAGS) -I src -o $(BIN) $(SRC)
53
54test: native
55 @sh tests/run.sh
56
57clean:
58 rm -f $(BIN) $(EXE) $(BIN).musl $(BIN).arm64 $(BIN).macos-arm64 $(BIN).macos-x86_64
59 rm -rf bin
60
61help:
62 @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"