Makefile

 1# SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
 2#
 3# SPDX-License-Identifier: CC0-1.0
 4
 5.PHONY: all fmt fmt-check lint check test test-quiet ci dist clean
 6
 7all: fmt lint check test-quiet
 8
 9# Bundle all modules into single distributable file
10dist: dist/wt
11
12dist/wt: src/main.lua $(wildcard src/wt/*.lua) $(wildcard src/wt/cmd/*.lua) scripts/bundle.lua
13	@mkdir -p dist
14	lua scripts/bundle.lua > dist/wt
15	chmod +x dist/wt
16
17clean:
18	rm -rf dist
19
20fmt:
21	lx fmt
22
23fmt-check:
24	lx fmt --check
25
26lint:
27	lx lint
28
29check:
30	lx check
31
32test:
33	lx test
34
35# For agents: show full output only on failure, otherwise just summary
36test-quiet:
37	@output=$$(lx test 2>&1); rc=$$?; \
38	if [ $$rc -eq 0 ]; then \
39		echo "$$output" | tail -1; \
40	else \
41		echo "$$output"; \
42	fi; \
43	exit $$rc
44
45ci: fmt-check lint check test