netwhat/Makefile
2023-03-01 04:35:12 +01:00

49 lines
1.6 KiB
Makefile

# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: :+: #
# +:+ #
# By: djonker <marvin@codam.nl> +#+ #
# +#+ #
# Created: 2020/12/19 06:09:46 by djonker #+# #+# #
# Updated: 2023/02/09 01:00:30 by houtworm ### ########.fr #
# #
# **************************************************************************** #
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
$(OBJ): $(SRC)
@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