-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (31 loc) · 1.29 KB
/
Makefile
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
.PHONY: all run dev debug web prepare clean test release build build-dev check
COMMIT = $(shell git rev-parse --short HEAD)
LDFLAGS = -X main.Commit=$(COMMIT) -X main.Version=$(VERSION)
all: torresmo
torresmo: prepare static/dist/bundle.js
time go build -ldflags="-s -w $(LDFLAGS)" -o torresmo cmd/torresmo/*.go
torresmo-dev: web
time go build -ldflags="$(LDFLAGS)" -race -o torresmo-dev cmd/torresmo/*.go
build: torresmo
build-dev: torresmo-dev
run: torresmo
./torresmo server --discovery --serve --out=downloads --torrent-files=downloads/.torrents --addr=:8000 --upload-limit=900 --download-limit=90000
dev: torresmo-dev
./torresmo-dev server --gui --discovery --serve --out=downloads --torrent-files=downloads/.torrents --addr=:8000 --upload-limit=900 --download-limit=90000
debug: torresmo-dev
./torresmo-dev server --debug --gui --discovery --serve --out=downloads --torrent-files=downloads/.torrents --addr=:8000 --upload-limit=900 --download-limit=90000
web: static/dist/bundle.js
static/dist/bundle.js:
@(cd static; yarn && yarn build)
check:
go fmt ./...
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck -- $$(go list ./...)
prepare: check
go mod tidy
test:
go test ./...
clean:
rm -rf torresmo torresmo-dev static/dist/bundle.js dist/* 2>/dev/null
release:
/bin/sh release.sh