-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
42 lines (32 loc) · 989 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CC ?= cc
STRIP ?= strip
FAKEROOT ?= fakeroot
LDID ?= ldid
DESTDIR ?= out
FIRMWARE_MAINTAINER ?= Zebra Team
PREFIX ?=
TARGET_PLATFORM ?= iphoneos
TARGET_VERSION ?= 11.0
TARGET_ARCH ?= arm64
TARGET_SYSROOT ?= $(shell xcrun --sdk $(TARGET_PLATFORM) --show-sdk-path)
ifeq (,$(findstring -arch ,$(CFLAGS)))
CFLAGS += -arch $(TARGET_ARCH)
endif
ifeq (,$(findstring -isysroot ,$(CFLAGS)))
CFLAGS += -isysroot $(TARGET_SYSROOT)
endif
CFLAGS += -m$(TARGET_PLATFORM)-version-min=$(TARGET_VERSION)
ifeq ($(DEBUG),1)
CFLAGS += -DDEBUG
endif
all:: src/*.m
mkdir -p build
$(CC) -O3 -fobjc-arc $(CFLAGS) -Ibuild -DMAINTAINER='@"$(FIRMWARE_MAINTAINER)"' -DPREFIX='@"$(PREFIX)"' src/*.m -o build/firmware $(LDFLAGS) -framework Foundation -lMobileGestalt
$(STRIP) build/firmware
$(LDID) -Sentitlements.plist build/firmware
$(FAKEROOT) chmod 755 build/firmware
install::
mkdir -p $(DESTDIR)
cp -a build/firmware $(DESTDIR)
clean::
rm -rf firmware build out