-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
71 lines (61 loc) · 3.53 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
VERSION = 0.12.0
Package = com.michael.timemachine
SDK = ${THEOS}/sdks/iPhoneOS14.3.sdk
CC = xcrun -sdk $(SDK) clang -arch arm64 -arch arm64e -miphoneos-version-min=10.3 -Os
LDID = ldid
.PHONY: all clean
all: clean libTimeMachine postinst prerm TimeMachineRootListController snapshotcheck setTimeMachine TimeMachine
mkdir $(Package)_$(VERSION)_iphoneos-arm
mkdir $(Package)_$(VERSION)_iphoneos-arm/DEBIAN
cp control $(Package)_$(VERSION)_iphoneos-arm/DEBIAN
mv postinst prerm $(Package)_$(VERSION)_iphoneos-arm/DEBIAN
mkdir $(Package)_$(VERSION)_iphoneos-arm/etc
mkdir $(Package)_$(VERSION)_iphoneos-arm/etc/rc.d
mv snapshotcheck $(Package)_$(VERSION)_iphoneos-arm/etc/rc.d
mkdir $(Package)_$(VERSION)_iphoneos-arm/Library
mkdir $(Package)_$(VERSION)_iphoneos-arm/Library/LaunchDaemons
cp com.michael.TimeMachine.plist $(Package)_$(VERSION)_iphoneos-arm/Library/LaunchDaemons
mkdir $(Package)_$(VERSION)_iphoneos-arm/usr
mkdir $(Package)_$(VERSION)_iphoneos-arm/usr/bin
mv setTimeMachine $(Package)_$(VERSION)_iphoneos-arm/usr/bin
mkdir $(Package)_$(VERSION)_iphoneos-arm/usr/lib
mv libTimeMachine.dylib $(Package)_$(VERSION)_iphoneos-arm/usr/lib
mkdir $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceBundles
mkdir $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceLoader
mkdir $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceLoader/Preferences
cp -r Resources $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceBundles/TimeMachine.bundle
mv TimeMachineRootListController $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceBundles/TimeMachine.bundle/TimeMachine
cp entry.plist $(Package)_$(VERSION)_iphoneos-arm/Library/PreferenceLoader/Preferences/TimeMachine.plist
mkdir $(Package)_$(VERSION)_iphoneos-arm/usr/libexec
mv TimeMachine $(Package)_$(VERSION)_iphoneos-arm/usr/libexec
dpkg -b $(Package)_$(VERSION)_iphoneos-arm
libTimeMachine: clean
$(CC) -dynamiclib -install_name /usr/lib/libTimeMachine.dylib -compatibility_version $(VERSION) -current_version $(VERSION) -framework CoreFoundation -framework IOKit libTimeMachine.c -o libTimeMachine.dylib
strip -x libTimeMachine.dylib
$(LDID) -S libTimeMachine.dylib
postinst: libTimeMachine
$(CC) -fobjc-arc -framework Foundation libTimeMachine.dylib postinst.m -o postinst
strip postinst
$(LDID) -Sentitlements-apfs.xml postinst
prerm: libTimeMachine
$(CC) -framework CoreFoundation libTimeMachine.dylib prerm.c -o prerm
strip prerm
$(LDID) -Sentitlements-apfs.xml prerm
snapshotcheck: libTimeMachine
$(CC) -fobjc-arc -framework Foundation libTimeMachine.dylib snapshotcheck.m -o snapshotcheck
strip snapshotcheck
$(LDID) -Sentitlements-apfs.xml snapshotcheck
TimeMachineRootListController: libTimeMachine
$(CC) -dynamiclib -fobjc-arc -install_name /Library/PreferenceBundles/TimeMachine.bundle/TimeMachine -I${THEOS}/vendor/include/ -framework Foundation -F $(SDK)/System/Library/PrivateFrameworks -framework Preferences libTimeMachine.dylib TimeMachineRootListController.m -o TimeMachineRootListController
strip -x TimeMachineRootListController
$(LDID) -S TimeMachineRootListController
setTimeMachine: libTimeMachine
$(CC) -fobjc-arc -framework Foundation libTimeMachine.dylib setTimeMachine.m -o setTimeMachine
strip setTimeMachine
$(LDID) -Sentitlements-apfs.xml setTimeMachine
TimeMachine: libTimeMachine
$(CC) -framework CoreFoundation libTimeMachine.dylib TimeMachine.c -o TimeMachine
strip TimeMachine
$(LDID) -Sentitlements-apfs.xml TimeMachine
clean:
rm -rf $(Package)_* libTimeMachine.dylib postinst prerm TimeMachineRootListController snapshotcheck setTimeMachine TimeMachine