-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (42 loc) · 1.61 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mhrima <mhrima@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/24 05:24:40 by mhrima #+# #+# #
# Updated: 2023/11/14 13:25:25 by mhrima ### ########.fr #
# #
# **************************************************************************** #
CC = cc
CFLAGS = #-fsanitize=address -g3 #-Wall -Wextra -Werror
RM = rm -rf
OBJDIR = objects
LIB = Libft/libft.a
EXEC = mini
SRCS = main.c global.c debug.c tokenize.c parsing.c interpret.c
OBJS = $(addprefix $(OBJDIR)/,$(notdir $(SRCS:.c=.o)))
.PHONY: all lib clean fclean re
all: lib $(EXEC)
lib:
@if [ ! -f $(LIB) ]; then \
make -C Libft; \
fi
$(OBJS): $(SRCS) header.h
$(EXEC): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIB) -lm -o $(EXEC)
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJDIR)
make -C Libft clean
fclean: clean
$(RM) $(EXEC)
make -C Libft fclean
re: fclean all
make re -C Libft
#cc -c main.c -o objects/main.o
#cc objects/main.o -L./Libft -l:libft.a -lm -o exe