philosophers/philo_bonus/Makefile

46 lines
1.6 KiB
Makefile
Raw Normal View History

2023-05-18 17:02:05 +02:00
# **************************************************************************** #
# #
# .--. _ #
2023-10-26 19:09:42 +02:00
# Makefile :+: :+: #
2023-05-18 17:02:05 +02:00
# |:_/ || |_ _ ___ __ #
# By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / #
# (| | )|_| |_| |> < #
# Created: 2021/08/19 15:20:20 by djonker /'\_ _/`\__|\__,_/_/\_\ #
2023-10-26 19:09:42 +02:00
# Updated: 2023/10/26 18:03:59 by houtworm ######## odam.nl #
2023-05-18 17:02:05 +02:00
# #
# **************************************************************************** #
NAME =philo_bonus
CC =gcc
2023-05-22 08:14:22 +02:00
CFLAGS =-Wall -Werror -Wextra -g -fsanitize=address
2023-05-18 17:02:05 +02:00
RM =rm -f
SRC =src/philo.c\
src/init.c\
2023-05-22 08:14:22 +02:00
src/util.c\
src/watch.c
2023-05-18 17:02:05 +02:00
OBJ =$(SRC:src/%.c=obj/%.o)
all: $(NAME)
clean:
@$(RM) -r obj
@printf "\e[1;35mCleaned Object Files\n\e[0;00m"
fclean: clean
@$(RM) philo_bonus
@printf "\e[1;31mCleaned Executables\n\e[0;00m"
re: fclean all
2023-10-26 19:09:42 +02:00
$(OBJ): $(SRC) philo.h Makefile
2023-05-18 17:02:05 +02:00
@mkdir -p $(dir $@)
@printf "\e[1;34mBuilding $@\n\e[0;00m"
@$(CC) $(CFLAGS) -c $(@:obj/%.o=src/%.c) -o $@
philo_bonus:$(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