2023-03-01 04:36:42 +01:00
|
|
|
# **************************************************************************** #
|
|
|
|
# #
|
|
|
|
# .--. _ #
|
2023-04-14 17:29:41 +02:00
|
|
|
# Makefile |o_o || | #
|
2023-03-01 04:36:42 +01:00
|
|
|
# |:_/ || |_ _ ___ __ #
|
|
|
|
# By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / #
|
|
|
|
# (| | )|_| |_| |> < #
|
|
|
|
# Created: 2022/11/24 10:12:10 by djonker /'\_ _/`\__|\__,_/_/\_\ #
|
2023-04-14 17:29:41 +02:00
|
|
|
# Updated: 2023/04/14 17:29:23 by houtworm \___)=(___/ #
|
2023-03-01 04:36:42 +01:00
|
|
|
# #
|
|
|
|
# **************************************************************************** #
|
|
|
|
|
|
|
|
NAME =fract-ol
|
|
|
|
CC =gcc
|
|
|
|
FC =-Wall -Werror -Wextra -Wunreachable-code -Ofast #-fsanitize=address
|
|
|
|
HEAD =-I ./include -I $(MLX)/include
|
|
|
|
RM =rm -f
|
|
|
|
UNAME_S :=$(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
OS =Freedom Respecting Linux! :)
|
|
|
|
LIB =libft/libft.a mlx/libmlx42.a -ldl -lglfw -pthread -lm
|
|
|
|
else
|
|
|
|
OS =Proprietary Malware :(
|
|
|
|
LIB =libft/libft.a mlx/libmlx42.a -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit
|
|
|
|
endif
|
|
|
|
SRC =src/main.c\
|
|
|
|
src/colors.c\
|
|
|
|
src/zoommove.c\
|
|
|
|
src/keyhooks.c\
|
|
|
|
src/mousehooks.c\
|
|
|
|
src/print.c\
|
|
|
|
src/error.c\
|
|
|
|
src/fractal.c\
|
|
|
|
src/fractals1.c\
|
|
|
|
src/fractals2.c
|
|
|
|
OBJ =$(SRC:src/%.c=obj/%.o)
|
|
|
|
|
|
|
|
all: libft libmlx $(NAME)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@$(RM) -r obj
|
|
|
|
@$(MAKE) -C libft clean > /dev/null
|
|
|
|
@$(MAKE) -C mlx clean > /dev/null
|
|
|
|
@printf "\e[1;35mCleaned Object Files\n\e[0;00m"
|
|
|
|
|
|
|
|
fclean: clean
|
|
|
|
@$(RM) $(NAME)
|
|
|
|
@$(MAKE) -C libft fclean > /dev/null
|
|
|
|
@$(MAKE) -C mlx fclean > /dev/null
|
|
|
|
@printf "\e[1;31mCleaned Executables\n\e[0;00m"
|
|
|
|
|
|
|
|
re: fclean all
|
|
|
|
|
|
|
|
$(OBJ): $(SRC)
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@printf "\e[1;34mBuilding $@\n\e[0;00m"
|
|
|
|
@$(CC) $(CFLAGS) -c $(@:obj/%.o=src/%.c) -o $@
|
|
|
|
|
|
|
|
$(NAME): $(OBJ)
|
|
|
|
@printf "\e[1;36mCompiling $@\e[0;00m\n"
|
|
|
|
@$(CC) $(FC) -o $(NAME) $(SRC) $(LIB) $(HEAD)
|
|
|
|
@printf "\e[1;32mDone\e[0;00m\n"
|
|
|
|
|
|
|
|
libft:
|
|
|
|
@$(MAKE) -C libft all
|
|
|
|
|
|
|
|
libmlx:
|
|
|
|
@$(MAKE) -C mlx
|
|
|
|
|
|
|
|
.PHONY: libft
|