-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
36 lines (25 loc) · 955 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
# Makefile for CVE-2019-2215 for Pixel 2 and Pixel 2 XL
# Requires the $ANDROID_NDK_HOME environment variable to be set
# containing the base path to Android NDK r19 or higher.
PREFIX = $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/linux-x86_64
TARGET = aarch64-linux-android
ANDROID_API ?= 21
CFLAGS = -O3 -Wall -Wextra -pedantic -Wformat -Werror=format-security
CC = $(PREFIX)/bin/$(TARGET)$(ANDROID_API)-clang
STRIP = $(PREFIX)/bin/$(TARGET)-strip
OBJS = cve-2019-2215.o
%.o: $(CC) -c -o $@ $< $(CFLAGS)
cve-2019-2215: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS)
.PHONY: all clean debug debug-static static strip
all: clean cve-2019-2215 strip
clean:
rm -f cve-2019-2215 $(OBJS)
debug: CFLAGS := $(filter-out -O3,$(CFLAGS)) -g
debug: clean cve-2019-2215
debug-static: CFLAGS := $(filter-out -O3,$(CFLAGS)) -g -static
debug-static: clean cve-2019-2215
static: CFLAGS += -static
static: all
strip: cve-2019-2215
$(STRIP) cve-2019-2215