-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (33 loc) · 951 Bytes
/
Makefile
File metadata and controls
48 lines (33 loc) · 951 Bytes
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
NAME = libft_linalg.a
CC = cc
CFLAGS = -c -Wall -Wextra -Werror
CPPFLAGS = -Iinclude -I$(LIBFTDIR)
SRCDIR = src
SRCFILES = vec2.c vec3.c vec3_cross.c vec4.c vector_utils.c vec_transform.c\
mat2.c mat3.c mat4.c mat_col_to_vec.c mat_row_to_vec.c mat_to_str.c\
mat23_rotate.c mat4_rotate.c mat_translate.c
SRCS = $(addprefix $(SRCDIR)/, $(SRCFILES))
OBJDIR = obj
OBJFILES = $(SRCFILES:.c=.o)
OBJS = $(addprefix $(OBJDIR)/, $(OBJFILES))
LIBFTDIR = ./libft
AR = ar
AFLAGS = -crs
all: CFLAGS += -O3
all: $(NAME)
debug: CFLAGS += -O0 -g -DDEBUG
debug: $(NAME)
$(NAME): $(OBJS)
$(AR) $(AFLAGS) $(NAME) $(OBJS)
$(OBJDIR)/%.o: $(SRCDIR)/%.c | $(LIBFTDIR) $(OBJDIR)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $<
$(LIBFTDIR) $(LIBFT_DIR)/libft.h:
@ git clone -b inc_math [email protected]:/MFelida/libft.git $(LIBFT_DIR)
$(OBJDIR):
@mkdir -p $(OBJDIR)
clean:
@rm -rf $(OBJDIR)
fclean: clean
@rm -rf $(NAME)
re: fclean all
.PHONY: all clean fclean re