osx/Makefile

48 lines
1.2 KiB
Makefile
Raw Normal View History

2016-09-30 05:06:32 +00:00
# You need to run the following to let make work:
# sudo xcodebuild -license accept
# install the following to /Applications before proceeding:
# * CreateUserPkg
# * AutoDMG.app
# * the OSX installer (Install macOS Sierra.app)
# * Xcode.app
# to /Applications before proceeding.
2016-09-30 21:47:50 +00:00
# Put additional big packages (e.g. printer drivers)
# in ~/Documents/packages.10.12/ before running
2016-09-30 05:06:32 +00:00
OSX := /Applications/Install macOS Sierra.app
AUTODMG := /Applications/AutoDMG.app/Contents/MacOS/AutoDMG
OUTPUT := $(shell date +%Y%m%d).osx.10.12.adminadmin.dmg
default: $(OUTPUT)
prepare:
sudo pmset -a sleep 180
sudo pmset -a displaysleep 180
$(AUTODMG) update
2016-09-30 21:47:50 +00:00
custompkg/custom.pkg:
cd custompkg && make
2016-09-30 05:06:32 +00:00
$(OUTPUT): prepare custompkg/custom.pkg
-$(AUTODMG) \
--log-level 7 \
--logfile - \
build \
-n "root" \
2016-09-30 21:47:50 +00:00
-u -U \
-o /tmp/output.dmg \
2016-09-30 05:06:32 +00:00
"$(OSX)" \
/Applications/Xcode.app \
/Applications/AutoDMG.app \
/Applications/CreateUserPkg.app \
"$(OSX)" \
2016-09-30 21:47:50 +00:00
~/Documents/packages.$(shell sw_vers -productVersion)/*.pkg \
$(PWD)/custompkg/custom.pkg \
$(PWD)/pkgs/*.pkg && \
2016-09-30 05:06:32 +00:00
cp /tmp/output.dmg $(PWD)/$@
clean:
2016-09-30 21:47:50 +00:00
rm -f *.dmg /tmp/output.dmg custompkg/*.pkg