-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (36 loc) · 941 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
43
44
45
46
47
48
49
50
51
52
##
## EPITECH PROJECT, 2019
## minishell1
## File description:
## Makefile
##
SRC = src/my_malloc.c \
src/alloc.c \
src/complement.c \
TEST = src/my_malloc.c \
src/alloc.c \
src/complement.c \
tests/unit_tests.c
OBJ = $(SRC:.c=.o)
CC = gcc -shared -I./include -fPIC -ggdb
CCTEST = gcc -D DEBUG -I./include
NAME = libmy_malloc.so
CPP_FLAGS = -W -Wall -Werror -Wextra -std=c++11
all: $(NAME)
$(NAME): $(OBJ)
$(CC) -o $(NAME) $(CPP_FLAGS) $(OBJ)
make tests_run
tests_run: $(TEST)
$(CCTEST) -o unit_tests $(TEST) -lcriterion --coverage -D DEBUG
./unit_tests | gcovr
make clean
clean:
rm -f $(shell find $(SOURCEDIR) -name '*.o')
rm -f $(shell find $(SOURCEDIR) -name '*~')
rm -f $(shell find $(SOURCEDIR) -name '*#')
rm -f $(shell find $(SOURCEDIR) -name '*vg*')
rm -f $(shell find $(SOURCEDIR) -name '*.gc*')
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all tests_run clean fclean re