Skip to content

Commit 8fb1082

Browse files
authored
chore: add Makefile and restructure install.sh for /Applications install (#43)
- install.sh (default): builds .app bundle via build.sh, copies to /Applications, and launches. Permissions are granted directly to VocaMac — no terminal permission workarounds needed. - install.sh --cli: keeps the old behavior — installs vocamac and vocamac-build CLI commands to ~/.local/bin - Makefile: make install, make build, make install-cli, make test, make run, make clean, make help - Updated README Quick Start: DMG as Option 1, make install as Option 2, make install-cli as Option 3 - Updated AGENTS.md and ARCHITECTURE.md build sections
1 parent 6b2974b commit 8fb1082

5 files changed

Lines changed: 233 additions & 113 deletions

File tree

AGENTS.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ VocaMac/
4848
│ └── Resources/ # Bundled resources (.gitkeep placeholder)
4949
├── Tests/VocaMacTests/ # Unit tests
5050
├── web/ # Static website (HTML/CSS/JS, deployed to GitHub Pages)
51-
├── scripts/ # build.sh, install.sh
51+
├── Makefile # make build, install, test, clean
52+
├── scripts/ # build.sh, install.sh, uninstall.sh
5253
├── docs/ # ARCHITECTURE.md, DATA_MODEL.md, PRD.md
5354
├── Package.swift # SPM manifest
5455
└── VocaMac.entitlements # App sandbox entitlements
@@ -59,20 +60,28 @@ VocaMac/
5960
## Build & Run
6061

6162
```bash
62-
# Build (debug)
63-
swift build
63+
# Build + install to /Applications (recommended)
64+
make install
6465

65-
# Build (release)
66-
swift build -c release
66+
# Build .app bundle in repo root (fast dev iteration)
67+
make build
68+
69+
# Install CLI commands to ~/.local/bin
70+
make install-cli
6771

6872
# Run tests
69-
swift test
73+
make test
74+
75+
# Clean build artifacts
76+
make clean
77+
```
7078

71-
# Build app bundle (creates VocaMac.app)
72-
./scripts/build.sh
79+
Or use the scripts directly:
7380

74-
# Install via script
75-
./scripts/install.sh
81+
```bash
82+
./scripts/build.sh # Build .app bundle (dev)
83+
./scripts/install.sh # Build + install to /Applications
84+
./scripts/install.sh --cli # Install CLI commands
7685
```
7786

7887
The project builds on **macOS only** (requires AppKit, CoreML, AVFoundation). CI runs on `macos-15`.

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# VocaMac — Makefile
2+
# Run `make help` for available commands.
3+
4+
.PHONY: build install install-cli test clean run help
5+
6+
## Build .app bundle in repo root (fast, for development)
7+
build:
8+
@./scripts/build.sh
9+
10+
## Build and install to /Applications (recommended for first-time setup)
11+
install:
12+
@./scripts/install.sh
13+
14+
## Install CLI commands (vocamac, vocamac-build) to ~/.local/bin
15+
install-cli:
16+
@./scripts/install.sh --cli
17+
18+
## Run tests
19+
test:
20+
@swift test
21+
22+
## Remove build artifacts
23+
clean:
24+
@echo "🧹 Cleaning build artifacts..."
25+
@swift package clean
26+
@rm -rf VocaMac.app
27+
@rm -rf .build
28+
@echo "✅ Clean complete"
29+
30+
## Launch the locally built .app (build first with `make build`)
31+
run:
32+
@open VocaMac.app 2>/dev/null || (echo "❌ VocaMac.app not found. Run 'make build' first." && exit 1)
33+
34+
## Show this help
35+
help:
36+
@echo "VocaMac — Available Commands"
37+
@echo ""
38+
@echo " make build Build .app bundle (fast, for development)"
39+
@echo " make install Build + install to /Applications (recommended)"
40+
@echo " make install-cli Install CLI commands to ~/.local/bin"
41+
@echo " make test Run tests"
42+
@echo " make run Launch the locally built .app"
43+
@echo " make clean Remove build artifacts"
44+
@echo " make help Show this help"
45+
@echo ""
46+
@echo "Quick start: make install"

README.md

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -134,34 +134,29 @@ VocaMac requires three macOS permissions:
134134
4. **Open** VocaMac from Applications (right-click → Open on first launch)
135135
5. **Grant permissions** — Microphone, Accessibility, and Input Monitoring when prompted
136136

137-
### Option 2: Build from Source
137+
### Option 2: Build from Source (Recommended)
138138

139139
```bash
140-
# Clone the repository
141140
git clone https://github.com/jatinkrmalik/vocamac.git
142141
cd vocamac
143-
144-
# Build the app bundle
145-
./scripts/build.sh
146-
147-
# Launch VocaMac
148-
open VocaMac.app
142+
make install
149143
```
150144

151-
**Or use the install script** for a CLI-based workflow:
152-
153-
```bash
154-
# Build + install `vocamac` command to ~/.local/bin
155-
./scripts/install.sh
145+
This builds VocaMac, installs it to `/Applications`, and launches it. Permissions are granted directly to VocaMac — just like the DMG method.
156146

157-
# Launch in background
158-
vocamac &
147+
### Option 3: CLI Commands (For Developers)
159148

160-
# Rebuild anytime after pulling updates
161-
vocamac-build
149+
```bash
150+
git clone https://github.com/jatinkrmalik/vocamac.git
151+
cd vocamac
152+
make install-cli
162153
```
163154

164-
> **Permissions note:** When running from terminal, macOS assigns permissions to your **terminal app** (Terminal, iTerm2, etc.) rather than VocaMac itself. Grant Microphone, Accessibility, and Input Monitoring to your terminal app instead.
155+
This installs two commands to `~/.local/bin`:
156+
- `vocamac &` — Launch VocaMac in background
157+
- `vocamac-build` — Rebuild from source after pulling updates
158+
159+
> **Permissions note:** In CLI mode, macOS assigns permissions to your **terminal app** (Terminal, iTerm2, etc.) rather than VocaMac itself. Grant Microphone, Accessibility, and Input Monitoring to your terminal app instead.
165160
166161
### First Launch
167162

@@ -291,9 +286,10 @@ VocaMac/
291286
│ └── Resources/
292287
├── Tests/
293288
│ └── VocaMacTests/
289+
├── Makefile # make build, install, test, clean
294290
├── scripts/
295-
│ ├── build.sh # Build .app bundle
296-
│ ├── install.sh # Install to ~/.local/bin
291+
│ ├── build.sh # Build .app bundle (dev)
292+
│ ├── install.sh # Install to /Applications or CLI
297293
│ └── uninstall.sh # Full uninstall & cleanup
298294
├── web/ # Marketing website (vocamac.com)
299295
├── docs/
@@ -306,23 +302,13 @@ VocaMac/
306302
### Build Commands
307303

308304
```bash
309-
# Debug build
310-
swift build
311-
312-
# Release build (optimized)
313-
swift build -c release
314-
315-
# Run
316-
swift run VocaMac
317-
318-
# Run tests (requires Xcode)
319-
swift test
320-
321-
# Build .app bundle
322-
./scripts/build.sh
323-
324-
# Install launcher scripts to ~/.local/bin
325-
./scripts/install.sh
305+
make install # Build + install to /Applications (recommended)
306+
make install-cli # Install CLI commands to ~/.local/bin
307+
make build # Build .app bundle in repo root (dev iteration)
308+
make test # Run tests
309+
make run # Launch the locally built .app
310+
make clean # Remove build artifacts
311+
make help # Show all commands
326312
```
327313

328314
### Uninstall

docs/ARCHITECTURE.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -448,17 +448,23 @@ Package.swift
448448
### 7.2 Build Commands
449449

450450
```bash
451-
# Debug build
452-
swift build
451+
# Build + install to /Applications (recommended)
452+
make install
453453

454-
# Release build (optimized)
455-
swift build -c release
454+
# Build .app bundle in repo root (fast dev iteration)
455+
make build
456+
457+
# Install CLI commands to ~/.local/bin
458+
make install-cli
456459

457-
# Run
458-
swift run VocaMac
460+
# Run tests
461+
make test
459462

460-
# Create app bundle (requires additional scripting)
461-
./scripts/build.sh
463+
# Debug build (SPM only, no .app bundle)
464+
swift build
465+
466+
# Release build (SPM only, no .app bundle)
467+
swift build -c release
462468
```
463469

464470
### 7.3 Distribution Strategy (MVP)

0 commit comments

Comments
 (0)