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.
 
 
 
 
 

79 lines
2.1 KiB

# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hroussea <hroussea@student.42lyon.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/05/29 14:36:18 by hroussea #+# #+# #
# Updated: 2021/06/04 17:58:25 by hroussea ### ########lyon.fr #
# #
# **************************************************************************** #
NAME = fractol
# Build options
CC = gcc
CFLAGS = -Wall -Wextra -Werror
OPTFLAGS = -Ofast -march=native
DEBUGFLAGS =
# Program files
SRCS := main.c input.c
HDRS := ft_complex.h mandelbrot.h
INCLUDE := include libft/include mlx mlxglue/include
LINK := ft mlx mlxglue
LIBS := mlx mlxglue libft
# Path generation
OBJS := ${addprefix obj/,${SRCS:.c=.o}}
SRCS := ${addprefix src/,${SRCS}}
HDRS := ${addprefix include/,${HDRS}}
# Flag generation
INCLUDE := ${addprefix -I,${INCLUDE}}
LINK := ${addprefix -l,${LINK}}
LIBS := ${addprefix -L,${LIBS}}
all: ${NAME}
${NAME}: libmlx.dylib libft/libft.a mlxglue/libmlxglue.a ${OBJS}
${CC} ${OBJS} -o $@ ${LIBS} ${LINK}
clean:
rm -rf obj
fclean: clean
${RM} ${NAME} libmlx.dylib
${MAKE} -C libft fclean
${MAKE} -C mlxglue fclean
${MAKE} -C mlx clean
re:
${MAKE} fclean
${MAKE} all
libft/libft.a:
${MAKE} -C libft
mlxglue/libmlxglue.a:
${MAKE} -C mlxglue
libmlx.dylib: mlx/libmlx.dylib
cp mlx/libmlx.dylib .
mlx/libmlx.dylib:
${MAKE} -C mlx
obj/%.o: src/%.c ${HDRS}
@if ! [ -d "obj" ]; then mkdir -p obj; fi
${CC} -c $< -o $@ ${CFLAGS} ${OPTFLAGS} ${DEBUGFLAGS} ${INCLUDE}
norme:
norminette src include libft mlxglue
.PHONY: all clean fclean re norme