forked from Ableton/LinkKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
70 lines (58 loc) · 2.67 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
# ____ _
# | _ \ __ _ _ __ __ _ _ __ ___ ___| |_ ___ _ __ ___
# | |_) / _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
# | __/ (_| | | | (_| | | | | | | __/ || __/ | \__ \
# |_| \__,_|_| \__,_|_| |_| |_|\___|\__\___|_| |___/
#
platform = iphoneos
config = Debug
wordsize = 64
ifneq ($(MAKECMDGOALS),clean)
ifndef link_dir
$(error link_dir must be defined)
endif
endif
PLATFORM_CONFIG = $(config)-$(platform)
PROJECT_DIR=build
OUTPUT = $(PROJECT_DIR)/output
PLATFORM_OUTPUT = $(OUTPUT)/$(PLATFORM_CONFIG)
LINK_KIT = LinkKit
LINK_KIT_OUTPUT = $(OUTPUT)/$(LINK_KIT)
BUILD_CMD = /usr/bin/xcodebuild -project build/LinkKit.xcodeproj -scheme "LinkKit" -destination $(dest) -configuration $(config) -UseModernBuildSystem=YES CONFIGURATION_BUILD_DIR=$(PLATFORM_OUTPUT)
# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
# | |/ _` | '__/ _` |/ _ \ __/ __|
# | | (_| | | | (_| | __/ |_\__ \
# |_|\__,_|_| \__, |\___|\__|___/
# |___/
all: bundle
configure:
mkdir -p $(PROJECT_DIR) && cd $(PROJECT_DIR) && cmake -G Xcode -DLINK_DIR=${link_dir} ..
linkkit: configure
$(BUILD_CMD)
release:
make linkkit config=Release dest="'generic/platform=iOS'" platform=iphoneos
make linkkit config=Release dest="'generic/platform=iOS Simulator'" platform=iphonesimulator
make linkkit config=Release dest="'platform=macOS,variant=Mac Catalyst'" platform=maccatalyst
libtool $(OUTPUT)/Release-iphoneos/libLinkKit.a $(OUTPUT)/Release-iphonesimulator/libLinkKit.a -o $(OUTPUT)/libABLLink.a
mkdir -p $(OUTPUT)/Headers
cp LinkKit/*.h $(OUTPUT)/Headers/
xcodebuild -create-xcframework -library $(OUTPUT)/Release-iphoneos/libLinkKit.a -headers $(OUTPUT)/Headers -library $(OUTPUT)/Release-iphonesimulator/libLinkKit.a -headers $(OUTPUT)/Headers -library $(OUTPUT)/Release-maccatalyst/libLinkKit.a -headers $(OUTPUT)/Headers -output $(OUTPUT)/LinkKit.xcframework
bundle: release
mkdir -p $(LINK_KIT_OUTPUT)/include
cp -a ./LinkKit/ABLLink.h ./LinkKit/ABLLinkSettingsViewController.h ./LinkKit/ABLLinkUtils.h $(LINK_KIT_OUTPUT)/include
mkdir -p $(LINK_KIT_OUTPUT)/lib
cp -a $(OUTPUT)/libABLLink.a $(LINK_KIT_OUTPUT)/lib
cp -a $(OUTPUT)/LinkKit.xcframework $(LINK_KIT_OUTPUT)
rsync -R $$(git ls-files examples/LinkHut) $(LINK_KIT_OUTPUT)
cp -a LICENSE.md $(LINK_KIT_OUTPUT)
cp -a docs/Ableton_Link_Promotion.pdf $(LINK_KIT_OUTPUT)
cp -a docs/Ableton_Link_UI_Guidelines.pdf $(LINK_KIT_OUTPUT)
rsync -rv assets $(LINK_KIT_OUTPUT)
cp -a LinkKit/LinkKitResources.bundle $(LINK_KIT_OUTPUT)
echo "Zipping LinkKit..."
cd $(OUTPUT) && zip -r -9 $(LINK_KIT).zip $(LINK_KIT)
xcode: configure
open $(PROJECT_DIR)/LinkKit.xcodeproj
clean:
rm -rf ${PROJECT_DIR}