-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 866 Bytes
/
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
NAME = fdf
CFLAGS = -Wextra -Wall -Werror -Wunreachable-code -o2fast
LIBMLX = ./MLX42
HEADERS = -I ./include -I $(LIBMLX)/include
LIBS = $(MLX) $(LIBFT)
MLX = $(LIBMLX)/build/libmlx42.a -Iinclude -lglfw -L"/Users/$(USER)/.brew/opt/glfw/lib/"
SRCS = draw_lines.c draw_lines2.c hooks.c fdf.c matrix.c parse.c parse2.c pipeline.c t_utils.c vertexutils.c vertexutils2.c ft_hexstr_to_int.c color.c color2.c transform.c
OBJS = $(SRCS:.c=.o)
LIBFT = ./libft/libft.a
all: libmlx $(NAME)
libmlx:
cmake $(LIBMLX) -B $(LIBMLX)/build && make -C $(LIBMLX)/build -j4
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS)
$(NAME): $(OBJS)
$(CC) $(OBJS) $(LIBS) $(HEADERS) $(CFLAGS) -o $(NAME)
$(LIBFT):
make -C ./libft/
clean:
rm -rf $(OBJS)
rm -rf $(LIBMLX)/build
make clean -C ./libft/
fclean: clean
rm -rf $(NAME)
re: clean all
.PHONY: all, clean, fclean, re, libmlx