build(makefile): make windows recipes shell-safe

- avoid backslash line-continuation in Windows build-launcher recipe

- replace cmd-specific if-not-exist with PowerShell check in web build-frontend
This commit is contained in:
SiYue 2026-04-24 15:53:15 +08:00
parent 83c79087cd
commit 43a8d27798
2 changed files with 2 additions and 7 deletions

View file

@ -207,12 +207,7 @@ build-launcher:
@echo "Building picoclaw-launcher for $(PLATFORM)/$(ARCH)..."
ifeq ($(OS),Windows_NT)
@$(POWERSHELL) "New-Item -ItemType Directory -Force -Path '$(BUILD_DIR)' | Out-Null"
@$(MAKE) -C web build \
PLATFORM="$(PLATFORM)" \
ARCH="$(ARCH)" \
EXT="$(EXT)" \
OUTPUT="$(CURDIR)/$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)" \
GO_BUILD_TAGS="$(GO_BUILD_TAGS)"
@$(MAKE) -C web build PLATFORM="$(PLATFORM)" ARCH="$(ARCH)" EXT="$(EXT)" OUTPUT="$(CURDIR)/$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)" GO_BUILD_TAGS="$(GO_BUILD_TAGS)"
@$(POWERSHELL) "Copy-Item -LiteralPath '$(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH)$(EXT)' -Destination '$(BUILD_DIR)/picoclaw-launcher$(EXT)' -Force"
else
@mkdir -p $(BUILD_DIR)

View file

@ -163,7 +163,7 @@ endif
build-frontend:
ifeq ($(OS),Windows_NT)
@if not exist "$(FRONTEND_DIR)\node_modules" (echo Installing frontend dependencies... && cd $(FRONTEND_DIR) && pnpm install --frozen-lockfile --store-dir .pnpm-store) else echo Frontend dependencies already installed.
@$(POWERSHELL) "$$frontend='$(FRONTEND_DIR)'; if (-not (Test-Path -LiteralPath ($$frontend + '/node_modules'))) { Write-Host 'Installing frontend dependencies...'; Push-Location $$frontend; try { pnpm install --frozen-lockfile --store-dir .pnpm-store } finally { Pop-Location } } else { Write-Host 'Frontend dependencies already installed.' }"
else
@if [ ! -d $(FRONTEND_DIR)/node_modules ] || \
[ $(FRONTEND_DIR)/package.json -nt $(FRONTEND_DIR)/node_modules ] || \