-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (42 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
NAME = so_long
CC = gcc
CFLAGS = -Wall -Wextra -Werror
RM = rm
RMFLAGS = -f
SRCDIR = src/
CFILES = $(SRCDIR)so_long.c \
$(SRCDIR)utils.c \
$(SRCDIR)init.c \
$(SRCDIR)input.c \
$(SRCDIR)flood.c \
$(SRCDIR)map.c
SRCDIR_BONUS = src_bonus/
CFILES_BONUS = $(SRCDIR_BONUS)so_long_bonus.c \
$(SRCDIR_BONUS)utils_bonus.c \
$(SRCDIR_BONUS)init_bonus.c \
$(SRCDIR_BONUS)input_bonus.c \
$(SRCDIR_BONUS)flood_bonus.c \
$(SRCDIR_BONUS)map_bonus.c \
$(SRCDIR_BONUS)enemy_bonus.c \
$(SRCDIR_BONUS)score_bonus.c
OBJS = $(CFILES:.c=.o)
OBJS_BONUS = $(CFILES_BONUS:.c=.o)
LIBFTDIR = libftprintf/
LIBFT = $(LIBFTDIR)libftprintf.a
all: $(NAME)
$(NAME): $(OBJS) $(LIBFT)
$(CC) $^ -Lmlx_linux -lmlx_Linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm -lz -o $@
%.o: %.c
$(CC) $(CFLAGS) -I/usr/include -Imlx_linux -c $^ -o $@
$(LIBFT): $(LIBFTDIR)/*.c
cd $(LIBFTDIR) && make
clean:
$(RM) $(RMFLAGS) $(OBJS) $(OBJS_BONUS)
cd $(LIBFTDIR) && make clean
fclean: clean
$(RM) $(RMFLAGS) $(NAME)
cd $(LIBFTDIR) && make fclean
re: fclean all
bonus: $(OBJS_BONUS) $(LIBFT)
$(CC) $^ -Lmlx_linux -lmlx_Linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm -lz -o $(NAME)
.PHONY: all clean fclean re bonus