78 lines
2.1 KiB
Makefile
78 lines
2.1 KiB
Makefile
# **************************************************************************** #
|
|
# #
|
|
# ::: :::::::: #
|
|
# Makefile :+: :+: :+: #
|
|
# +:+ +:+ +:+ #
|
|
# By: gtertysh <marvin@42.fr> +#+ +:+ +#+ #
|
|
# +#+#+#+#+#+ +#+ #
|
|
# Created: 2016/12/14 16:54:48 by gtertysh #+# #+# #
|
|
# Updated: 2016/12/26 19:11:43 by gtertysh ### ########.fr #
|
|
# #
|
|
# **************************************************************************** #
|
|
|
|
NAME = fillit
|
|
|
|
SRCDIR = ./src/
|
|
|
|
OBJDIR = ./obj/
|
|
|
|
SRC_FILES = main.c \
|
|
error.c \
|
|
init.c \
|
|
check.c \
|
|
algorithm.c \
|
|
glue_figure.c \
|
|
move_up_left.c \
|
|
read_file.c \
|
|
string_to_table.c \
|
|
dancing_links.c \
|
|
dancing_links_initialization.c \
|
|
dancing_links_initialization_2.c \
|
|
get_types.c \
|
|
get_amount.c
|
|
|
|
OBJ_FILES = $(SRC_FILES:.c=.o)
|
|
|
|
SRC = $(addprefix $(SRCDIR), $(SRC_FILES))
|
|
|
|
OBJ = $(addprefix $(OBJDIR), $(OBJ_FILES))
|
|
|
|
INC = -I ./inc -I $(LIBFOLDER)
|
|
|
|
LIB = libft.a
|
|
|
|
LIBFLAGS = -lft -L $(LIBFOLDER)
|
|
|
|
LIBFOLDER = ./libft/
|
|
|
|
FLAGS = -Werror -Wextra -Wall
|
|
|
|
CC = clang
|
|
|
|
all: $(NAME)
|
|
|
|
$(NAME): $(OBJ) $(LIBFOLDER)$(LIB) $(OBJDIR)
|
|
$(CC) $(FLAGS) $(OBJ) $(LIBFLAGS) -o $(NAME)
|
|
|
|
$(OBJDIR)%.o : $(SRCDIR)%.c
|
|
$(CC) $(FLAGS) $(INC) -c $< -o $@
|
|
|
|
$(OBJDIR):
|
|
mkdir $(OBJDIR)
|
|
|
|
$(LIBFOLDER)$(LIB):
|
|
make -C $(LIBFOLDER)
|
|
|
|
clean: libclean
|
|
rm -rf $(OBJ)
|
|
|
|
fclean: clean libfclean
|
|
rm -rf $(NAME)
|
|
|
|
libclean:
|
|
make clean -C $(LIBFOLDER)
|
|
|
|
libfclean:
|
|
make fclean -C $(LIBFOLDER)
|
|
|
|
re: clean all
|