summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 37 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9c06e49..6100532 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
-.PHONY: lint lint-html lint-css lint-go lint-js
+.PHONY: lint lint-html lint-css lint-go lint-js build build-all clean deps verify
help:
- @echo "Available lint commands:"
+ @echo "Available commands:"
+ @echo " make deps - Download and verify Go dependencies"
+ @echo " make build - Build for multiple architectures (amd64, arm64)"
+ @echo " make clean - Remove build artifacts"
+ @echo " make verify - Verify Go module checksums"
@echo " make lint - Run all linters"
@echo " make lint-html - Lint HTML files (html-validate)"
@echo " make lint-css - Lint CSS files (stylelint)"
@@ -25,5 +29,36 @@ lint-js:
@echo "Linting JavaScript files..."
npx eslint static/js/*.js
+deps:
+ @echo "Downloading Go dependencies..."
+ go mod download
+ @echo "Verifying Go module checksums..."
+ go mod verify
+ @echo "Cleaning up unused dependencies..."
+ go mod tidy
+ @echo "Dependencies ready!"
+
+verify:
+ @echo "Verifying Go module checksums..."
+ go mod verify
+
+build: deps
+ @echo "Building for multiple Linux architectures..."
+ @mkdir -p dist
+ @echo "Building for Linux amd64..."
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/wg-portal-linux-amd64 main.go
+ @echo "Building for Linux arm64..."
+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/wg-portal-linux-arm64 main.go
+ @echo "Building for Linux arm..."
+ CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o dist/wg-portal-linux-arm main.go
+ @echo "Generating checksums..."
+ @cd dist && sha256sum * > checksums.txt
+ @echo "All builds complete! Check the dist/ directory."
+
+clean:
+ @echo "Cleaning build artifacts..."
+ rm -rf dist/
+ @echo "Clean complete!"
+
lint: lint-go lint-js lint-html lint-css
@echo "All linting complete!"