-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.OSX
62 lines (44 loc) · 1.46 KB
/
Makefile.OSX
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
MAKEFLAGS += --warn-undefined-variables
NAME=CompositeOperations
XCODEPROJ=DevelopmentApp/DevelopmentApp.xcodeproj
CONFIGURATION=Release
SCHEME=CompositeOperations-OSX
DESTINATION='platform=OS X,arch=x86_64'
FRAMEWORK_FOLDER=$(NAME).framework
### Paths
BUILD_PATH=$(PWD)/Build
BUILD_PATH_OSX=$(BUILD_PATH)/$(CONFIGURATION)-OSX
BUILD_PATH_OSX_BINARY=$(BUILD_PATH_OSX)/$(FRAMEWORK_FOLDER)/$(NAME)
DISTRIBUTION_PATH=$(PWD)/Distribution
ZIPBALL_NAME=$(NAME)-OSX.zip
ZIPBALL_PATH=$(DISTRIBUTION_PATH)/$(ZIPBALL_NAME)
### Colors
RESET=\033[0;39m
RED=\033[0;31m
GREEN=\033[0;32m
### Actions
.PHONY: default archive clean test build validate zip
default: test
archive: test build validate zip
test:
xcodebuild -project $(XCODEPROJ) \
-scheme $(SCHEME) \
-destination $(DESTINATION) \
clean test
build:
xcodebuild -project $(XCODEPROJ) \
-scheme $(SCHEME) \
-sdk macosx \
-configuration $(CONFIGURATION) \
CONFIGURATION_BUILD_DIR=$(BUILD_PATH_OSX) \
clean build
validate: validate.x86_64
validate.%:
@printf "Validating $*... "
@lipo -info $(BUILD_PATH_OSX_BINARY) | grep -q '$*' && echo "$(GREEN)Passed$(RESET)" || (echo "$(RED)Failed$(RESET)"; exit 1)
zip:
mkdir -p $(DISTRIBUTION_PATH)
cd $(BUILD_PATH_OSX) && zip -r -FS $(DISTRIBUTION_PATH)/$(ZIPBALL_NAME) $(FRAMEWORK_FOLDER)
clean:
rm -rf $(BUILD_PATH)
rm -rf $(DISTRIBUTION_PATH)