-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (35 loc) · 1000 Bytes
/
Copy pathMakefile
File metadata and controls
51 lines (35 loc) · 1000 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
49
50
51
UNAME_S = $(shell uname -s)
NAME = fdf
CC = cc
RM = rm -f
SRC = main.c parsing.c wireframe.c fdf_split.c zoom_shift_iso_colour.c \
build_matrix.c cleaning_split.c catch_events.c get_filename.c \
catch_events2.c perspective.c colors.c utils.c exit.c dbg_fdf.c
OBJ = $(SRC:.c=.o)
FLAGS = -Wall -Wextra -Werror -O3
LIBFT:= libft/libft.a
LIBS :=
ifeq ($(UNAME_S),Darwin) # MacOS
FLAGS += -Imlx
LIBS += -Lmlx -lmlx -framework OpenGL -framework AppKit
else ifeq ($(UNAME_S),Linux) # Linux
FLAGS += -I/usr/include -Imlx_linux
LIBS += -Lmlx_linux -lmlx_Linux -L/usr/lib -lXext -lX11 -lm -lz
endif
%.o: %.c
$(CC) $(FLAGS) -Imlx -c $< -o $@
#>/dev/null
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
@ $(CC) $(OBJ) $(LIBS) -o $(NAME) $(LIBFT)
#-fsanitize=address -g3
$(LIBFT):
@ make -C libft/ >/dev/null
clean:
@ $(RM) $(OBJ)
@ make -C libft/ clean >/dev/null
fclean: clean
@ $(RM) $(NAME)
@ make -C libft/ fclean >/dev/null
re: fclean all
.PHONY: all libft clean fclean re