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.
48 lines
971 B
48 lines
971 B
3 years ago
|
NAME = fdf
|
||
|
LIBFT = libft.a
|
||
|
|
||
|
SRCS = fdf.c fdf_commands.c fdf_drawing.c fdf_utils.c fdf_parsing.c get_next_line.c get_next_line_utils.c
|
||
|
OBJS = ${SRCS:.c=.o}
|
||
|
CC = gcc
|
||
|
RM = rm -rf
|
||
|
|
||
|
UNAME_S := $(shell uname -s)
|
||
|
ifeq ($(UNAME_S), Linux)
|
||
|
LFLAGS = -L ./mlx -lmlx_Linux -lXext -lX11 -lm -lz -L. -lft
|
||
|
endif
|
||
|
ifeq ($(UNAME_S), Darwin)
|
||
|
LFLAGS = -lmlx -framework OpenGL -framework AppKit -L. -lft
|
||
|
endif
|
||
|
CFLAGS = -Werror -Wall -Wextra -O3 -ffast-math -funsafe-math-optimizations
|
||
|
|
||
|
$(LIBFT):
|
||
|
@${MAKE} -C ./libft
|
||
|
@cp ./libft/libft.a .
|
||
|
|
||
|
%.o:%.c
|
||
|
@${CC} ${CFLAGS} -c $< -o ${<:.c=.o}
|
||
|
|
||
|
all: $(NAME)
|
||
|
|
||
|
$(NAME): $(LIBFT) $(OBJS)
|
||
|
@echo "Making FdF."
|
||
|
@${CC} -g ${OBJS} -o ${NAME} ${LFLAGS}
|
||
|
@echo "Done."
|
||
|
|
||
|
clean:
|
||
|
@echo "Cleaning objects."
|
||
|
@${RM} ${OBJS}
|
||
|
@echo "Done."
|
||
|
|
||
|
fclean: clean
|
||
|
@echo "Cleaning libft."
|
||
|
@${MAKE} -C ./libft fclean
|
||
|
@rm -rf libft.a
|
||
|
@echo "Cleaning binary."
|
||
|
@${RM} ${NAME}
|
||
|
@echo "Done."
|
||
|
|
||
|
re: fclean all
|
||
|
|
||
|
.PHONY: all clean fclean re
|