-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 2.38 KB
/
Makefile
File metadata and controls
56 lines (45 loc) · 2.38 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
APP_NAME := WhisperEcho
BUNDLE_ID := com.whisperecho.WhisperEcho
SCHEME := $(APP_NAME)
PROJECT := $(APP_NAME).xcodeproj
VERSION := $(shell grep MARKETING_VERSION project.yml | head -1 | sed 's/.*: *"\(.*\)"/\1/')
RELEASE_DIR := release
DERIVED_DATA := $(HOME)/Library/Developer/Xcode/DerivedData
# Find the DerivedData folder for this project
BUILD_DIR = $(shell find $(DERIVED_DATA) -maxdepth 1 -name "$(APP_NAME)-*" -type d 2>/dev/null | head -1)/Build/Products
.PHONY: all generate build release install reset-permissions run clean help
all: build ## Default: build debug
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
generate: ## Generate Xcode project from project.yml
xcodegen generate
build: generate ## Build debug configuration
xcodebuild -project $(PROJECT) -scheme $(SCHEME) -configuration Debug build
release: generate ## Build release configuration and package zip
xcodebuild -project $(PROJECT) -scheme $(SCHEME) -configuration Release build
@mkdir -p $(RELEASE_DIR)
@rm -f $(RELEASE_DIR)/$(APP_NAME)-v$(VERSION).zip
cd $(BUILD_DIR)/Release && zip -r $(CURDIR)/$(RELEASE_DIR)/$(APP_NAME)-v$(VERSION).zip $(APP_NAME).app
@echo "Packaged: $(RELEASE_DIR)/$(APP_NAME)-v$(VERSION).zip"
reset-permissions: ## Reset app permissions (Accessibility, Input Monitoring, Microphone)
@echo "Resetting permissions for $(BUNDLE_ID)..."
@tccutil reset Accessibility $(BUNDLE_ID) 2>/dev/null || true
@tccutil reset ListenEvent $(BUNDLE_ID) 2>/dev/null || true
@tccutil reset Microphone $(BUNDLE_ID) 2>/dev/null || true
@echo "Permissions reset. App will re-request on next launch."
install: release ## Build release, reset permissions, and copy to /Applications
@pkill -x $(APP_NAME) 2>/dev/null || true
@sleep 1
@echo "Resetting permissions for $(BUNDLE_ID)..."
@tccutil reset Accessibility $(BUNDLE_ID) 2>/dev/null || true
@tccutil reset ListenEvent $(BUNDLE_ID) 2>/dev/null || true
@tccutil reset Microphone $(BUNDLE_ID) 2>/dev/null || true
cp -R $(BUILD_DIR)/Release/$(APP_NAME).app /Applications/
@echo "Installed to /Applications/$(APP_NAME).app"
run: build ## Build debug and run
@pkill -x $(APP_NAME) 2>/dev/null || true
@sleep 1
open $(BUILD_DIR)/Debug/$(APP_NAME).app
clean: ## Clean build artifacts
xcodebuild -project $(PROJECT) -scheme $(SCHEME) clean
@echo "Clean complete"