-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (62 loc) · 2.17 KB
/
Makefile
File metadata and controls
81 lines (62 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ============================
# Multi-Arch Flutter Build Makefile
# For M2 Mac + Colima
# ============================
SERVICE := flutter-build
IMAGE := flutter-linux
ARM_PROFILE := flutter-arm
AMD_PROFILE := flutter-amd
# ----------------------------
# Colima Profile Helpers
# ----------------------------
colima-stop:
@echo "🛑 Stopping Colima..."
@colima stop || true
@sleep 2
colima-arm: colima-stop
@echo "🐧 Starting Colima (ARM64)..."
@colima start --profile flutter-arm --arch aarch64 --vm-type=qemu --cpu 4 --memory 8
@docker info | grep Architecture
colima-amd: colima-stop
@echo "💻 Starting Colima (x86_64)..."
@colima start --profile flutter-amd --arch x86_64 --vm-type=qemu --cpu 4 --memory 8
@docker info | grep Architecture
# Convenience shortcuts
arm: colima-arm
amd: colima-amd
# ----------------------------
# Docker Image Builds
# ----------------------------
image-arm: arm
@echo "🐳 Building ARM64 Docker image..."
docker buildx build --platform linux/arm64 -t $(IMAGE):arm64 --load .
image-amd: amd
@echo "🐳 Building x86-64 Docker image..."
docker buildx build --platform linux/amd64 -t $(IMAGE):amd64 --load .
# ----------------------------
# Flutter Builds
# ----------------------------
build-arm: arm
@echo "🚀 Building Flutter Linux ARM64..."
TARGETARCH=arm64 docker compose run --rm $(SERVICE) bash -c "flutter pub get && ./flutter_with_commit.sh build linux --release"
build-amd: amd
@echo "🚀 Building Flutter Linux x86_64..."
TARGETARCH=amd64 docker compose run --rm $(SERVICE) bash -c "flutter pub get && ./flutter_with_commit build linux --release"
dual-build: build-arm build-amd
@echo "🎉 Dual build complete!"
# ----------------------------
# Shells
# ----------------------------
shell-arm: arm
docker compose run --rm $(SERVICE)
shell-amd: amd
docker compose run --rm $(SERVICE)
# ----------------------------
# Clean All Caches
# ----------------------------
clean:
@echo "🧹 Cleaning all containers, volumes, and caches..."
docker compose down -v || true
docker volume rm -f flutter_pub_cache_amd64 flutter_pub_cache_arm64 \
flutter_sdk_cache_amd64 flutter_sdk_cache_arm64 || true
docker image prune -f