fillit/Makefile

79 lines
2.1 KiB
Makefile
Raw Permalink Normal View History

2016-12-26 18:48:33 +02:00
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gtertysh <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/12/14 16:54:48 by gtertysh #+# #+# #
2016-12-26 19:38:12 +02:00
# Updated: 2016/12/26 19:36:41 by gtertysh ### ########.fr #
2016-12-26 18:48:33 +02:00
# #
# **************************************************************************** #
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)
2016-12-26 19:38:12 +02:00
$(NAME): $(OBJDIR) $(LIBFOLDER)$(LIB) $(OBJ)
2016-12-26 18:48:33 +02:00
$(CC) $(FLAGS) $(OBJ) $(LIBFLAGS) -o $(NAME)
2016-12-26 19:32:47 +02:00
$(OBJDIR)%.o : $(SRCDIR)%.c
2016-12-26 18:48:33 +02:00
$(CC) $(FLAGS) $(INC) -c $< -o $@
2016-12-26 19:32:47 +02:00
$(OBJDIR):
mkdir $(OBJDIR)
2016-12-26 18:48:33 +02:00
$(LIBFOLDER)$(LIB):
make -C $(LIBFOLDER)
2016-12-26 19:32:47 +02:00
clean: libclean
2016-12-26 18:48:33 +02:00
rm -rf $(OBJ)
2016-12-26 19:32:47 +02:00
fclean: clean libfclean
2016-12-26 18:48:33 +02:00
rm -rf $(NAME)
libclean:
make clean -C $(LIBFOLDER)
libfclean:
make fclean -C $(LIBFOLDER)
2016-12-26 19:32:47 +02:00
re: clean all