-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (54 loc) · 2 KB
/
Makefile
File metadata and controls
65 lines (54 loc) · 2 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Makefile for hear command line tool
XCODE_PROJ := "hear.xcodeproj"
PROGRAM_NAME := "hear"
BUILD_DIR := "products"
VERSION := "0.7"
all: clean build_unsigned
release: clean build_signed archive man size
test: clean build_unsigned runtests
build_unsigned:
@mkdir -p $(BUILD_DIR)
@xattr -w com.apple.xcode.CreatedByBuildSystem true $(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)
@xattr -w com.apple.xcode.CreatedByBuildSystem true $(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:
@bash man2html.sh
runtests:
# The tests don't work in CI env due to missing permissions from macOS
echo "Running tests"
"$(BUILD_DIR)/$(PROGRAM_NAME)" --version
"$(BUILD_DIR)/$(PROGRAM_NAME)" --help
"$(BUILD_DIR)/$(PROGRAM_NAME)" --supported
"$(BUILD_DIR)/$(PROGRAM_NAME)" --audio-input-devices
clean:
xcodebuild -project "$(XCODE_PROJ)" clean
rm -rf products/* 2> /dev/null