-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
102 lines (89 loc) · 3.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kostya <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/09/09 20:07:05 by kostya #+# #+# #
# Updated: 2021/12/01 13:30:07 by kostya ### ########.fr #
# #
# **************************************************************************** #
# ------------------------------ compiler options ------------------------------
NAME = Fract-ol
CC = clang
CFLAGS = -Wall -Wextra -Werror
CFLAGS += -D NR_THREADS=`nproc --all`
CFLAGS += -D FLOAT="long double"
COPTIONS = -O3 -ffast-math
# ------------------------------- linker options -------------------------------
LIBRARY =
OBJS_DIR = obj
INCLUDE_DIR = inc
SRCS_DIR = src
LIBGNL =
LIBFT =
LIBGUI = ../GUIlib
# ------------------------------- project sorces -------------------------------
SRCS = \
error1 \
error2 \
error \
event \
ft_atodl \
ft_memcmp \
ft_memset \
julia \
main \
mandelbrot \
memory \
newton_pool \
options \
utils1 \
utils2 \
utils \
palette \
palette1 \
# ------------------------------------------------------------------------------
HDRS = \
color \
error \
event \
fract_ol \
global \
memory
# ======================= UNCHANGEABLE PART OF MAKEFILE ========================
# ------------------------------------------------------------------------------
RM = rm -f
OBJS = $(addprefix ${OBJS_DIR}/,${SRCS:=.o})
DEPS = $(addprefix ${INCLUDE_DIR}/,${HDRS:=.h})
INCLUDE = -I ${INCLUDE_DIR} -I ${LIBGUI}/include
OS = $(shell uname -s | tr A-Z a-z)
LIBRARY = -lstdgui -lm `../GUIlib/guiflags.sh`
# ------------------------------------------------------------------------------
all: ${OBJS_DIR} ${NAME}
# ------------------------------------------------------------------------------
${OBJS_DIR}/%.o: ${SRCS_DIR}/%.c ${DEPS} Makefile
${CC} ${CFLAGS} ${COPTIONS} -c -o $@ $< ${INCLUDE}
# ------------------------------------------------------------------------------
$(NAME): ${OBJS} ${DEPS}
${CC} -o ${NAME} ${CFLAGS} ${COPTIONS} ${OBJS} ${LIBRARY}
# ------------------------------------------------------------------------------
f:
rm -f __make_all_FILE.c
cat $(addprefix $(SRCS_DIR)/,$(SRCS:=.c)) > __make_all_FILE.c
${CC} -o ${NAME} ${INCLUDE} -O3 -ffast-math -Wall -Wextra __make_all_FILE.c ${LIBRARY}
rm -f __make_all_FILE.c
# ------------------------------------------------------------------------------
clean:
${RM} ${OBJS}
# ------------------------------------------------------------------------------
fclean: clean
${RM} ${NAME}
# ------------------------------------------------------------------------------
${OBJS_DIR}:
mkdir -p ${OBJS_DIR}
# ------------------------------------------------------------------------------
re: fclean all
# ------------------------------------------------------------------------------
.PHONY: all f clean fclean install re