forked from kasbert/OS-X-SAT-SMART-Driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
73 lines (60 loc) · 2.63 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
all: build pkg dmg
CONFIGURATION=Debug
SDK=macosx10.6
TITLE=SATSMARTDriver
ifneq ($(CONFIGURATION),Release)
VERSIONPOSTFIX := $(VERSIONPOSTFIX)-$(CONFIGURATION)
endif
ifneq ($(SDK),macosx10.6)
VERSIONPOSTFIX := $(VERSIONPOSTFIX)-$(SDK)
endif
KEXTDIR=/Library/Extensions
build:
rm -rf SATSMARTDriver/build
(cd SATSMARTDriver; xcodebuild -configuration $(CONFIGURATION) -project SATSMARTDriver.xcodeproj)
version:
$(eval VERSION := $(shell cat SATSMARTDriver/build/$(CONFIGURATION)/SATSMARTDriver.kext/Contents/Info.plist | xpath "//string[preceding-sibling::key[1]='CFBundleVersion']/text()"))
echo VERSION $(VERSION)
$(eval PKG := $(TITLE)-$(VERSION)-$(CONFIGURATION).pkg)
echo PKG $(PKG)
#pkgbuild --analyze --root Root SATSMARTDriver.plist
#productbuild --synthesize --package SATSMARTDriver.pkg Distribution.xml
pkg: version
rm -rf Root $(PKG)
mkdir Root
(cd SATSMARTDriver; xcodebuild -configuration $(CONFIGURATION) -project SATSMARTDriver.xcodeproj install DSTROOT=../Root)
rm -f Root/usr/local/bin/smart_sample
rm -f Root/usr/local/bin/set_properties
mv Root/System/Library/Extensions/SATSMARTLib.plugin Root/Library/Extensions/
pkgbuild --root Root --component-plist SATSMARTDriver.plist --scripts Resources --identifier fi.dungeon.SATSMARTDriver SATSMARTDriver.pkg
productbuild --distribution ./Distribution.xml --package-path . $(PKG)
#/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker --doc SATSMARTDriver.pmdoc --out $(PKG)
dmg: version
echo VERSION $(VERSION)$(VERSIONPOSTFIX)
./mkdmg $(PKG) 0 $(TITLE) $(VERSION)$(VERSIONPOSTFIX)
unmount:
ioreg -r -c IOSCSIPeripheralDeviceType00 -l | grep "BSD Name" | cut -d'"' -f4 | while read a; do diskutil unmountDisk "$$a" || exit 1; done
unload: unmount
-sudo kextunload -v -b fi.dungeon.driver.SATSMARTDriver
-sudo kextunload -v -b org.dungeon.driver.SATSMARTDriver
realinstall: unload
sudo cp -R SATSMARTDriver/build/$(CONFIGURATION)/SATSMARTDriver.kext $(KEXTDIR)
sudo cp -R SATSMARTDriver/build/$(CONFIGURATION)/SATSMARTLib.plugin $(KEXTDIR)
sync
sudo kextutil -t $(KEXTDIR)/SATSMARTDriver.kext
install: unload
sudo rm -rf /tmp/SATSMARTDriver.kext
sudo cp -R SATSMARTDriver/build/$(CONFIGURATION)/SATSMARTDriver.kext /tmp
sudo cp -R SATSMARTDriver/build/$(CONFIGURATION)/SATSMARTLib.plugin $(KEXTDIR)
sync
sudo kextutil -t /tmp/SATSMARTDriver.kext
uninstall: unload
sudo rm -rf $(KEXTDIR)/SATSMARTDriver.kext
sudo rm -rf $(KEXTDIR)/SATSMARTLib.plugin
sudo rm -rf /tmp/SATSMARTDriver.kext
clean:
rm -rf SATSMARTDriver/build
rm -rf Root
rm -fr SATSMARTDriver-*pkg
bump-version:
cd SATSMARTDriver; /Developer/usr/bin/agvtool new-version -all 0.11