netwhat/Makefile

49 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2023-03-01 04:35:12 +01:00
# **************************************************************************** #
# #
# :::::::: #
2023-10-26 18:33:15 +02:00
# Makefile :+: :+: #
2023-03-01 04:35:12 +01:00
# +:+ #
# By: djonker <marvin@codam.nl> +#+ #
# +#+ #
# Created: 2020/12/19 06:09:46 by djonker #+# #+# #
2023-10-26 18:46:40 +02:00
# Updated: 2023/10/26 18:46:32 by houtworm ######## odam.nl #
2023-03-01 04:35:12 +01:00
# #
# **************************************************************************** #
NAME =netwhat
CC =gcc
FC =-Wall -Werror -Wextra
RM =rm -f
SRC =src/netwhat.c
OBJ =$(SRC:src/%.c=obj/%.o)
LIB =libft/libft.a
all: libft $(NAME)
clean:
@$(RM) -r obj
@$(MAKE) -C libft clean > /dev/null
@printf "\e[1;35mCleaned Object Files\n\e[0;00m"
fclean: clean
@$(RM) $(NAME)
@$(MAKE) -C libft fclean > /dev/null
@printf "\e[1;31mCleaned Executables\n\e[0;00m"
re: fclean all
2023-10-26 18:46:40 +02:00
$(OBJ): $(SRC) Makefile
2023-03-01 04:35:12 +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) $(OBJ) -o $(NAME) $(LIB) > /dev/null
@printf "\e[1;32mDone\e[0;00m\n"
libft:
@$(MAKE) -C libft bonus
.PHONY: libft