forked from Carthage/Carthage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (37 loc) · 1.6 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
XCODEFLAGS=-workspace 'Carthage.xcworkspace' -scheme 'carthage'
TEMPORARY_FOLDER=/tmp/Carthage.dst
BUILT_BUNDLE=$(TEMPORARY_FOLDER)/Applications/carthage.app
CARTHAGEKIT_BUNDLE=$(BUILT_BUNDLE)/Contents/Frameworks/CarthageKit.framework
CARTHAGE_EXECUTABLE=$(BUILT_BUNDLE)/Contents/MacOS/carthage
FRAMEWORKS_FOLDER=/Library/Frameworks
BINARIES_FOLDER=/usr/local/bin
OUTPUT_PACKAGE=Carthage.pkg
VERSION_STRING=$(shell agvtool what-marketing-version -terse1)
.PHONY: all bootstrap clean install package test uninstall
all: bootstrap
xcodebuild $(XCODEFLAGS) build
bootstrap:
script/bootstrap
test: clean bootstrap
xcodebuild $(XCODEFLAGS) test
clean:
rm -f "$(OUTPUT_PACKAGE)"
rm -rf "$(TEMPORARY_FOLDER)"
xcodebuild $(XCODEFLAGS) clean
install: clean bootstrap
xcodebuild $(XCODEFLAGS) install
mkdir -p "$(FRAMEWORKS_FOLDER)"
rm -rf "$(FRAMEWORKS_FOLDER)/CarthageKit.framework"
cp -PR "$(CARTHAGEKIT_BUNDLE)" "$(FRAMEWORKS_FOLDER)/"
install -d "$(BINARIES_FOLDER)"
install -CSs "$(CARTHAGE_EXECUTABLE)" "$(BINARIES_FOLDER)/"
uninstall:
rm -rf "$(FRAMEWORKS_FOLDER)/CarthageKit.framework"
rm -f "$(BINARIES_FOLDER)/carthage"
package: clean bootstrap
xcodebuild $(XCODEFLAGS) install
mkdir -p "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)"
mv -f "$(CARTHAGEKIT_BUNDLE)" "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/CarthageKit.framework"
mv -f "$(CARTHAGE_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/carthage"
rm -rf "$(BUILT_BUNDLE)"
productbuild --root "$(TEMPORARY_FOLDER)" "/" --identifier "org.carthage.carthage" --version "$(VERSION_STRING)" "$(OUTPUT_PACKAGE)"