-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
61 lines (50 loc) · 1.78 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
# Makefile for Sloth app
XCODE_PROJ := "hear.xcodeproj"
PROGRAM_NAME := "hear"
BUILD_DIR := "products"
VERSION := "0.5"
all: clean build_unsigned
release: clean build_signed archive man size
test: clean build_unsigned runtests
build_unsigned:
mkdir -p $(BUILD_DIR)
xcodebuild -project "$(XCODE_PROJ)" \
-target "$(PROGRAM_NAME)" \
-configuration "Debug" \
CONFIGURATION_BUILD_DIR="$(BUILD_DIR)" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
build
build_signed:
mkdir -p $(BUILD_DIR)
xcodebuild -parallelizeTargets \
-project "$(XCODE_PROJ)" \
-target "$(PROGRAM_NAME)" \
-configuration "Release" \
CONFIGURATION_BUILD_DIR="$(BUILD_DIR)" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES \
build
archive:
@mkdir "$(BUILD_DIR)/$(PROGRAM_NAME)-$(VERSION)"
@cp "$(BUILD_DIR)/$(PROGRAM_NAME)" "$(BUILD_DIR)/$(PROGRAM_NAME)-$(VERSION)/"
@cp "$(PROGRAM_NAME).1" "$(BUILD_DIR)/$(PROGRAM_NAME)-$(VERSION)/"
@cp "install.sh" "$(BUILD_DIR)/$(PROGRAM_NAME)-$(VERSION)/"
@cd "$(BUILD_DIR)"; zip -qy --symlinks "$(PROGRAM_NAME)-$(VERSION).zip" -r "$(PROGRAM_NAME)-$(VERSION)"
@cd "$(BUILD_DIR)"; rm -r "$(PROGRAM_NAME)-$(VERSION)"
size:
@echo "Binary size:"
@stat -f %z "$(BUILD_DIR)/$(PROGRAM_NAME)"
@echo "Archive size:"
@cd "$(BUILD_DIR)"; du -hs "$(PROGRAM_NAME)-$(VERSION).zip"
man:
/usr/bin/man ./hear.1 | ./cat2html > hear.1.html
runtests:
# The tests don't work in CI env due to missing permissions from macOS
# @echo "Running tests"
# @bash "test/test.sh"
@"$(BUILD_DIR)/$(PROGRAM_NAME)" --version
clean:
xcodebuild -project "$(XCODE_PROJ)" clean
rm -rf products/* 2> /dev/null