-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
50 lines (39 loc) · 1.53 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
# **************************************************************************** #
# #
# ::: :::::::: #
# makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lpalacio <lpalacio@student.42madrid> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/15 19:54:20 by lpalacio #+# #+# #
# Updated: 2023/12/09 21:20:16 by lpalacio ### ########.fr #
# #
# **************************************************************************** #
SRCS = push_swap.c push_swap_utils.c moves_push_swap.c radix_sort.c \
data_precheck_and_load.c
OBJDIR = bin
OBJS = ${SRCS:%.c=$(OBJDIR)/%.o}
NAME = push_swap
LIBDIR = libft/
RM = rm -rf
CC = gcc
CFLAGS = -Wall -Wextra -Werror
CLIBFT = -L ${LIBDIR} -lft
LIBFT = libft.a
all: ${NAME}
bin/%.o : %.c
@mkdir -p ${OBJDIR}
@$(CC) ${CFLAGS} -c $< -o $@
${NAME}: ${OBJS} | ${LIBFT}
@$(CC) -o ${NAME} ${OBJS} ${CLIBFT} ${CFLAGS}
@echo "push_swap has been compiled"
${LIBFT}:
@$(MAKE) -C $(LIBDIR)
clean:
@${RM} ${OBJS} $(OBJDIR)
@$(MAKE) -C $(LIBDIR) clean
fclean: clean
@${RM} ${NAME}
@$(MAKE) -C $(LIBDIR) fclean
re: fclean all
.PHONY: all clean fclean re