-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (44 loc) · 1.23 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
##
## EPITECH PROJECT, 2019
## base_repo
## File description:
## Makefile file
##
SRC = src/calloc.c \
src/free.c \
src/malloc.c \
src/realloc.c \
src/utils.c
BUILDDIR = build
override OBJ = $(SRC:%.c=$(BUILDDIR)/%.o)
TRC = NULL
OTRC = $(TRC:%.c=%.o)
CFLAGS = -fPIC -Wall -Werror -Wextra -std=gnu99
CPPFLAGS = -Iinclude
NAME = libmy_malloc.so
LDFLAGS = -shared -Wl,-soname,$(NAME)
all: $(NAME) ## hoes mad
$(NAME): $(OBJ)
$(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION)
.SECONDEXPANSION:
$(BUILDDIR)/%.o: override CPPFLAGS += -MT $@ -MMD -MP -MF $(@:.o=.d)
$(BUILDDIR)/%.o: %.c | $$(@D)/.
$(COMPILE.c) $(OUTPUT_OPTION) $<
$(BUILDDIR)/.:
mkdir $@
$(BUILDDIR)%/.:
mkdir -p $@
.PRECIOUS: $(BUILDDIR)/. $(BUILDDIR)%/.
clean: ## rm build obj
$(RM) -r $(BUILDDIR)
fclean: clean ## clean + rm $(NAME)
rm -rf $(NAME)
gclean: fclean clean ## ?
re: gclean all ## Re
tests_run: $(OTRC) $(OBJ) ## Run Tests
gcc -o unit_test $(OTRC) $(OBJ) $(CFLAGS) -lcriterion --coverage
./unit_test
help: ##
@
@grep -E "^[a-zA-Z\\_]+:.*## " Makefile | awk 'BEGIN {FS = ":.*## "}; {
.PHONY: gclean clean fclean re tests_run all help