49 lines
1.6 KiB
Makefile
49 lines
1.6 KiB
Makefile
# **************************************************************************** #
|
|
# #
|
|
# :::::::: #
|
|
# Makefile :+: :+: #
|
|
# +:+ #
|
|
# By: djonker <marvin@codam.nl> +#+ #
|
|
# +#+ #
|
|
# Created: 2020/12/19 06:09:46 by djonker #+# #+# #
|
|
# Updated: 2023/10/26 18:46:32 by houtworm ######## odam.nl #
|
|
# #
|
|
# **************************************************************************** #
|
|
|
|
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) 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 $@\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
|