-
-
Notifications
You must be signed in to change notification settings - Fork 172
/
Makefile
90 lines (75 loc) · 2.71 KB
/
Makefile
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
# Makefile for Platypus
XCODE_PROJ := Platypus.xcodeproj
BUILD_DIR := $(PWD)/products
TEST_TARGET := "CLT Tests"
PLISTBUDDY := "/usr/libexec/PlistBuddy"
INFOPLIST := "Application/Resources/Platypus-Info.plist"
VERSION := $(shell $(PLISTBUDDY) -c "Print :CFBundleShortVersionString" $(INFOPLIST))
APP_NAME := $(shell $(PLISTBUDDY) -c "Print :CFBundleName" $(INFOPLIST))
APP_NAME_LC := $(shell echo "$(APP_NAME)" | tr '[:upper:]' '[:lower:]')
APP_BUNDLE_NAME := $(APP_NAME).app
APP_ZIP_NAME := $(APP_NAME_LC)$(VERSION).zip
APP_SRC_ZIP_NAME := $(APP_NAME_LC)$(VERSION).src.zip
all: build_unsigned
release: build_signed archives sparkle size
clean:
xattr -w com.apple.xcode.CreatedByBuildSystem true $(BUILD_DIR)
xcodebuild clean
rm -rf $(BUILD_DIR)/*
build_signed:
@echo Building $(APP_NAME) version $(VERSION) \(signed\)
mkdir -p $(BUILD_DIR)
xattr -w com.apple.xcode.CreatedByBuildSystem true $(BUILD_DIR)
xcodebuild -parallelizeTargets \
-project "$(XCODE_PROJ)" \
-target "$(APP_NAME)" \
-configuration "Deployment" \
CONFIGURATION_BUILD_DIR="$(BUILD_DIR)" \
clean \
build
build_unsigned:
@echo Building $(APP_NAME) version $(VERSION) \(unsigned\)
mkdir -p $(BUILD_DIR)
xattr -w com.apple.xcode.CreatedByBuildSystem true $(BUILD_DIR)
xcodebuild -parallelizeTargets \
-project "$(XCODE_PROJ)" \
-target "$(APP_NAME)" \
-configuration "Deployment" \
CONFIGURATION_BUILD_DIR="$(BUILD_DIR)" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
clean \
build
archives:
@echo "Creating application archive ${APP_ZIP_NAME}..."
@cd $(BUILD_DIR); zip -q --symlinks $(APP_ZIP_NAME) -r $(APP_BUNDLE_NAME)
@echo "Creating source archive ${APP_SRC_ZIP_NAME}..."
@cd $(BUILD_DIR); zip -q --symlinks -r "${APP_SRC_ZIP_NAME}" .. \
-x *.git* -x *.zip* -x *.tgz* -x *.gz* -x *.DS_Store* \
-x *dsa_priv.pem* -x *Sparkle/dsa_priv.pem* \
-x \*build/\* -x \*Releases\* -x \*Assets\* -x \*products\* \
-x \*$(BUILD_DIR)/\*
size:
@echo "App bundle size:"
@cd $(BUILD_DIR); du -hs $(APP_BUNDLE_NAME)
@echo "Binary size:"
@cd $(BUILD_DIR); stat -f %z $(APP_BUNDLE_NAME)/Contents/MacOS/*
@echo "Archive Sizes:"
@cd $(BUILD_DIR); du -hs $(APP_ZIP_NAME)
@cd $(BUILD_DIR); du -hs $(APP_SRC_ZIP_NAME)
sparkle:
@echo Generating Sparkle signature
ruby "Sparkle/sign_update.rb" "$(BUILD_DIR)/$(APP_ZIP_NAME)" "Sparkle/dsa_priv.pem"
clt_tests:
@echo Running CLT tests
xcodebuild -parallelizeTargets \
-project "$(XCODE_PROJ)" \
-target $(TEST_TARGET) \
-configuration "Deployment" \
CONFIGURATION_BUILD_DIR="products" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
clean \
build