forked from readium/swift-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (74 loc) · 2.14 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
71
72
73
74
75
76
77
78
79
80
81
version = `git describe --tags --abbrev=0 2> /dev/null`
ifdef commit
version = $(commit)
endif
help:
@echo "Usage: make <target> [lcp=<url>]\n\n\
Choose one of the following targets to generate:\n\
spm\t\t(recommended) Integration with Swift Package Manager\n\
carthage\tIntegration with Carthage\n\
cocoapods\tIntegration with CocoaPods\n\
dev\t\tIntegration with local folders (e.g. Git submodules) and SPM, for contributors\n\n\
To enable Readium LCP, provide the liblcp URL EDRLab gave you, e.g.\n\
$$ make spm lcp=https://...\n\
"
clean:
@rm -f project.yml
@rm -f Podfile*
@rm -f Cartfile*
@rm -rf Carthage
@rm -rf Pods
@rm -rf TestApp.xcodeproj
@rm -rf TestApp.xcworkspace
spm: clean
ifdef lcp
@echo "binary \"$(lcp)\"" > Cartfile
carthage update --platform ios --cache-builds
@cp Integrations/SPM/project+lcp.yml project.yml
else
@cp Integrations/SPM/project.yml .
endif
ifdef commit
@sed -i "" -e "s>VERSION>revision: $(commit)>g" project.yml
else
@sed -i "" -e "s>VERSION>from: $(version)>g" project.yml
endif
xcodegen generate
@echo "\nopen TestApp.xcodeproj"
carthage: clean
ifdef commit
@echo "github \"readium/swift-toolkit\" \"$(commit)\"" > Cartfile
else
@echo "github \"readium/swift-toolkit\" ~> $(version)" > Cartfile
endif
ifdef lcp
@cp Integrations/Carthage/project+lcp.yml project.yml
@echo "binary \"$(lcp)\"" >> Cartfile
else
@cp Integrations/Carthage/project.yml .
endif
carthage update --verbose --platform ios --use-xcframeworks --cache-builds
xcodegen generate
@echo "\nopen TestApp.xcodeproj"
cocoapods: clean
ifdef lcp
@sed -e "s>LCP_URL>$(lcp)>g" Integrations/CocoaPods/Podfile+lcp > Podfile
@cp Integrations/CocoaPods/project+lcp.yml project.yml
else
@cp Integrations/CocoaPods/project.yml .
@cp Integrations/CocoaPods/Podfile .
endif
@sed -i "" -e "s>VERSION>$(version)>g" Podfile
xcodegen generate
pod install
@echo "\nopen TestApp.xcworkspace"
dev: clean
ifdef lcp
@cp Integrations/Local/project+lcp.yml project.yml
@echo "binary \"$(lcp)\"" > Cartfile
carthage update --platform ios --cache-builds
else
@cp Integrations/Local/project.yml .
endif
xcodegen generate
@echo "\nopen TestApp.xcodeproj"