fractol/Makefile

73 lines
2.3 KiB
Makefile
Raw Normal View History

2023-03-01 04:36:42 +01:00
# **************************************************************************** #
# #
# .--. _ #
2023-10-25 13:29:53 +02:00
# Makefile :+: :+: #
2023-03-01 04:36:42 +01:00
# |:_/ || |_ _ ___ __ #
# By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / #
# (| | )|_| |_| |> < #
# Created: 2022/11/24 10:12:10 by djonker /'\_ _/`\__|\__,_/_/\_\ #
2023-10-26 18:33:42 +02:00
# Updated: 2023/10/26 18:01:58 by houtworm ######## odam.nl #
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
2023-10-25 13:55:10 +02:00
RM =rm -rf
2023-03-01 04:36:42 +01:00
UNAME_S :=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS =Freedom Respecting Linux! :)
2023-10-25 13:29:53 +02:00
LIB =libft/libft.a mlx/build/libmlx42.a -ldl -lglfw -pthread -lm
2023-03-01 04:36:42 +01:00
else
OS =Proprietary Malware :(
2023-10-25 13:29:53 +02:00
LIB =libft/libft.a mlx/build/libmlx42.a -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit
2023-03-01 04:36:42 +01:00
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
2023-10-25 13:55:10 +02:00
@$(MAKE) -C mlx/build clean > /dev/null
2023-03-01 04:36:42 +01:00
@printf "\e[1;35mCleaned Object Files\n\e[0;00m"
fclean: clean
2023-10-25 13:55:10 +02:00
@$(RM) $(NAME) mlx/build
2023-03-01 04:36:42 +01:00
@$(MAKE) -C libft fclean > /dev/null
@printf "\e[1;31mCleaned Executables\n\e[0;00m"
re: fclean all
2023-10-26 18:33:42 +02:00
$(OBJ): $(SRC) fractol.h Makefile
2023-03-01 04:36:42 +01:00
@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:
2023-10-25 13:29:53 +02:00
@cd mlx
@cmake -S mlx -B mlx/build
@$(MAKE) -C mlx/build -j4
@cd ..
2023-03-01 04:36:42 +01:00
.PHONY: libft