-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·72 lines (55 loc) · 1.97 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#******************************************************************************#
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jmoiroux <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2014/01/02 11:51:53 by jmoiroux #+# #+# #
# Updated: 2014/01/19 18:24:38 by jmoiroux ### ########.fr #
# #
#******************************************************************************#
COMPIL = gcc -Wall -Wextra -Werror -w
#COMPIL = clang -Wall -Wextra -Werror -w
RM = rm -rf
HEADER = glide.h
ifeq "$(PLATFORM)" "WIN32" #Mac
NAME = open3d.exe
else #Linux & Mac
NAME = open3d
endif
PLATFORM := $(shell uname)
SRC = \
main.c \
2d_triangle.c \
2d_triforce.c \
keyword.c
OBJS = $(SRC:.c=.o)
LIB = libft/libft.a
ifeq "$(PLATFORM)" "Darwin" #Mac
GL = -framework GLUT -framework OpenGL -framework Cocoa
endif
ifeq "$(PLATFORM)" "Linux" #Linux
GL = -lGL -lGLU -lglut
endif
ifeq "$(PLATFORM)" "Win32" #Windows
GL = -lopengl32 -lglu32 -lglut32
endif
all : $(NAME)
$(LIB):
make -C libft
%.o: %.c $(HEADER)
$(COMPIL) $(SRC) -I /libft -I /includes -c $<
$(NAME): $(LIB) $(MLX) $(OBJS)
$(COMPIL) $(OBJS) -o $(NAME) $(GL) -L libft -lft
@echo "----------------- Compil for $(PLATFORM)... Done -----------------"
clean:
$(RM) $(OBJS)
make clean -C libft
@echo "----------------- Clean for $(PLATFORM)... Done -----------------"
fclean: clean
$(RM) $(NAME)
make fclean -C libft
@echo "----------------- FClean for $(PLATFORM)... Done -----------------"
re: fclean all
.PHONY: all clean fclean re