philosophers/philo/Makefile
2023-10-26 19:09:42 +02:00

45 lines
1.5 KiB
Makefile

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