diff --git a/.gitignore b/.gitignore index 50c72fb..d87447d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/internals-*.db +/internals-*.db.lz diff --git a/Makefile b/Makefile index 51e6129..bfc535c 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,29 @@ MY_INTERNALS = $(HOME)/Library/Mobile\ Documents/com~apple~TextEdit/Documents/Apple\ Internals.rtf -DB = internals-$(shell sw_vers -productVersion).db +DB := $(if $(DB),$(DB:.lz=),internals-$(shell sw_vers -productVersion).db) DB_TARGETS = db_files .PHONY: all $(DB_TARGETS) +.INTERMEDIATE: $(DB) -all: internals.txt $(DB) +all: internals.txt $(DB).lz ifneq ($(wildcard $(MY_INTERNALS)),) internals.txt: $(MY_INTERNALS) textutil -cat txt "$<" -output $@ endif +ifneq ($(wildcard $(DB).lz),) +$(DB): $(DB).lz + compression_tool -decode -i $< -o $@ +else $(DB): @$(MAKE) --silent --jobs=1 $(DB_TARGETS) | sqlite3 -bail $@ +$(DB).lz: $(DB) + compression_tool -encode -i $< -o $@ + tmutil addexclusion $@ +endif + # MARK: - data extraction helpers