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.
 
 
 
 

89 lines
2.6 KiB

# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hroussea <hroussea@student.42lyon.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/02/06 16:48:42 by hroussea #+# #+# #
# Updated: 2021/08/19 02:17:53 by hroussea ### ########lyon.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -O3 -Wall -Wextra -Werror
NAME = cub3D
SRCS_F = main.c parsing/errormsg.c parsing/errormsg2.c parsing/funcs.c parsing/funcs2.c \
parsing/parsing_check.c parsing/parsing_check2.c parsing/parsing.c \
parsing/parsing2.c parsing/parsing3.c parsing/parsing4.c parsing/tokenizer.c \
parsing/tokenizer2.c parsing/tokenizer3.c parsing/map.c parsing/map2.c core0.c \
core1.c core2.c core3.c
LNK_LIBS = mlx ft mlxglue
LIBFT_DIR = libft
MLX_DIR = mlx
MLXGLUE_DIR = deps/mlxglue
ALL_LIBS_DIRS = ${LIBFT_DIR} ${MLX_DIR} ${MLXGLUE_DIR}
OBJS_F = ${SRCS_F:.c=.o}
SRCS = $(addprefix src/,${SRCS_F})
OBJS = $(addprefix obj/,${OBJS_F})
INC_DIRS = deps include ${LIBFT_DIR}/include ${MLX_DIR}
INC_DIRS_FLAG = ${addprefix -I ,${INC_DIRS}}
LNK_DIRS_FLAG = ${addprefix -L, ${ALL_LIBS_DIRS}}
LNK_LIBS_FLAG = ${LNK_DIRS_FLAG} ${addprefix -l,${LNK_LIBS}} -framework OpenGL -framework Cocoa
all: ${NAME}
${NAME}: ${MLXGLUE_DIR}/libmlxglue.a ${LIBFT_DIR}/libft.a libmlx.dylib ${OBJS}
${CC} -o ${NAME} ${LNK_LIBS_FLAG} ${OBJS}
obj/%.o: src/%.c | obj
${CC} ${CFLAGS} ${INC_DIRS_FLAG} -c $< -o $@
${LIBFT_DIR}/libft.a:
${MAKE} -C ${LIBFT_DIR} SHOWMSGBOOL=1
obj:
mkdir -p obj
mkdir -p obj/parsing
${MLXGLUE_DIR}/libmlxglue.a:
${MAKE} -C ${MLXGLUE_DIR} SHOWMSGBOOL=1
libmlx.dylib: ${MLX_DIR}/libmlx.dylib
cp ${MLX_DIR}/libmlx.dylib .
${MLX_DIR}/libmlx.dylib:
${MAKE} -C ${MLX_DIR}
clean:
rm -rf obj
fclean: clean
rm -f ${NAME}
rm -f libmlx.dylib
re:
${MAKE} fclean
${MAKE} all
fcleanf: fclean
${MAKE} -C ${MLX_DIR} clean
${MAKE} -C ${MLXGLUE_DIR} fclean
${MAKE} -C ${LIBFT_DIR} fclean
norme:
norminette src libft deps/mlxglue
debug: all
lldb -s dev/cub3D.lldb
launch: all
./cub3D output.cub
.PHONY: all clean fclean re fcleanf norme launch debug