feat(build): add Android build targets
Enable cross-compiling the launcher and main binary for Android (arm64), and exclude desktop systray code from Android builds.
This commit is contained in:
parent
054b55fdfc
commit
47f68e0f8a
3 changed files with 20 additions and 2 deletions
18
Makefile
18
Makefile
|
|
@ -125,6 +125,17 @@ build-launcher:
|
|||
@ln -sf picoclaw-launcher-$(PLATFORM)-$(ARCH) $(BUILD_DIR)/picoclaw-launcher
|
||||
@echo "Build complete: $(BUILD_DIR)/picoclaw-launcher"
|
||||
|
||||
## build-launcher-android: Build picoclaw-launcher for Android ARM64
|
||||
build-launcher-android:
|
||||
@echo "Building picoclaw-launcher for android/arm64..."
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
@if [ ! -f web/backend/dist/index.html ]; then \
|
||||
echo "Building frontend..."; \
|
||||
cd web/frontend && pnpm install && pnpm build:backend; \
|
||||
fi
|
||||
GOOS=android GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/picoclaw-launcher-android-arm64 ./web/backend
|
||||
@echo "Build complete: $(BUILD_DIR)/picoclaw-launcher-android-arm64"
|
||||
|
||||
## build-whatsapp-native: Build with WhatsApp native (whatsmeow) support; larger binary
|
||||
build-whatsapp-native: generate
|
||||
## @echo "Building $(BINARY_NAME) with WhatsApp native for $(PLATFORM)/$(ARCH)..."
|
||||
|
|
@ -169,6 +180,13 @@ build-linux-mipsle: generate
|
|||
build-pi-zero: build-linux-arm build-linux-arm64
|
||||
@echo "Pi Zero 2 W builds: $(BUILD_DIR)/$(BINARY_NAME)-linux-arm (32-bit), $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 (64-bit)"
|
||||
|
||||
## build-android-arm64: Build for Android ARM64
|
||||
build-android: generate
|
||||
@echo "Building for android/arm64..."
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
GOOS=android GOARCH=arm64 $(GO) build -ldflags "$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME)-android-arm64 ./$(CMD_DIR)
|
||||
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)-android-arm64"
|
||||
|
||||
## build-all: Build picoclaw for all platforms
|
||||
build-all: generate
|
||||
@echo "Building for multiple platforms..."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//go:build (!darwin && !freebsd) || cgo
|
||||
//go:build (!darwin && !freebsd && !android) || cgo
|
||||
|
||||
package main
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//go:build (darwin || freebsd) && !cgo
|
||||
//go:build (darwin || freebsd || android) && !cgo
|
||||
|
||||
package main
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue