-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (39 loc) · 1.39 KB
/
Makefile
File metadata and controls
58 lines (39 loc) · 1.39 KB
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
NAME := codexion
CC := cc
CFLAGS := -Wall -Wextra -Werror -pthread
# -g3 -fsanitize=thread
SRCDIR := .
DEPDIR := .deps
INCDIR := includes
BUILDDIR := build
SRCFILES := main.c utils/ft_calloc.c utils/print_instructions.c utils/init_dongles.c \
utils/get_time.c compile.c utils/print_lock.c monitor.c utils/check_exit.c \
queue/queue.c utils/mutexes.c queue/edf.c utils/init_coders.c utils/init_config.c \
debug.c refactor.c utils/free_everything.c init_all.c
OBJS := $(addprefix $(BUILDDIR)/,$(SRCFILES:.c=.o))
HEADERS := $(INCDIR)/coders.h
DEPFLAGS := -MD -MP -MF $(DEPDIR)/$*.d
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
$(BUILDDIR)/%.o: %.c $(HEADERS) Makefile
mkdir -p $(dir $@) $(DEPDIR)/$(dir $<)
$(CC) $(CFLAGS) $(DEPFLAGS) -I$(INCDIR) -c $< -o $@
vpath %.c $(SRCDIR)
-include $(addprefix $(DEPDIR)/,$(SRCFILES:.c=.d))
clean:
rm -rf $(DEPDIR)
rm -rf $(BUILDDIR)
fclean: clean
rm -f $(NAME)
re: fclean all
debug: all
$(CC) $(CFLAGS) -g3 $(OBJS) -o $(NAME)
valgrind --leak-check=full -s ./$(NAME) 7 3000 40 150 100 3 10 fifo
# --trace-children=yes --track-fds=yes --tool=helgrind -s
gdb_debug: re $(OBJS)
$(CC) $(CFLAGS) -g3 $(OBJS) -o $(NAME)
gdb --args ./$(NAME) $(ARG) 3 100 200 150 100 5 1 str
.PHONY: all clean fclean re debug gdb_debug
# valgrind --tool=helgrind -s ./$(NAME)
# valgrind --leak-check=full --show-leak-kinds=all -s