forked from sveinbjornt/hear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (44 loc) · 1.56 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
# Makefile for Sloth app
XCODE_PROJ := "hear.xcodeproj"
PROGRAM_NAME := "hear"
BUILD_DIR := "products"
VERSION := "0.2"
all: clean build_unsigned
release: clean build_signed archive 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 \
build
build_signed:
mkdir -p $(BUILD_DIR)
xcodebuild -parallelizeTargets \
-project "$(XCODE_PROJ)" \
-target "$(PROGRAM_NAME)" \
-configuration "Release" \
CONFIGURATION_BUILD_DIR="$(BUILD_DIR)" \
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"
runtests:
# The tests don't work in CI env due to missing permissions from macOS
# @echo "Running tests"
# @bash "test/test.sh"
clean:
xcodebuild -project "$(XCODE_PROJ)" clean
rm -rf products/* 2> /dev/null