separation des bonus

This commit is contained in:
hugogogo
2021-07-27 15:27:29 +02:00
parent 76a031d55e
commit 38ae8a9480
11 changed files with 181 additions and 67 deletions

View File

@@ -18,13 +18,20 @@ _LIBS = libft.a
LIBS = $(_LIBS:lib%.a=%)
SRCS = fdf.c \
draw.c \
parse.c \
modifs.c \
draw.c \
keypress.c
SRCS_B = fdf.c \
parse.c \
modifs.c \
keypress_bonus.c \
draw_bonus.c
ODIR = ./builds
OBJS = $(SRCS:%.c=$(ODIR)/%.o)
OBJS_B = $(SRCS_B:%.c=$(ODIR)/%.o)
# flag -g generates debug informations, g3 is maximal version
CFLAGS = -I$(IDIR) -g3 -Wall -Wextra -Werror
@@ -39,17 +46,17 @@ LFLAGS += -lm -lmlx -lXext -lX11 -L./minilibx-linux-master
all: $(NAME)
# it verify if anything has changed in .c and .h files
# then it makes LDIR library, then it compiles NAME
$(NAME): $(ODIR) $(OBJS) $(DEPS)
make -C $(LDIR)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS)
# create "builds/" if doesn't exist
bonus: fclean $(ODIR) $(OBJS_B) $(DEPS)
make -C $(LDIR)
$(CC) $(CFLAGS) -o fdf $(OBJS_B) $(LFLAGS)
$(ODIR):
mkdir -p $@
# if a file.c has been modified, it's recompiled in object file.o
$(ODIR)/%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
@@ -61,7 +68,7 @@ leaks: $(NAME)
# valgrind --leak-check=full --leak-resolution=low --show-reachable=yes ./$(NAME) maps/42_color.fdf
clean:
/bin/rm -f $(OBJS)
/bin/rm -f $(OBJS) $(OBJS_B)
fclean: clean
/bin/rm -rf $(ODIR)