-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (53 loc) · 1.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
CONFIG=Release
BUILDDIR=DerivedData/$(CONFIG)
INSTPLUGBUILDDIR=DerivedData/$(CONFIG)
SUDO=sudo
KEXTSTAT=/usr/sbin/kextstat
KEXTUNLOAD=/sbin/kextunload
KEXTUTIL=/usr/bin/kextutil
.PHONY: all
all: delivery
.PHONY: package
package: binaries
xcodebuild -parallelizeTargets -project Installer/Plugins.xcodeproj -alltargets -configuration $(CONFIG)
packagesbuild Installer/NoSleepPkg.pkgproj
.PHONY: binaries
binaries:
xcodebuild -parallelizeTargets -project NoSleep/NoSleep.xcodeproj -alltargets -configuration $(CONFIG)
.PHONY: clean
clean:
/bin/rm -rf DerivedData Delivery
.PHONY: delivery
delivery:
$(MAKE) clean
$(MAKE) package
mkdir Delivery
cat Installer/Scripts/Common.sh > Delivery/Uninstall.command
cat Installer/Scripts/Uninstall_1.3.1.sh >> Delivery/Uninstall.command
echo >> Delivery/Uninstall.command
cat Installer/Scripts/Uninstall_Cli_1.3.0.sh >> Delivery/Uninstall.command
chmod +x Delivery/Uninstall.command
cp -r DerivedData/Installer/NoSleep.pkg Delivery/
.PHONY: dmg
dmg: delivery
if [ -e DerivedData/DMG ]; then rm -rf DerivedData/DMG; fi
mkdir -p DerivedData/DMG
./Utilities/create-dmg \
--window-size 480 300 \
--icon-size 96 \
--volname "NoSleep Extension" \
--icon "NoSleep.pkg" 160 130 \
--icon "Uninstall.command" 320 130 \
DerivedData/DMG/NoSleep.dmg \
Delivery
cp DerivedData/DMG/NoSleep.dmg Delivery
.PHONY: dk, dkc
dkc:
$(SUDO) $(KEXTUNLOAD) -b com.protech.NoSleep
$(SUDO) rm -rf $(BUILDDIR)/NoSleep.kext
dk:
#$(MAKE) clean
#CONFIG=Debug $(MAKE) all
#if [ "$(KEXTSTAT)|grep NoSleep" ]; then $(SUDO) $(KEXTUNLOAD) -b com.protech.NoSleep; fi
$(SUDO) chown -R root:wheel $(BUILDDIR)/NoSleep.kext
$(SUDO) $(KEXTUTIL) $(BUILDDIR)/NoSleep.kext