Add Makefile with build targets and script to dynamically update cache version for client builds
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m20s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m20s
This commit is contained in:
40
Makefile
Normal file
40
Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
.PHONY: build-wasm build-native build-server clean update-cache
|
||||
|
||||
# Build WASM Client mit Cache-Version Update
|
||||
build-wasm: update-cache
|
||||
@echo "🔨 Building WASM Client..."
|
||||
cd cmd/client && GOOS=js GOARCH=wasm go build -o web/main.wasm
|
||||
@echo "✅ WASM build complete: cmd/client/web/main.wasm"
|
||||
|
||||
# Update Cache-Version vor dem Build
|
||||
update-cache:
|
||||
@echo "🔄 Updating cache version..."
|
||||
@./scripts/cache-version.sh
|
||||
|
||||
# Build Native Client
|
||||
build-native:
|
||||
@echo "🔨 Building Native Client..."
|
||||
cd cmd/client && go build -o ../../build/client
|
||||
@echo "✅ Native client build complete: build/client"
|
||||
|
||||
# Build Server
|
||||
build-server:
|
||||
@echo "🔨 Building Server..."
|
||||
cd cmd/server && go build -o ../../build/server
|
||||
@echo "✅ Server build complete: build/server"
|
||||
|
||||
# Build All
|
||||
build-all: build-wasm build-native build-server
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
@echo "🧹 Cleaning build artifacts..."
|
||||
rm -f cmd/client/web/main.wasm
|
||||
rm -rf build/
|
||||
@echo "✅ Clean complete"
|
||||
|
||||
# Development: Build WASM and run local server
|
||||
dev: build-wasm
|
||||
@echo "🚀 Starting development server..."
|
||||
@echo "Open http://localhost:8080 in your browser"
|
||||
cd cmd/client/web && python3 -m http.server 8080
|
||||
Reference in New Issue
Block a user