diff options
| author | Ahmed AbdelHalim <[email protected]> | 2025-09-07 17:50:55 +0200 |
|---|---|---|
| committer | Ahmed AbdelHalim <[email protected]> | 2025-09-07 17:50:55 +0200 |
| commit | c79e1049381b40bb8c71ca25d633997c4fc13dd2 (patch) | |
| tree | c93ee8f6bfd13e6ad23228b717a065ea8460b93e /Makefile | |
| parent | ff63742a2fa138c230fb2e080708d03ed888c248 (diff) | |
Update Makefile to deps/verify/build and clean tasks
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 39 |
1 files changed, 37 insertions, 2 deletions
@@ -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!" |
