You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

60 lines
1.8 KiB

# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hroussea <hroussea@student.42lyon.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/05/10 14:17:23 by hroussea #+# #+# #
# Updated: 2021/05/13 13:48:04 by hroussea ### ########lyon.fr #
# #
# **************************************************************************** #
NAME = push_swap
SRCS := commands1.c commands2.c commands3.c utils.c ps.c
PS_SRCS := ${SRCS} push_swap.c
CHECKER_SRCS := ${SRCS} checker.c
PS_OBJS := ${PS_SRCS:.c=.o}
CHECKER_OBJS := ${CHECKER_SRCS:.c=.o}
PS_SRCS := ${addprefix src/,${PS_SRCS}}
CHECKER_SRCS := ${addprefix src/,${CHECKER_SRCS}}
PS_OBJS := ${addprefix obj/,${PS_OBJS}}
CHECKER_OBJS := ${addprefix obj/,${CHECKER_OBJS}}
CFLAGS = -O3 -Wall -Wextra -Werror
CC = gcc
all: ${NAME} checker
${NAME}: libft/libft.a obj ${PS_OBJS}
${CC} ${PS_OBJS} -L libft -lft -Iinclude -Ilibft/include -o ${NAME}
checker: libft/libft.a obj ${CHECKER_OBJS}
${CC} ${CHECKER_OBJS} -L libft -lft -Iinclude -Ilibft/include -o checker
obj:
mkdir -p obj
obj/%.o: src/%.c
${CC} ${CFLAGS} -Iinclude -Ilibft/include -c $< -o $@
clean:
rm -rf obj
fclean: clean
${RM} ${NAME} checker
${MAKE} -C libft fclean
re:
${MAKE} fclean
${MAKE} all
libft/libft.a:
${MAKE} -C libft
.PHONY: all clean fclean re