Skip to content

Commit

Permalink
build: Convert to building with --root, rather than with a pair of --…
Browse files Browse the repository at this point in the history
…components. Fixes #27.
  • Loading branch information
jwise committed Oct 20, 2014
1 parent 9cc6fa9 commit a4cabdf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 16 additions & 6 deletions Makefile
@@ -1,7 +1,13 @@
# You may not be able to build with a modern Xcode, since we still support 10.6.
# So, if we have Xcode 4.6 around, we should use it.
#
# You can do this by downloading Xcode 4.6.3 as a dmg from Apple, then
# copying the contents into /Applications, then taking your ancient
# MacOSX10.6.sdk that you keep kicking around, and copying it into
# /Applications/Xcode-4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/.
# Don't you love backwards compatibility?

XCODEBUILD ?= /Applications/Xcode46-DP4.app/Contents/Developer/usr/bin/xcodebuild
XCODEBUILD ?= /Applications/Xcode-4.6.3.app/Contents/Developer/usr/bin/xcodebuild

# Ok, no joy there?
ifeq (,$(wildcard $(XCODEBUILD)))
Expand All @@ -19,13 +25,17 @@ all: build/Release/HoRNDIS.kext build/signed/HoRNDIS.kext build/HoRNDIS.pkg
build/Release/HoRNDIS.kext: HoRNDIS.cpp HoRNDIS.h HoRNDIS-Info.plist HoRNDIS.xcodeproj HoRNDIS.xcodeproj/project.pbxproj
$(XCODEBUILD)

build/HoRNDIS-kext.pkg: build/Release/HoRNDIS.kext
pkgbuild --component $< --install-location /System/Library/Extensions/ $@
build/root: build/Release/HoRNDIS.kext build/signed/HoRNDIS.kext
rm -rf build/root
mkdir -p build/root/System/Library/Extensions/
cp -R build/Release/HoRNDIS.kext build/root/System/Library/Extensions/
mkdir -p build/root/Library/Extensions
cp -R build/signed/HoRNDIS.kext build/root/Library/Extensions/

build/HoRNDIS-signed-kext.pkg: build/signed/HoRNDIS.kext
pkgbuild --component $< --install-location /Library/Extensions/ $@
build/HoRNDIS-kext.pkg: build/root
pkgbuild --identifier com.joshuawise.kexts.HoRNDIS --root $< $@

build/HoRNDIS.pkg: build/HoRNDIS-kext.pkg build/HoRNDIS-signed-kext.pkg package/Distribution.xml
build/HoRNDIS.pkg: build/HoRNDIS-kext.pkg package/Distribution.xml
productbuild --distribution package/Distribution.xml --package-path build --resources package/resources $(if $(CODESIGN_INST),--sign $(CODESIGN_INST)) build/HoRNDIS.pkg

ifeq (,$(CODESIGN_KEXT))
Expand Down
10 changes: 4 additions & 6 deletions package/Distribution.xml
Expand Up @@ -3,19 +3,17 @@
<title>HoRNDIS</title>
<welcome file="intro-text.rtf" mime-type="application/rtf" />
<conclusion file="post-readme.rtf" mime-type="application/rtf" />
<pkg-ref id="kext-unsigned"/>
<options customize="never" hostArchitectures="i386,x86_64" require-scripts="false" rootVolumeOnly="true" />
<os-version min="10.6" />
<choices-outline>
<line choice="default">
<line choice="com.joshuawise.kexts.HoRNDIS"/>
</line>
</choices-outline>
<pkg-ref id="kext"/>
<choice id="default"/>
<choice id="com.joshuawise.kexts.HoRNDIS" visible="false">
<pkg-ref id="kext-unsigned"/>
<pkg-ref id="kext-signed"/>
<pkg-ref id="kext"/>
</choice>
<pkg-ref id="kext-unsigned" version="6.0.0" onConclusion="none">HoRNDIS-kext.pkg</pkg-ref>
<pkg-ref id="kext-signed" version="6.0.0" onConclusion="none">HoRNDIS-signed-kext.pkg</pkg-ref>
</installer-gui-script>
<pkg-ref id="kext" version="6.0.0" onConclusion="none">HoRNDIS-kext.pkg</pkg-ref>
</installer-gui-script>

0 comments on commit a4cabdf

Please sign in to comment.