-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
108 lines (91 loc) · 4.08 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
ifndef EMACSPEAK_DIR
$(error EMACSPEAK_DIR is not set)
endif
EMACSPEAK := $(EMACSPEAK_DIR)
SERVERS := $(EMACSPEAK)/servers
LISP := $(EMACSPEAK)/lisp
quick: debug
release: clean
@swift build -c release
debug: clean
@swift build
support-files:
@cp cloud-swiftmac $(SERVERS)/cloud-swiftmac
@cp swiftmac-voices.el $(LISP)/swiftmac-voices.el
@cp log-swiftmac $(SERVERS)/log-swiftmac
@sed -i '' '/swiftmac/d' $(SERVERS)/.servers
@echo "swiftmac" >> $(SERVERS)/.servers
@echo "log-swiftmac" >> $(SERVERS)/.servers
@echo "cloud-swiftmac" >> $(SERVERS)/.servers
@sort -o $(SERVERS)/.servers $(SERVERS)/.servers
install: release support-files backup-if-exists
@cp .build/release/swiftmac $(SERVERS)/swiftmac
@cp -rf .build/release/ogg.framework $(SERVERS)/ogg.framework
@cp -rf .build/release/vorbis.framework $(SERVERS)/vorbis.framework
install-debug: debug support-files backup-if-exists
@cp .build/debug/swiftmac $(SERVERS)/swiftmac
backup-if-exists:
@ if [ -f $(SERVERS)/swiftmac ]; then cp $(SERVERS)/swiftmac \
$(SERVERS)/swiftmac.last_version; fi
restore-from-backup:
@if [ -f $(SERVERS)/swiftmac.last_version ]; then \
cp $(SERVERS)/swiftmac.last_version $(SERVERS)/swiftmac
fi
tidy:
@swift-format Package.swift > temp
@cp temp Package.swift
@swift-format Sources/SwiftMacPackage/logger.swift > temp
@cp temp Sources/SwiftMacPackage/logger.swift
@swift-format Sources/SwiftMacPackage/statestore.swift > temp
@cp temp Sources/SwiftMacPackage/statestore.swift
@swift-format Sources/SwiftMacPackage/main.swift > temp
@cp temp Sources/SwiftMacPackage/main.swift
@swift-format Sources/SwiftMacPackage/toneplayer.swift > temp
@cp temp Sources/SwiftMacPackage/toneplayer.swift
@rm temp
contribute: tidy
@mkdir -p ~/Projects/others/emacspeak/servers/mac-swiftmac/
@rm -rf ~/Projects/others/emacspeak/servers/mac-swiftmac/*
@cp -Rvf * ~/Projects/others/emacspeak/servers/mac-swiftmac
@cp -f .gitignore ~/Projects/others/emacspeak/servers/mac-swiftmac
@cp -f .gitignore ~/Projects/others/emacspeak/servers/mac-swiftmac
@cp -f Makefile.emacspeak ~/Projects/others/emacspeak/servers/mac-swiftmac/Makefile
@cp -f Readme.emacspeak.org ~/Projects/others/emacspeak/servers/mac-swiftmac/Readme.org
@cp -f cloud-swiftmac ~/Projects/others/emacspeak/servers/cloud-swiftmac
@cp -f swiftmac-voices.el ~/Projects/others/emacspeak/lisp/
@cp -f log-swiftmac ~/Projects/others/emacspeak/servers/log-swiftmac
@rm -f ~/Projects/others/emacspeak/servers/Readme.emacspeak.org
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/Readme.emacspeak.org
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/get-emacspeak-path.sh
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/get-emacspeak-path.el
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/Package.resolved
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/cloud-swiftmac
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/Design.org
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/Goals.org
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/log-swiftmac
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/Makefile.emacspeak
@rm -f ~/Projects/others/emacspeak/servers/mac-swiftmac/swiftmac-voices.el
clean:
@swift package clean
@rm -rf .build
@rm -rf Package.resolved
super-nuke: clean
@rm -rf ~/Library/Developer/Xcode/DerivedData
@rm -rf ~/Library/Caches/org.swift.swiftpm
@echo "Cache cleared and project rebuilt."
GITHUB_USER = robertmeta
REPO_NAME = swiftmac
LATEST_RELEASE_URL = https://api.github.com/repos/$(GITHUB_USER)/$(REPO_NAME)/releases/latest
DOWNLOAD_URL = $(shell curl -s $(LATEST_RELEASE_URL) | grep "browser_download_url" | cut -d '"' -f 4)
.PHONY: download_latest_release
download-latest-release:
@echo "Fetching latest release download URL..."
@echo "Latest release URL: $(DOWNLOAD_URL)"
@echo "Downloading latest release..."
@curl -L -o latest-release.tar.gz $(DOWNLOAD_URL)
@echo "Download complete. Saved as latest-release.tar.gz"
install-binary: download-latest-release
@tar -zxf latest-release.tar.gz
@cp -rvf swiftmac/* $(EMACSPEAK)/servers
@rm latest-release.tar.gz
@rm -rf swiftmac/