osx/Makefile

47 lines
1.1 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
2017-09-26 11:05:30 +00:00
# * the OSX installer (Install macOS High Sierra.app)
2016-09-30 05:06:32 +00:00
# * 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
2017-09-26 11:05:30 +00:00
OSX := /Applications/Install macOS High Sierra.app
2016-09-30 05:06:32 +00:00
AUTODMG := /Applications/AutoDMG.app/Contents/MacOS/AutoDMG
2017-09-26 11:05:30 +00:00
OUTPUT := $(shell date +%Y%m%d).osx.$(shell sw_vers -productVersion).adminadmin.dmg
2016-09-30 05:06:32 +00:00
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" \
2017-09-26 11:05:30 +00:00
--filesystem apfs \
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 \
"$(OSX)" \
2018-01-16 22:20:18 +00:00
"$(PWD)"/custompkg/custom.pkg \
"$(PWD)"/pkgs/*.pkg && \
cp /tmp/output.dmg "$(PWD)"/$@
2016-09-30 05:06:32 +00:00
clean:
2016-09-30 21:47:50 +00:00
rm -f *.dmg /tmp/output.dmg custompkg/*.pkg