Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.33 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 1.33 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
GO ?= go
BIN := bin
# Where `make dev` keeps its daemon, sessions, projects and hosts, apart
# from the installed app's ~/.enowx-app.
DEV_HOME ?= $(HOME)/.enowx-dev
# The app is a GUI program on Windows: built as a console one, it opens a
# console window of its own, and closing that window closes the app. The
# daemon stays a console program, its output going to enowxd.log.
APP_LDFLAGS :=
ifeq ($(OS),Windows_NT)
APP_LDFLAGS := -ldflags "-H=windowsgui"
endif
.PHONY: build daemons dev test lint fmt run-app run-daemon clean package
build: daemons
$(GO) build -o $(BIN)/ ./cmd/enowxd
$(GO) build -o $(BIN)/ $(APP_LDFLAGS) ./cmd/enowx
# Linux builds of enowxd that the app installs on servers.
daemons:
GO=$(GO) scripts/daemons.sh
test:
$(GO) test ./...
# Every platform's installers, built here into dist/<version>, not published.
package:
scripts/package.sh
# The app with hot reload: Go changes rebuild and relaunch it, and the
# relaunched app replaces the daemon an earlier build started. The Linux
# daemons are built first: the app embeds them to install on servers.
dev: daemons
ENOWX_DEV=1 ENOWX_HOME=$(DEV_HOME) $(GO) tool mygo dev cmd/enowx
lint:
$(GO) vet ./...
$(GO) run honnef.co/go/tools/cmd/staticcheck@v0.8.2 ./...
fmt:
gofmt -w .
run-app:
$(GO) run ./cmd/enowx
run-daemon:
$(GO) run ./cmd/enowxd serve
clean:
rm -rf $(BIN)