]> git.cameronkatri.com Git - snaprestore.git/blob - Makefile
Add LICENSE and packaging
[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 -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/include -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/local/include -F/home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/System/Library/Frameworks
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.1
13 DEB_SNAPRESTORE := $(SNAPRESTORE_V)
14
15 all: snaprestore
16
17 snaprestore: snaprestore.m ent.xml NSTask.h
18 $(CC) $(CFLAGS) -o snaprestore snaprestore.m -framework IOKit -framework Foundation -fobjc-arc
19 $(LDID) -Sent.xml snaprestore
20
21 install: snaprestore
22 $(INSTALL) -Dm755 snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
23 $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
24
25 package: snaprestore
26 rm -rf staging
27 $(INSTALL) -Dm755 snaprestore staging$(PREFIX)/bin/snaprestore
28 $(INSTALL) -Dm644 LICENSE staging$(PREFIX)/share/snaprestore/LICENSE
29 $(FAKEROOT) chown -R 0:0 staging
30 SIZE=$$(du -s staging | cut -f 1); \
31 $(INSTALL) -Dm755 snaprestore.control staging/DEBIAN/control; \
32 sed -i ':a; s/@DEB_SNAPRESTORE@/$(DEB_SNAPRESTORE)/g; ta' staging/DEBIAN/control; \
33 sed -i ':a; s/@DEB_MAINTAINER@/$(DEB_MAINTAINER)/g; ta' staging/DEBIAN/control; \
34 sed -i ':a; s/@DEB_ARCH@/$(DEB_ARCH)/g; ta' staging/DEBIAN/control; \
35 cd staging && find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '"%P" ' | xargs md5sum > DEBIAN/md5sum; \
36 cd ..; \
37 echo "Installed-Size: $$SIZE" >> staging/DEBIAN/control
38 $(FAKEROOT) dpkg-deb -z9 -b staging .
39 rm -rf staging
40
41 clean:
42 rm -f snaprestore