-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
571 lines (420 loc) · 21.3 KB
/
Copy pathMakefile
File metadata and controls
571 lines (420 loc) · 21.3 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/23 03:22:46 by ldulling #+# #+# #
# Updated: 2025/01/24 23:53:02 by ldulling ### ########.fr #
# #
# **************************************************************************** #
# ***************************** CONFIGURATION ******************************** #
# Executable
NAME := minishell
MAKE_NAME := Crash
# Directories
SRC_DIR := source
INC_DIR := include
BUILD_DIR := build
OBJ_DIR := $(BUILD_DIR)/_obj
DEP_DIR := $(BUILD_DIR)/_dep
LIB_DIR := libraries
# Dependencies
LIBRARIES := $(LIB_DIR)/libft
LIBRARIES_EXT := readline termcap
LIB_INCLUDES := $(LIB_DIR)/libft/inc
BUILDFILES := Makefile \
$(BUILD_DIR)/parsing_table.mk \
$(BUILD_DIR)/source_files.mk \
$(BUILD_DIR)/welcome_art.mk
# Flags
CC ?= cc
CC_VERSION := $(shell $(CC) --version | head -1)
CFLAGS_STD := -Wall -Wextra -Werror
CFLAGS_DBG := -ggdb3
CFLAGS_SAN := -fsanitize=address,undefined,bounds,float-divide-by-zero
CFLAGS_OPT := -O3
CFLAGS ?= $(CFLAGS_STD) $(CFLAGS_DBG)
CPPFLAGS := $(addprefix -I,$(INC_DIR) $(LIB_INCLUDES))
DEPFLAGS = -M -MP -MF $@ -MT "$(OBJ_DIR)/$*.o $@"
LDFLAGS := $(addprefix -L,$(LIBRARIES))
LDLIBS := $(addprefix -l,$(patsubst lib%,%,$(notdir $(LIBRARIES) $(LIBRARIES_EXT))))
MAKEFLAGS += -j -s
# Macro definitions
include $(BUILD_DIR)/parsing_table.mk $(BUILD_DIR)/welcome_art.mk
CPPFLAGS += -D PARSING_TABLE=$(PARSING_TABLE) \
-D WELCOME_ART1=$(WELCOME_ART1) \
-D WELCOME_ART2=$(WELCOME_ART2)
# Characters
COMMA := ,
SPACE := $() $()
# Valgrind
VALGRIND := $(shell which valgrind)
VALGRINDFLAGS = --errors-for-leak-kinds=all \
--leak-check=full \
--show-error-list=yes \
--show-leak-kinds=all \
--suppressions=$(CURDIR)/minishell.supp \
--trace-children=yes \
--trace-children-skip=$(subst $(SPACE),$(COMMA),$(ABSOLUTE_PATHS)) \
--track-origins=yes
VALGRINDFDFLAGS := --track-fds=all
VALGRINDIGNORE := norminette
ABSOLUTE_PATHS := /bin/* \
/usr/bin/* \
/usr/sbin/* \
$(shell which -a $(VALGRINDIGNORE))
# Terminal
TERMINAL ?= $(if $(shell command -v gnome-terminal), gnome-terminal, \
$(if $(shell command -v terminator), terminator, \
$(if $(shell command -v xterm), xterm, \
)))
TERMINALTITLE := $(if $(filter val, $(MAKECMDGOALS)), valgrind $(MAKE_NAME), \
$(if $(filter valfd, $(MAKECMDGOALS)), valgrind-fd $(MAKE_NAME), \
$(MAKE_NAME)))
TERMINALFLAGS ?= $(if $(filter gnome-terminal, $(TERMINAL)), --title="$(TERMINALTITLE)" --, \
$(if $(filter terminator, $(TERMINAL)), --title="$(TERMINALTITLE)" -x, \
$(if $(filter xterm, $(TERMINAL)), -title "$(TERMINALTITLE)" -e, \
)))
# Files
include $(BUILD_DIR)/source_files.mk
SRC_EXTENSION := .c
OBJ := $(SRC:%$(SRC_EXTENSION)=$(OBJ_DIR)/%.o)
DEP := $(SRC:%$(SRC_EXTENSION)=$(DEP_DIR)/%.d)
# Subdirectories
OBJ_SUBDIRS := $(sort $(dir $(OBJ)))
DEP_SUBDIRS := $(sort $(dir $(DEP)))
# *************************** BUILD PREPARATION ****************************** #
export CC CFLAGS MAKECMDGOALS MAKEFLAGS
SHELL := /bin/bash
PHONY_TARGETS := all run noenv nocolor opt san val valfd term clear modes re \
build lib waitforlib clean fclean ffclean
ENV_VARIABLES := MODE TERMINAL
HELP_TARGETS := help help-print \
$(addprefix help-,$(PHONY_TARGETS) $(ENV_VARIABLES)) \
$(addsuffix -help,$(PHONY_TARGETS) $(ENV_VARIABLES))
PHONY_TARGETS += $(HELP_TARGETS)
export .PHONY : $(PHONY_TARGETS)
REBUILD_TARGETS := nocolor opt san re
CLEAN_TARGETS := clean fclean ffclean
.DEFAULT :
$(MAKE) help
.DEFAULT_GOAL := all
# ********************************* MODES ************************************ #
ENV :=
ifeq (run, $(filter run,$(MAKECMDGOALS) $(MODE)))
RUN := true
endif
ifeq (noenv, $(filter noenv,$(MAKECMDGOALS) $(MODE)))
ENV += env -i
RUN := true
endif
ifeq (nocolor, $(filter nocolor,$(MAKECMDGOALS) $(MODE)))
CPPFLAGS += -D NO_COLOR=1
RECOMPILE := true
endif
ifeq (opt, $(filter opt,$(MAKECMDGOALS) $(MODE)))
CFLAGS := $(CFLAGS_STD) $(CFLAGS_OPT)
RECOMPILE := true
endif
ifeq (san, $(filter san,$(MAKECMDGOALS) $(MODE)))
CFLAGS += $(CFLAGS_STD) $(CFLAGS_DBG) $(CFLAGS_SAN)
RECOMPILE := true
endif
ifeq (val, $(filter val,$(MAKECMDGOALS) $(MODE)))
ENV += $(VALGRIND) $(VALGRINDFLAGS)
PATH := /bin:/usr/bin:/usr/sbin:$(PATH)
RUN := true
endif
ifeq (valfd, $(filter valfd,$(MAKECMDGOALS) $(MODE)))
ENV += $(VALGRIND) $(VALGRINDFLAGS) $(VALGRINDFDFLAGS)
PATH := /bin:/usr/bin:/usr/sbin:$(PATH)
NEW_TERM := true
RUN := true
endif
ifeq (term, $(filter term,$(MAKECMDGOALS) $(MODE)))
NEW_TERM := true
RUN := true
endif
ifeq (clear, $(filter clear,$(MAKECMDGOALS) $(MODE)))
CLEAR := true
endif
# ***************************** BUILD TARGETS ******************************** #
all :
if $(MAKE) --question build; then \
echo -e -n $(MSG_NO_CHANGE); \
echo -e -n $(MSG_HELP); \
else \
echo -e -n $(MSG_MODE); \
echo -e -n " "$(MSG_INFO); \
echo -e -n " "$(MSG_HELP); \
echo -e -n $(MSG_START); \
if $(MAKE) build; then \
echo; \
echo -e -n $(MSG_SUCCESS); \
else \
echo; \
echo -e -n $(MSG_FAILURE); \
exit 42; \
fi; \
fi
run noenv nocolor opt san val valfd term clear: modes
modes :
if [ "$(RECOMPILE)" = "true" ]; then \
MAKELEVEL=$$(( $(MAKELEVEL) - 1 )) MSG_SUCCESS="" $(MAKE) re; \
MAKELEVEL=$$(( $(MAKELEVEL) - 1 )) $(MAKE) clean; \
else \
MAKELEVEL=$$(( $(MAKELEVEL) - 1 )) $(MAKE) all; \
fi
if [ "$(CLEAR)" = "true" ]; then \
clear; \
fi
if [ "$(NEW_TERM)" = "true" ] && [ -n "$(TERMINAL)" ]; then \
$(TERMINAL) $(TERMINALFLAGS) bash --posix -c \
"trap '' SIGINT; \
$(ENV) ./$(NAME); \
exec bash --posix"; \
elif [ "$(RUN)" = "true" ]; then \
$(ENV) "./$(NAME)"; \
fi
re :
$(MAKE) fclean
MAKELEVEL=$$(( $(MAKELEVEL) - 1 )) $(MAKE) all
# ***************************** BUILD PROCESS ******************************** #
# Dependency files inclusion
ifeq (, $(filter $(HELP_TARGETS) $(REBUILD_TARGETS) $(CLEAN_TARGETS),$(MAKECMDGOALS)))
ifneq (, $(wildcard $(OBJ_DIR)))
-include $(DEP)
endif
endif
# Library dependency management
ifeq (4.4, $(firstword $(sort $(MAKE_VERSION) 4.4)))
build : lib .WAIT $(NAME)
else
build : waitforlib
$(MAKE) $(NAME)
endif
# Library compilation
lib :
$(MAKE) -C $(LIBRARIES)
waitforlib : lib
# Executable linkage
$(NAME) : $(LIBRARIES) $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LDLIBS) -o $(NAME)
# Source file compilation
$(OBJ_DIR)/%.o : $(SRC_DIR)/%$(SRC_EXTENSION) $(BUILDFILES) | $(OBJ_SUBDIRS)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ \
&& echo -e -n $(MSG_PROGRESS)
# Pre-processing and dependency file creation
$(DEP_DIR)/%.d : $(SRC_DIR)/%$(SRC_EXTENSION) $(BUILDFILES) | $(DEP_SUBDIRS)
$(CC) $(CPPFLAGS) $(DEPFLAGS) $(CFLAGS) $<
# Directory structure mirroring of source files for build artifacts
$(OBJ_SUBDIRS) \
$(DEP_SUBDIRS) :
mkdir -p $@
# ***************************** CLEAN TARGETS ******************************** #
clean :
echo -e -n $(MSG_CLEAN)
$(MAKE) clean -C $(LIBRARIES)
rm -f $(OBJ) $(DEP)
ifneq (, $(wildcard $(OBJ_DIR)))
-find $(OBJ_DIR) -type d -empty -delete
endif
ifneq (, $(wildcard $(DEP_DIR)))
-find $(DEP_DIR) -type d -empty -delete
endif
echo -e -n $(MSG_SUCCESS)
fclean :
echo -e -n $(MSG_FCLEAN)
$(MAKE) clean
$(MAKE) fclean -C $(LIBRARIES)
rm -f $(NAME)
echo -e -n $(MSG_SUCCESS)
ffclean :
echo -e -n $(MSG_FFCLEAN)
$(MAKE) fclean
rm -rf $(OBJ_DIR) $(DEP_DIR)
echo -e -n $(MSG_SUCCESS)
# ****************************** HELP TARGETS ******************************** #
help :
echo -e "Targets:"
echo -e " all Build the project (default target)"
echo -e " run Build and run the project"
echo -e " noenv Build and run the project with an empty environment"
echo -e " nocolor Rebuild the project without colors in the prompt and printouts"
echo -e " opt Rebuild the project with optimizations"
echo -e " san Rebuild the project with sanitizers"
echo -e " val Build and run the project with valgrind"
echo -e " valfd Build and run the project with valgrind and file descriptor tracking"
echo -e " term Build and run the project in a new terminal window"
echo -e " clear Build the project and clear the terminal"
echo -e " re Rebuild the project"
echo -e " clean Remove build artifacts"
echo -e " fclean Remove build artifacts and executable"
echo -e " ffclean Remove build artifacts and executable without checking for unknown files"
echo -e " print-% Print the value of a Makefile variable (replace % with variable name)"
echo -e " help Display this message"
echo -e " help-% | %-help Display more information for a specific target (replace % with target name)"
echo
echo -e "Environment Variables:"
echo -e " MODE Build mode to combine multiple targets"
echo -e " TERMINAL Terminal emulator to use for targets opening a new terminal window"
echo
echo -e "Usage: make [\\$(STY_UND)target\\$(STY_RES)] [MODE=\"<\\$(STY_UND)mode1\\$(STY_RES)> [\\$(STY_UND)mode2\\$(STY_RES)] [...]\"] [TERMINAL=<\\$(STY_UND)terminal\\$(STY_RES)>]"
help-all :
echo -e "Build the project."
echo -e "This is the default target when no target is specified."
help-run :
echo -e "Build the project and run the executable."
help-noenv :
echo -e "Build the project and run executable with an empty environment (env -i)."
help-nocolor :
echo -e "Rebuild the project without colors in the prompt and printouts."
echo -e "Useful when ANSI escape sequences are not well supported in a terminal emulator."
help-opt :
echo -e "Rebuild the project with the following compiler optimization flags:"
echo -e " $(CFLAGS_OPT)"
help-san :
echo -e "Rebuild the project with the following sanitizer flags:"
echo -e " $(CFLAGS_SAN)"
help-val :
echo -e "Build the project and run the executable with valgrind."
echo
echo -e "The following valgrind flags are used:"
echo -e "$(VALGRINDFLAGS)" | tr ' ' '\n' | sed 's/^/ /'
help-valfd :
echo -e "Build the project and run the executable with valgrind and file descriptor tracking."
echo -e "A new terminal window is opened to avoid inheriting open file descriptors."
echo
echo -e "The following valgrind flags are used:"
echo -e "$(VALGRINDFLAGS)" | tr ' ' '\n' | sed 's/^/ /'
echo -e "File descriptor specific flags:"
echo -e "$(VALGRINDFDFLAGS)" | tr ' ' '\n' | sed 's/^/ /'
help-term :
echo -e "Build the project and run the executable in a new terminal window."
echo -e "The terminal emulator used is determined by the TERMINAL variable."
echo
echo -e "The following terminal emulator is used by default:"
echo -e " $(TERMINAL)"
echo
echo -e "Usage: make term [TERMINAL=<\\$(STY_UND)terminal\\$(STY_RES)>]"
help-clear :
echo -e "Build the project and clear the terminal."
help-re :
echo -e "Rebuild the project."
help-clean :
echo -e "Remove build artifacts."
help-fclean :
echo -e "Remove build artifacts and the executable."
help-ffclean :
echo -e "Remove build artifacts and the executable without checking for unknown files."
help-print :
echo -e "Print the value of a Makefile variable by appending the variable name to print-..."
echo -e "Useful for Makefile debugging."
echo
echo -e "Usage: make print-<\\$(STY_UND)variable name\\$(STY_RES)>"
help-help :
echo -e "Display more information for a specific target by appending or prepending help."
echo
echo -e "Usage: make help-<\\$(STY_UND)target\\$(STY_RES)> | make <\\$(STY_UND)target\\$(STY_RES)>-help"
help-MODE MODE-help:
echo -e "Build mode to combine with other targets."
echo -e "Multiple modes can be combined by separating them with a space."
echo
echo -e "Usage: make <\\$(STY_UND)target\\$(STY_RES)> MODE=\"<\\$(STY_UND)mode1\\$(STY_RES)> [\\$(STY_UND)mode2\\$(STY_RES)] [...]\""
help-TERMINAL TERMINAL-help:
echo -e "Override the default terminal emulator for targets opening a new terminal window."
echo
echo -e "Usage: make <\\$(STY_UND)target\\$(STY_RES)> TERMINAL=<\\$(STY_UND)terminal\\$(STY_RES)>"
%-help:
$(MAKE) help-$(subst -help,,$@)
# ********************************* COLORS *********************************** #
STY_RES := "\e[0m"
STY_BOL := "\e[1m"
STY_ITA := "\e[3m"
STY_UND := "\e[4m"
STY_RED := "\e[31m"
STY_GRE := "\e[32m"
STY_YEL := "\e[33m"
STY_BLU := "\e[34m"
STY_MAG := "\e[35m"
STY_CYA := "\e[36m"
STY_WHI := "\e[37m"
STY_GRA := "\e[90m"
STY_WHI_BRI := "\e[97m"
STY_BLA_BG := "\e[40m"
STY_RED_BG := "\e[41m"
STY_GRE_BG := "\e[42m"
STY_YEL_BG := "\e[43m"
STY_BLU_BG := "\e[44m"
STY_MAG_BG := "\e[45m"
STY_CYA_BG := "\e[46m"
STY_WHI_BG := "\e[47m"
STY_GRA_BG := "\e[100m"
STY_WHI_BRI_BG := "\e[107m"
# **************************** CUSTOM MESSAGES ******************************* #
MSG_PROGRESS := $(STY_ITA)"🌊"$(STY_RES)
########################## Top-level only messages #############################
ifeq (0, $(MAKELEVEL))
# Make status messages
MSG_INFO := $(STY_ITA)$(STY_WHI)"Make version: $(MAKE_VERSION)\n\
Compiler version: $(CC_VERSION)"$(STY_RES)"\n"
MSG_HELP := $(STY_ITA)$(STY_WHI)"Run 'make help' to see all available Makefile targets."$(STY_RES)"\n"
ifneq (, $(filter $(REBUILD_TARGETS),$(MAKECMDGOALS) $(MODE)))
MSG_START := $(STY_ITA)"Rebuilding $(MAKE_NAME) ... "$(STY_RES)
else
MSG_START := $(STY_ITA)"Building $(MAKE_NAME) ... "$(STY_RES)
endif
MSG_SUCCESS ?= $(STY_BOL)$(STY_ITA)$(STY_CYA)"DONE!"$(STY_RES)"\n"
MSG_NO_CHANGE := $(STY_ITA)$(STY_WHI)"Everything up-to-date!"$(STY_RES)"\n"
MSG_FAILURE := $(STY_BOL)$(STY_ITA)$(STY_RED)"BUILD FAILED!"$(STY_RES)"\n"
# Build modes
MSG_RUN := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_YEL)"~~~~~~~~~~~~~~~~~~~~~~~ RUN MODE ~~~~~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter run,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_RUN)
endif
MSG_NOENV := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_MAG)"~~~~~~~~~~~~~~~~ EMPTY ENVIRONMENT MODE ~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter noenv,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_NOENV)
endif
MSG_NOCOLOR := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_WHI_BRI)"~~~~~~~~~~~~~~~~~~~~~ NO COLOR MODE ~~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter nocolor,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_NOCOLOR)
endif
MSG_OPT := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_GRE)"~~~~~~~~~~~~~~~~~~~ OPTIMIZATION MODE ~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter opt,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_OPT)
endif
MSG_SAN := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_RED)"~~~~~~~~~~~~~~~~~~~~ SANITIZER MODE ~~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter san,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_SAN)
endif
MSG_VAL := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_BLU)"~~~~~~~~~~~~~~~~~~~~~ VALGRIND MODE ~~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter val,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_VAL)
endif
MSG_VALFD := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_CYA)"~~~~~~~~~~~~~~~~~~~ VALGRIND FD MODE ~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter valfd,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_VALFD)
endif
MSG_TERM := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_YEL)"~~~~~~~~~~~~~~~~~~~ NEW TERMINAL MODE ~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter term,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_TERM)
endif
MSG_CLEAR := $(STY_BOL)$(STY_ITA)$(STY_UND)$(STY_GRA)"~~~~~~~~~~~~~~~~~~~~~ CLEAR MODE ~~~~~~~~~~~~~~~~~~~~"$(STY_RES)"\n"
ifneq (, $(filter clear,$(MAKECMDGOALS) $(MODE)))
MSG_MODE := $(MSG_MODE)$(MSG_CLEAR)
endif
# Clean messages
MSG_CLEAN := $(STY_ITA)"Cleaning up build artifacts ... "$(STY_RES)"\n"
MSG_FCLEAN := $(STY_ITA)"Cleaning up build artifacts and executable ... "$(STY_RES)"\n"
MSG_FFCLEAN := $(STY_ITA)"Forcefully cleaning up build artifacts directory and executable ... "$(STY_RES)"\n"
endif
################################################################################
# *************************** MAKEFILE DEBUGGING ***************************** #
print-% :
echo -e $* = $($*)
# ********************************* NOTES ************************************ #
# PATH_MAX (4096 characters):
# 255------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/510------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/765------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/1020-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/1275-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/1530-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/1785-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/2040-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/2295-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/2550-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/2805-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/3060-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/3315-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/3570-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/3825-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/4080-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/