1 CC ?= aarch64-apple-darwin-clang
2 STRIP ?= aarch64-apple-darwin-strip
7 TARGET_SYSROOT ?= /home/cameron/Documents/SDK/iPhoneOS14.2.sdk
8 CFLAGS ?= -arch arm64 -isysroot $(TARGET_SYSROOT) -miphoneos-version-min=13.0
10 DEB_MAINTAINER ?= Cameron Katri <me@cameronkatri.com>
11 DEB_ARCH ?= iphoneos-arm
13 DEB_SNAPRESTORE := $(SNAPRESTORE_V)
15 all: build/snaprestore
17 build/snaprestore: src/snaprestore.m src/ent.xml
19 $(CC) $(CFLAGS) -o $@ $< -framework IOKit -framework Foundation -framework CoreServices -fobjc-arc
21 $(LDID) -S$(word 2,$^) $@
23 install: build/snaprestore LICENSE
24 $(INSTALL) -Dm755 $< $(DESTDIR)$(PREFIX)/bin/snaprestore
25 $(INSTALL) -Dm644 $(word 2,$^) $(DESTDIR)$(PREFIX)/share/snaprestore/$(word 2,$^)
30 cp -a $(DESTDIR)$(PREFIX) staging
31 $(FAKEROOT) chown -R 0:0 staging
32 SIZE=$$(du -s staging | cut -f 1); \
33 $(INSTALL) -Dm755 src/snaprestore.control staging/DEBIAN/control; \
34 sed -i ':a; s/@DEB_SNAPRESTORE@/$(DEB_SNAPRESTORE)/g; ta' staging/DEBIAN/control; \
35 sed -i ':a; s/@DEB_MAINTAINER@/$(DEB_MAINTAINER)/g; ta' staging/DEBIAN/control; \
36 sed -i ':a; s/@DEB_ARCH@/$(DEB_ARCH)/g; ta' staging/DEBIAN/control; \
37 cd staging && find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '"%P" ' | xargs md5sum > DEBIAN/md5sum; \
39 echo "Installed-Size: $$SIZE" >> staging/DEBIAN/control
40 $(FAKEROOT) dpkg-deb -z9 -b staging build
44 rm -f $(DESTDIR)$(PREFIX)/bin/snaprestore
45 rm -rf $(DESTDIR)$(PREFIX)/share/snaprestore
48 rm -f build/snaprestore
50 .PHONY: all package uninstall clean