-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (26 loc) · 975 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
CC = clang # -fsanitize=address -g -fno-omit-frame-pointer# C compiler
CFLAGS = -fPIC -Wall -Werror -O3 # -D DEBUG # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libmutator.so # target lib
SRCS = mutate.c random.c testcase.c util.c # source files
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: ${TARGET_LIB}
$(TARGET_LIB): $(OBJS)
$(CC) ${LDFLAGS} -o $@ $^
$(SRCS:.c):%.c
$(CC) $(CFLAGS) -MM $<
.PHONY: clean
clean:
-${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d)
.PHONY: test
test:
$(CC) -I./ -L./ -W test/mutate_test.c -o test/mutate -lmutator -lpthread
$(CC) -I./ -L./ -W test/mutate_multi_test.c -o test/mutate_multi -lmutator -lpthread
$(CC) -I./ -L./ -W test/mutate_stdin.c -o test/mutate_stdin -lmutator -lpthread
$(CC) -I./ -L./ -W test/mutate_file.c -o test/mutate_file -lmutator -lpthread
$(CC) -I./ -L./ -W test/mutate_dir.c -o test/mutate_dir -lmutator -lpthread
.PHONY: install
install:
cp libmutator.so /usr/local/lib/