-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·125 lines (97 loc) · 2.53 KB
/
Makefile
File metadata and controls
executable file
·125 lines (97 loc) · 2.53 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mafernan <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/07/04 08:57:02 by mafernan #+# #+# #
#* Updated: 2017/09/16 22:19:23 by mafernan ### ########.fr *#
# #
# **************************************************************************** #
NAME = 42sh
HDR = libft/libft.h\
includes/*.h
SRC1 = srcs/Main/*.c
SRC2 = srcs/Builtin/*.c
SRC3 = srcs/Heredoc/*.c
SRC4 = srcs/Bonus/*.c
SRC5 = srcs/Pipe_Redirects/*.c
SRC6 = srcs/Globbing/*.c
SRC7 = srcs/History/*.c
SRC8 = srcs/Termcap/*.c
SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8)
FLAGS = -iquotelibft -iquoteincludes -Wall -Werror -Wextra -g3 -g -pedantic
LIBFT = -L libft/ -lft
OPT = objs/*.o
define p1
tput cuu 1
echo " "
tput cuu 1
tput setaf 1
echo $1
tput sgr0
endef
define p2
tput cuu 1
echo " "
tput cuu 1
tput setaf 3
echo $1
tput sgr0
endef
define p3
tput cuu 1
echo " "
tput cuu 1
tput setaf 2
echo $1
tput sgr0
endef
define colourecho
tput blink
tput setaf 6
@echo $1
tput sgr0
endef
define colourecho1
tput setaf 6
@echo $1
tput sgr0
endef
define colourecho2
tput setaf 87
@echo $1
tput sgr0
endef
define green
tput setaf 2
@echo $1
tput sgr0
endef
define bar
echo $1
tput sgr0
endef
all: objs_dir
@clear
@export CLICOLOR='1'
@export TERM='xterm-256color'
@$(call colourecho2, "\nCompiling $(NAME):\n")
@rm -rf *.dSYM
# @make -C libft/ fclean && make -C libft/
@gcc -c $(HDR) $(SRC) $(FLAGS)
@ mv *.o objs/
@gcc -o $(NAME) $(OPT) $(LIBFT) $(FLAGS) -ltermcap
@rm -rf "-"
@$(call colourecho2, "Done Compiling!\n")
clean:
@/bin/rm -f $(OPT)
fclean: clean
@/bin/rm -f $(NAME)
@/bin/rm -rf *.gch
re: fclean all
objs_dir:
@mkdir -p objs
val:
@valgrind --leak-check=full ./$(NAME) && rm -rf *.dSYM