47 lines
1.7 KiB
Makefile
47 lines
1.7 KiB
Makefile
|
# **************************************************************************** #
|
||
|
# #
|
||
|
# ::: :::::::: #
|
||
|
# Makefile :+: :+: :+: #
|
||
|
# +:+ +:+ +:+ #
|
||
|
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
||
|
# +#+#+#+#+#+ +#+ #
|
||
|
# Created: 2023/12/02 21:33:22 by achubuko #+# #+# #
|
||
|
# Updated: 2023/12/02 21:33:31 by achubuko ### ########.fr #
|
||
|
# #
|
||
|
# **************************************************************************** #
|
||
|
|
||
|
NAME=rush-02
|
||
|
_CFLAGS = -Wall -Wextra -Werror
|
||
|
CFLAGS = -g
|
||
|
#####################################
|
||
|
######### MANDATORY RULES ###########
|
||
|
#####################################
|
||
|
|
||
|
# all: default rule
|
||
|
# norme prerequisite is not mandatory
|
||
|
all: $(NAME) norme
|
||
|
|
||
|
# clean: Delete *.o for project and libraries
|
||
|
clean:
|
||
|
rm -rdf $(wildcard */*.o)
|
||
|
|
||
|
# fclean: Delete *.o files and delete named executable
|
||
|
fclean: clean
|
||
|
rm -f $(NAME)
|
||
|
|
||
|
# re: full clean and recompilation
|
||
|
re: fclean all
|
||
|
|
||
|
# these targets are not backed by files, therefore, always run when called
|
||
|
.PHONY: all clean fclean re purge norme
|
||
|
#####################################
|
||
|
########## PROJECT RULES ############
|
||
|
#####################################
|
||
|
norme:
|
||
|
norminette ex00
|
||
|
cfiles := $(wildcard ex00/*.c)
|
||
|
ofiles = $(foreach f, $(cfiles), $(subst .c,.o,$f))
|
||
|
%.o: %.c %.h
|
||
|
$(CC) $(_CFLAGS) $(CFLAGS) -c -o $@ $<
|
||
|
$(NAME): $(ofiles)
|