2023-12-02 17:26:10 +00:00
|
|
|
# **************************************************************************** #
|
|
|
|
# #
|
|
|
|
# ::: :::::::: #
|
|
|
|
# Makefile :+: :+: :+: #
|
|
|
|
# +:+ +:+ +:+ #
|
|
|
|
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
|
|
|
# +#+#+#+#+#+ +#+ #
|
|
|
|
# Created: 2023/12/02 21:33:22 by achubuko #+# #+# #
|
2023-12-07 16:06:51 +00:00
|
|
|
# Updated: 2023/12/07 19:30:21 by achubuko ### ########.fr #
|
2023-12-02 17:26:10 +00:00
|
|
|
# #
|
|
|
|
# **************************************************************************** #
|
|
|
|
|
|
|
|
NAME=rush-02
|
2023-12-07 16:06:51 +00:00
|
|
|
_CFLAGS = -Wall -Wextra -fsanitize=address
|
2023-12-02 17:26:10 +00:00
|
|
|
CFLAGS = -g
|
2023-12-02 17:52:49 +00:00
|
|
|
CFLAGS := $(_CFLAGS) $(CFLAGS)
|
2023-12-02 17:26:10 +00:00
|
|
|
#####################################
|
|
|
|
######### MANDATORY RULES ###########
|
|
|
|
#####################################
|
|
|
|
|
|
|
|
# all: default rule
|
|
|
|
# norme prerequisite is not mandatory
|
2023-12-07 16:06:51 +00:00
|
|
|
all: $(NAME)
|
2023-12-02 17:26:10 +00:00
|
|
|
|
|
|
|
# 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:
|
2023-12-03 13:29:44 +00:00
|
|
|
norminette ex00 || true
|
2023-12-02 17:26:10 +00:00
|
|
|
cfiles := $(wildcard ex00/*.c)
|
|
|
|
ofiles = $(foreach f, $(cfiles), $(subst .c,.o,$f))
|
|
|
|
%.o: %.c %.h
|
2023-12-02 17:52:49 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2023-12-02 17:26:10 +00:00
|
|
|
$(NAME): $(ofiles)
|
2023-12-02 19:32:22 +00:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $(LOADLIBES) $(LDLIBS) $@ $^
|