aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 20 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index f164042..a6255fb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,44 @@
-CC = aarch64-apple-darwin-clang
-STRIP = aarch64-apple-darwin-strip
-LDID = ldid
-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
-INSTALL = install
-FAKEROOT = fakeroot
+CC ?= aarch64-apple-darwin-clang
+STRIP ?= aarch64-apple-darwin-strip
+LDID ?= ldid
+CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.2.sdk -miphoneos-version-min=13.0 -Iinclude
+INSTALL ?= install
+FAKEROOT ?= fakeroot
PREFIX ?= /usr
DESTDIR ?=
DEB_MAINTAINER ?= Cameron Katri <me@cameronkatri.com>
DEB_ARCH ?= iphoneos-arm
-SNAPRESTORE_V := 0.1
+SNAPRESTORE_V := 0.2
DEB_SNAPRESTORE := $(SNAPRESTORE_V)
-all: snaprestore
+all: build/snaprestore
-snaprestore: snaprestore.m ent.xml NSTask.h
- $(CC) $(CFLAGS) -o snaprestore snaprestore.m -framework IOKit -framework Foundation -fobjc-arc
- $(STRIP) snaprestore
- $(LDID) -Sent.xml snaprestore
+build/snaprestore: src/snaprestore.m src/ent.xml
+ mkdir -p build
+ $(CC) $(CFLAGS) -o build/snaprestore src/snaprestore.m -framework IOKit -framework Foundation -framework MobileCoreServices -fobjc-arc
+ $(STRIP) build/snaprestore
+ $(LDID) -Ssrc/ent.xml build/snaprestore
-install: snaprestore
- $(INSTALL) -Dm755 snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
+install: build/snaprestore
+ $(INSTALL) -Dm755 build/snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
$(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
-package: snaprestore
+package: build/snaprestore
rm -rf staging
- $(INSTALL) -Dm755 snaprestore staging$(PREFIX)/bin/snaprestore
+ $(INSTALL) -Dm755 build/snaprestore staging$(PREFIX)/bin/snaprestore
$(INSTALL) -Dm644 LICENSE staging$(PREFIX)/share/snaprestore/LICENSE
$(FAKEROOT) chown -R 0:0 staging
SIZE=$$(du -s staging | cut -f 1); \
- $(INSTALL) -Dm755 snaprestore.control staging/DEBIAN/control; \
+ $(INSTALL) -Dm755 src/snaprestore.control staging/DEBIAN/control; \
sed -i ':a; s/@DEB_SNAPRESTORE@/$(DEB_SNAPRESTORE)/g; ta' staging/DEBIAN/control; \
sed -i ':a; s/@DEB_MAINTAINER@/$(DEB_MAINTAINER)/g; ta' staging/DEBIAN/control; \
sed -i ':a; s/@DEB_ARCH@/$(DEB_ARCH)/g; ta' staging/DEBIAN/control; \
cd staging && find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '"%P" ' | xargs md5sum > DEBIAN/md5sum; \
cd ..; \
echo "Installed-Size: $$SIZE" >> staging/DEBIAN/control
- $(FAKEROOT) dpkg-deb -z9 -b staging .
+ $(FAKEROOT) dpkg-deb -z9 -b staging build
rm -rf staging
clean:
- rm -f snaprestore
+ rm -f build/snaprestore