-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·60 lines (43 loc) · 1.04 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
##
## EPITECH PROJECT, 2023
## makefile
## File description:
## Makefile myprintf
##
NAME = mysh
SRC = src/main.c \
src/builtin_handler.c \
src/builtin_checker.c \
src/command_handling.c \
src/linked_list_utilities.c \
src/utilities.c \
src/env_utilities.c
OBJ = $(SRC:.c=.o)
CFLAGS = -W -Wall -Wextra
CPPFLAGS = -Iinclude/
LDFLAGS = -L./lib/my -lmy
DBUGFLAGS = -g3
DBUGRUN_LOGNAME = valgrind-out.txt
DBUGRUN_FLAGS = --leak-check=yes --show-leak-kinds=all --track-origins=yes \
--verbose --log-file=$(DBUGRUN_LOGNAME) \
--trace-children=yes --track-fds=yes
all: $(NAME)
$(NAME): $(OBJ)
$(MAKE) -C lib/my
$(CC) -o $(NAME) $(OBJ) $(LDFLAGS)
clean:
$(MAKE) -C lib/my clean
rm -f $(NAME)
rm -f $(OBJ)
fclean: clean
$(MAKE) -C lib/my fclean
re: fclean all
debug: CFLAGS += $(DBUGFLAGS)
debug: $(OBJ)
$(MAKE) -C lib/my
$(CC) -o $(NAME) $(OBJ) $(LDFLAGS) $(DBUGFLAGS)
debug_re: fclean debug
debug_run: debug_re
echo "ls\nexit" | valgrind $(DBUGRUN_FLAGS) ./$(NAME)
cat $(DBUGRUN_LOGNAME)
echo $$(cat $(DBUGRUN_LOGNAME))