forked from EmbarkStudios/wg-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (36 loc) · 1.18 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
48
49
50
# Parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOGET=$(GOCMD) get
BINARY_NAME=wireguard-ui
.PHONY: build container ui assets
all: build
clean:
$(GOCLEAN)
rm -rf bin
rm -rf ui/node_modules ui/dist
ui:
cd ui && npm install && npm run build
assets:
$(GOGET) github.com/go-bindata/go-bindata/...
$(GOGET) github.com/elazarl/go-bindata-assetfs/...
go-bindata-assetfs -prefix ui/dist ui/dist
build: ui assets
CGO_ENABLED=0 $(GOBUILD) -o bin/$(BINARY_NAME) -v
build-amd64: ui assets
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/$(BINARY_NAME)-amd64 -v
build-armv5: ui assets
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 $(GOBUILD) -o bin/$(BINARY_NAME)-armv5 -v
build-armv6: ui assets
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o bin/$(BINARY_NAME)-armv6 -v
build-armv7: ui assets
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -o bin/$(BINARY_NAME)-armv7 -v
build-armv8: ui assets
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GOBUILD) -o bin/$(BINARY_NAME)-armv8 -v
container:
docker build -t wireguard-ui .
run-dev:
sudo ./bin/$(BINARY_NAME) --log-level=debug --dev-ui-server=http://localhost:5000
run-dev-ui:
cd ui && npm run dev