1 CC ?= aarch64-apple-darwin-clang
2 STRIP ?= aarch64-apple-darwin-strip
4 CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.2.sdk -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 build/snaprestore src/snaprestore.m -framework IOKit -framework Foundation -framework CoreServices -fobjc-arc
20 $(STRIP) build/snaprestore
21 $(LDID) -Ssrc/ent.xml build/snaprestore
23 install: build/snaprestore
24 $(INSTALL) -Dm755 build/snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
25 $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
27 package: build/snaprestore
29 $(INSTALL) -Dm755 build/snaprestore staging$(PREFIX)/bin/snaprestore
30 $(INSTALL) -Dm644 LICENSE staging$(PREFIX)/share/snaprestore/LICENSE
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 build/snaprestore