-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
48 lines (36 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
SRC_DIR := src
LUALS_VERSION := 3.17.1
LUALS_DIR := bin/lua-language-server
LUALS := $(LUALS_DIR)/bin/lua-language-server
LUALS_URL := https://github.com/LuaLS/lua-language-server/releases/download/$(LUALS_VERSION)/lua-language-server-$(LUALS_VERSION)-linux-x64.tar.gz
.PHONY: help install-tools install-stylua install-luals format format-check typecheck check sync push
help:
@echo "Usage: make <target>"
@echo ""
@echo " install-tools Install stylua and lua-language-server"
@echo " install-stylua Install stylua (via cargo)"
@echo " install-luals Install lua-language-server"
@echo " format Format Lua files with stylua"
@echo " format-check Check formatting without modifying files"
@echo " typecheck Run lua-language-server type checking"
@echo " check Run format-check and typecheck"
@echo " sync Sync source files to EdgeTX simulator SD card"
@echo " push Install package to EdgeTX radio and eject"
install-stylua:
@command -v cargo >/dev/null 2>&1 || { echo "cargo is required (install Rust: https://rustup.rs)"; exit 1; }
cargo install stylua --features lua53
install-luals:
mkdir -p $(LUALS_DIR)
curl -fSL $(LUALS_URL) | tar xz -C $(LUALS_DIR)
install-tools: install-stylua install-luals
format:
stylua $(SRC_DIR)
format-check:
stylua --check $(SRC_DIR)
typecheck:
$(LUALS) --check .
check: format-check typecheck
sync:
edgetx-cli dev sync ../edgetx-sdcard
push:
edgetx-cli pkg install . --eject