makefile: fix

This commit is contained in:
Aleksei Chubukov 2023-12-02 21:52:49 +04:00
parent 9a50b6f481
commit f7b568328c

View File

@ -6,13 +6,14 @@
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ # # By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/12/02 21:33:22 by achubuko #+# #+# # # Created: 2023/12/02 21:33:22 by achubuko #+# #+# #
# Updated: 2023/12/02 21:33:31 by achubuko ### ########.fr # # Updated: 2023/12/02 21:48:05 by achubuko ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
NAME=rush-02 NAME=rush-02
_CFLAGS = -Wall -Wextra -Werror _CFLAGS = -Wall -Wextra -Werror
CFLAGS = -g CFLAGS = -g
CFLAGS := $(_CFLAGS) $(CFLAGS)
##################################### #####################################
######### MANDATORY RULES ########### ######### MANDATORY RULES ###########
##################################### #####################################
@ -42,5 +43,6 @@ norme:
cfiles := $(wildcard ex00/*.c) cfiles := $(wildcard ex00/*.c)
ofiles = $(foreach f, $(cfiles), $(subst .c,.o,$f)) ofiles = $(foreach f, $(cfiles), $(subst .c,.o,$f))
%.o: %.c %.h %.o: %.c %.h
$(CC) $(_CFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
$(NAME): $(ofiles) $(NAME): $(ofiles)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^