-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (59 loc) · 2.44 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
73
74
75
76
77
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aabduvak <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/02/15 16:23:46 by aabduvak #+# #+# #
# Updated: 2022/02/19 23:57:51 by aabduvak ### ########.fr #
# #
# **************************************************************************** #
SRCS = $(wildcard sources/*.c)
OBJS = $(SRCS:.c=.o)
NAME = fdf
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror
LIB = ./libft/libft.a
MINILIB = ./minilibx_macos/libmlx.a
INC_FT = ./libft/sources
INC_GN = ./libft/GNL/sources
INC_PR = ./libft/ft_printf/sources
INC_MX = ./minilibx_macos
LIB_PRINT = ./libft/ft_printf/libftprintf.a
all : $(LIB) $(MINILIB) ${NAME}
$(MINILIB):
make -C ./minilibx_macos
$(LIB):
make -C ./libft
$(NAME) : ${OBJS}
$(CC) $(OBJS) -framework OpenGL -framework AppKit -o $(NAME) $(LIB_PRINT) $(LIB) $(MINILIB)
.c.o :
${CC} ${CFLAGS} -c $< -o $@ -I$(INC_PR) -I$(INC_GN) -I$(INC_FT) -I$(INC_MX)
# $< input files
# $@ output files
# in makefile used to create oputput files in their subfolder
clean :
${RM} ${OBJS}
fclean : clean
${RM} ${NAME}
ffclean: fclean
make fclean -C ./libft
make clean -C ./minilibx_macos
run :
@./$(NAME)
norm :
@norminette libft/
@norminette sources/*.[ch]
re : fclean all
help :
@echo "------------------------------------ <<HELP COMMAND>> ------------------------------------"
@echo ""
@echo "make --------- compiles all *.c files and create libftprintf.a library"
@echo "make clean --------- cleans all *.o files in sources"
@echo "make fclean --------- cleans all *.o files in sources and libftprintf.a library"
@echo "make re --------- cleans all files and compiles again"
@echo "make norm --------- controls all *.c and *.h codes to norminette standart"
@echo " --------- if finds norminette error will break"
.PHONY: all clean fclean re .c.o