-
Notifications
You must be signed in to change notification settings - Fork 80
/
Makefile
41 lines (32 loc) · 859 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
CC=clang
OPT=-O0 -ggdb -Wall -Wpedantic -Wextra -fPIC -fPIE -pie
all: heap stack
heap: heap.c
${CC} ${OPT} heap.c -o heap
heap.asan: heap
retrowrite --asan ./heap ./heap.asan.s
sed -i 's/asan_init_v4/asan_init/g' heap.asan.s
${CC} heap.asan.s -lasan -o heap.asan
.PHONY=heaptest
heaptest: heap heap.asan
./heap 1
./heap.asan 1; true
./heap 2
./heap.asan 2; true
stack: stack.c
${CC} ${OPT} stack.c -o stack
stack.asan: stack
retrowrite --asan ./stack ./stack.asan.s
sed -i 's/asan_init_v4/asan_init/g' stack.asan.s
${CC} stack.asan.s -lasan -o stack.asan
.PHONY=stacktest
stacktest: stack stack.asan
./stack 1
./stack.asan 1; true
./stack 2
./stack.asan 2; true
.PHONY=test
test: heaptest stacktest
.PHONY=clean
clean:
rm -f heap heap.asan heap.asan.s heap.asan.analysis_cache stack stack.asan stack.asan.s stack.asan.analysis_cache