]> git.cameronkatri.com Git - snaprestore.git/blob - Makefile
Clean /var
[snaprestore.git] / Makefile
1 CC ?= aarch64-apple-darwin-clang
2 STRIP ?= aarch64-apple-darwin-strip
3 LDID ?= ldid
4 CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.2.sdk -miphoneos-version-min=13.0
5 INSTALL ?= install
6 FAKEROOT ?= fakeroot
7 PREFIX ?= /usr
8 DESTDIR ?=
9
10 DEB_MAINTAINER ?= Cameron Katri <me@cameronkatri.com>
11 DEB_ARCH ?= iphoneos-arm
12 SNAPRESTORE_V := 0.3
13 DEB_SNAPRESTORE := $(SNAPRESTORE_V)
14
15 all: build/snaprestore
16
17 build/snaprestore: src/snaprestore.m src/ent.xml
18 mkdir -p build
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
22
23 install: build/snaprestore
24 $(INSTALL) -Dm755 build/snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
25 $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
26
27 package: build/snaprestore
28 rm -rf staging
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; \
38 cd ..; \
39 echo "Installed-Size: $$SIZE" >> staging/DEBIAN/control
40 $(FAKEROOT) dpkg-deb -z9 -b staging build
41 rm -rf staging
42
43 clean:
44 rm -f build/snaprestore