-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.31 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.31 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
49
50
51
52
53
54
# Webmux Makefile
BINARY := webmux
WM := wm
WM_EMBEDDED := static/wm
PKG := pkg
VERSION := $(shell grep pkgver= PKGBUILD | cut -d= -f2)
.PHONY: all build dev clean run run-dev check pkg
all: build
# Production build - embeds static/ (including wm binary) into webmux
build: $(WM_EMBEDDED)
go build -o $(BINARY) .
# Build wm into static/ for embedding
$(WM_EMBEDDED): cmd/wm/main.go
go build -o $(WM_EMBEDDED) ./cmd/wm
# Dev build - serves static files from disk with live reload
# Also builds wm to project root for convenience during development
dev: $(WM_EMBEDDED)
go build -tags dev -o $(BINARY) .
cp $(WM_EMBEDDED) $(WM)
# Clean build artifacts
clean:
rm -f $(BINARY) $(WM) $(WM_EMBEDDED)
rm -rf $(PKG)
# Run production binary
run: build
./$(BINARY)
# Run dev binary
run-dev: dev
./$(BINARY)
# Check that everything compiles
check:
go build -o /dev/null .
go build -o /dev/null ./cmd/wm
# Prepare package directory for makepkg
pkg: build
rm -f $(PKG)/*.tar.gz $(PKG)/*.tar.zst || true
mkdir -p $(PKG)
tar czf $(PKG)/$(BINARY)-$(VERSION).tar.gz \
--transform 's,^,$(BINARY)-$(VERSION)/,' \
main.go dev.go nodev.go go.mod go.sum webmux.1 README.md LICENSE \
cmd/wm/main.go internal/shell/init.go \
static/app.js static/index.html static/style.css static/tmux.conf static/favicon.ico
cp PKGBUILD $(PKG)/