-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
94 lines (76 loc) · 3 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
include .env
include frontend/.env
export
.PHONY:
build-linux_64: download
@echo "[*] Building for linux x64"
@CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/linux_amd64/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-linux_386: download
@echo "[*] Building for linux i386"
@CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o dist/linux_386/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-mac: download
@echo "[*] Building for mac"
@CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o dist/darwin_amd64/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-armv5: download
@echo "[*] Building for armv5"
@CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags="-s -w" -o dist/arm_5/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-armv6: download
@echo "[*] Building for armv6"
@CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o dist/arm_6/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-armv7: download
@echo "[*] Building for armv7"
@CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o dist/arm_7/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-armv8_64: download
@echo "[*] Building for armv8_64"
@CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/arm64_8/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-darwin-apple-silicon: download
@echo "[*] Building for darwin_arm64 (apple silicon)"
@CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o dist/darwin_arm64/dascr-board
@echo "[OK] App binary was created!"
@echo "[OK] Your backend binary is at ./dist/<os>/"
build-frontend: clean-frontend
@echo "[*] Building SvelteKit App"
@cd frontend && pnpm install --silent
@NODE_ENV=production pnpm --dir "./frontend" run --silent build
@echo "[OK] SvelteKit App was built"
@echo "[OK] Serve content of ./frontend/build via a webserver"
customize-docker:
@echo "[!] Customizing Docker Image"
@scripts/customize-docker.sh
download:
@echo "[*] go mod dowload"
@go mod download
clean-backend:
@echo "[*] Cleanup Backend App"
@rm -f *.db
@rm -rf uploads
@rm -rf ./dist
@echo "[OK] Cleanup done"
clean-frontend:
@echo "[*] Cleanup SvelteKit App"
@rm -rf ./frontend/build
@echo "[OK] Cleanup done"
clean-all: clean-backend clean-frontend
run-dev-backend:
@echo "[*] Starting Backend Development"
@go run main.go
run-dev-frontend:
@echo "[*] Starting Frontend Development, listening to 127.0.0.1"
@pnpm --dir "./frontend" run dev
run-docker: customize-docker
@echo "[*] Building and running Docker Image"
@docker-compose -f docker-compose-local.yml up --build