-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (102 loc) · 3.5 KB
/
Copy pathMakefile
File metadata and controls
114 lines (102 loc) · 3.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.PHONY: help build run clean sign sign-dev sign-dist install dmg open check
# Configuration
APP_NAME = GitHubReviewManager
APP_BUNDLE = GitHubReviewManager/.build/$(APP_NAME).app
APP_PATH = $(APP_BUNDLE)/Contents/MacOS/$(APP_NAME)
INSTALL_DIR = $(HOME)/Applications
INSTALL_PATH = $(INSTALL_DIR)/$(APP_NAME).app
DMG_NAME = $(APP_NAME).dmg
DMG_VOLNAME = "GitHub Review Manager"
# Default target
help:
@echo "GitHub Review Manager - Build and Development Commands"
@echo ""
@echo "Available targets:"
@echo " make build - Build the application"
@echo " make run - Build and run the application"
@echo " make open - Open the built app (without building)"
@echo " make clean - Remove build artifacts"
@echo " make sign - Code sign with ad-hoc signature (development)"
@echo " make sign-dist - Code sign with Developer ID (requires SIGNING_IDENTITY)"
@echo " make install - Install to ~/Applications"
@echo " make dmg - Create a DMG for distribution"
@echo " make check - Check if build artifacts exist"
@echo ""
@echo "Examples:"
@echo " make run # Quick build and run"
@echo " make sign-dist SIGNING_IDENTITY='Developer ID Application: Your Name (TEAM_ID)'"
@echo ""
# Build the application
build:
@echo "Building $(APP_NAME)..."
@cd GitHubReviewManager && ./build.sh
@echo ""
@echo "Build complete: $(APP_BUNDLE)"
# Run the application (builds first)
run: build
@echo "Running $(APP_NAME)..."
@if [ -d "$(APP_BUNDLE)" ]; then \
xattr -cr "$(APP_BUNDLE)" 2>/dev/null || true; \
open "$(APP_BUNDLE)"; \
else \
echo "Error: $(APP_BUNDLE) not found. Run 'make build' first."; \
exit 1; \
fi
# Open the app without building
open:
@if [ -d "$(APP_BUNDLE)" ]; then \
xattr -cr "$(APP_BUNDLE)" 2>/dev/null || true; \
open "$(APP_BUNDLE)"; \
else \
echo "Error: $(APP_BUNDLE) not found. Run 'make build' first."; \
exit 1; \
fi
# Code sign with ad-hoc signature (for development)
sign: build
@echo "Code signing with ad-hoc signature..."
@codesign --deep --force --sign - "$(APP_BUNDLE)"
@echo "Signed: $(APP_BUNDLE)"
# Code sign with Developer ID (for distribution)
sign-dist: build
@if [ -z "$(SIGNING_IDENTITY)" ]; then \
echo "Error: SIGNING_IDENTITY is required for distribution signing."; \
echo "Example: make sign-dist SIGNING_IDENTITY='Developer ID Application: Your Name (TEAM_ID)'"; \
exit 1; \
fi
@echo "Code signing with Developer ID: $(SIGNING_IDENTITY)"
@codesign --deep --force --sign "$(SIGNING_IDENTITY)" "$(APP_BUNDLE)"
@codesign --verify --verbose "$(APP_BUNDLE)"
@echo "Signed: $(APP_BUNDLE)"
# Create DMG for distribution
dmg: build
@echo "Creating DMG: $(DMG_NAME)..."
@rm -f "$(DMG_NAME)"
@hdiutil create -volname $(DMG_VOLNAME) \
-srcfolder "$(APP_BUNDLE)" \
-ov -format UDZO \
"$(DMG_NAME)"
@echo "DMG created: $(DMG_NAME)"
# Install to /Applications
install: build
@echo "Installing $(APP_NAME) to $(INSTALL_PATH)..."
@mkdir -p "$(INSTALL_DIR)"
@rm -rf "$(INSTALL_PATH)"
@cp -R "$(APP_BUNDLE)" "$(INSTALL_PATH)"
@echo "Installed: $(INSTALL_PATH)"
@echo "You can now launch it from Applications or Spotlight."
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@rm -rf GitHubReviewManager/.build
@rm -f $(DMG_NAME)
@echo "Clean complete."
# Check if app bundle exists
check:
@if [ -d "$(APP_BUNDLE)" ]; then \
echo "✓ $(APP_BUNDLE) exists"; \
ls -lh "$(APP_BUNDLE)"; \
else \
echo "✗ $(APP_BUNDLE) not found"; \
echo "Run 'make build' to create it."; \
exit 1; \
fi