-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 912 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
53
54
55
SRCS = main.c \
arguments.c \
list_node.c \
list_utils.c \
list_utils_more.c \
array_utils.c \
push_swap.c \
ps_rules.c \
ps_rules_more.c \
ps_utils.c \
ps_utils_more.c \
ps_algorithms.c \
ps_algorithms_more.c
OBJS = $(SRCS:.c=.o)
# BONUS_SRCS = checker.c \
# checker_utils.c \
# checker_rules.c
# BONUS_OBJS = $(BONUS_SRCS:.c=.o)
NAME = push_swap
# B_NAME = checker
CC = gcc
CFLAGS = -Wall -Werror -Wextra
all: $(NAME)
.c.o:
$(CC) $(CFLAGS) -c $< -o $(<:.c=.o) -I ./libft
$(NAME): $(OBJS)
@make -C ./libft
$(CC) $(CFLAGS) $(OBJS) -o $(NAME) libft/libft.a
# bonus: $(BONUS_OBJS)
# @make -C ./libft
# $(CC) $(CFLAGS) $(BONUS_OBJS) -o $(B_NAME) libft/libft.a
clean:
@cd libft && make clean
@$(RM) $(OBJS)
fclean: clean
@cd libft && make fclean
@$(RM) $(NAME)
@echo "$(NAME) deleted"
re: fclean all
.PHONY: all clean fclean re