-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (36 loc) · 1.43 KB
/
Copy pathMakefile
File metadata and controls
45 lines (36 loc) · 1.43 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
# Juju Makefile
# Build, install, and run without opening Xcode.
#
# Usage:
# make — build Release and copy to ~/Downloads, then open
# make build — build Release only
# make install — copy the built .app to ~/Downloads
# make run — open the app from ~/Downloads
# make release — copy the built .app to /Applications (for final releases)
# make clean — remove the app from ~/Downloads and the build/ directory
PROJECT = Juju.xcodeproj
SCHEME = Juju
CONFIG = Release
BUILD_DIR = $(shell xcodebuild -project $(PROJECT) -scheme $(SCHEME) -configuration $(CONFIG) -showBuildSettings 2>/dev/null | grep '^ *BUILT_PRODUCTS_DIR' | awk '{print $$NF}')
APP = Juju.app
DST = $(HOME)/Downloads/$(APP)
.PHONY: all build install run release clean
all: build install run
build:
xcodebuild -project $(PROJECT) -scheme $(SCHEME) -configuration $(CONFIG) build
install: build
@if [ -d "$(DST)" ]; then rm -rf "$(DST)"; fi
cp -R "$(BUILD_DIR)/$(APP)" "$(DST)"
@echo "Installed to $(DST)"
run: install
open "$(DST)"
release: build
@if [ -d "/Applications/$(APP)" ]; then \
echo "Removing previous /Applications/$(APP)..."; \
sudo rm -rf "/Applications/$(APP)"; \
fi
sudo cp -R "$(BUILD_DIR)/$(APP)" "/Applications/"
@echo "Installed to /Applications/$(APP)"
clean:
@if [ -d "$(DST)" ]; then rm -rf "$(DST)" && echo "Removed $(DST)"; fi
@if [ -d "build" ]; then rm -rf build && echo "Removed build/"; fi