2023-05-18 17:02:05 +02:00
|
|
|
# **************************************************************************** #
|
|
|
|
# #
|
|
|
|
# .--. _ #
|
2023-06-15 23:37:49 +02:00
|
|
|
# Makefile |o_o || | #
|
2023-05-18 17:02:05 +02:00
|
|
|
# |:_/ || |_ _ ___ __ #
|
|
|
|
# By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / #
|
|
|
|
# (| | )|_| |_| |> < #
|
|
|
|
# Created: 2021/08/19 15:20:20 by djonker /'\_ _/`\__|\__,_/_/\_\ #
|
2023-06-15 23:37:49 +02:00
|
|
|
# Updated: 2023/06/15 23:37:40 by houtworm \___)=(___/ #
|
2023-05-18 17:02:05 +02:00
|
|
|
# #
|
|
|
|
# **************************************************************************** #
|
|
|
|
|
|
|
|
NAME =philo
|
|
|
|
CC =gcc
|
2023-05-20 10:08:26 +02:00
|
|
|
CFLAGS =-Wall -Werror -Wextra# -g -fsanitize=thread
|
2023-06-15 23:37:49 +02:00
|
|
|
RM =rm -rf
|
|
|
|
SRC =src/philo.c\
|
|
|
|
src/init.c\
|
|
|
|
src/util.c
|
|
|
|
OBJ =$(SRC:src/%.c=obj/%.o)
|
2023-05-18 17:02:05 +02:00
|
|
|
|
|
|
|
all: $(NAME)
|
|
|
|
|
|
|
|
clean:
|
2023-06-15 23:37:49 +02:00
|
|
|
@$(RM) obj
|
2023-05-18 17:02:05 +02:00
|
|
|
@printf "\e[1;35mCleaned Object Files\n\e[0;00m"
|
|
|
|
|
|
|
|
fclean: clean
|
2023-06-15 23:37:49 +02:00
|
|
|
@$(RM) $(NAME)
|
2023-05-18 17:02:05 +02:00
|
|
|
@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 $@
|
|
|
|
|
2023-06-15 23:37:49 +02:00
|
|
|
$(NAME): $(OBJ)
|
2023-05-18 17:02:05 +02:00
|
|
|
@printf "\e[1;36mCompiling $@\n\e[0;00m"
|
|
|
|
@$(CC) $(CFLAGS) $^ -o $@
|
|
|
|
@printf "\e[1;32mDone\e[0;00m\n"
|
|
|
|
|
|
|
|
.PHONY: all clean fclean re
|