-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (46 loc) · 1.88 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mbutt <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/09/18 15:35:11 by mbutt #+# #+# #
# Updated: 2019/11/07 02:14:36 by mbutt ### ########.fr #
# #
# **************************************************************************** #
NC:=\033[0m
GREEN:=\033[1;32m
ORANGE:=\033[0;33m
YELLOW:=\033[1;33m
CYAN:=\033[1;36m
NAME = ft_ls
CC = gcc
#CFLAGS = -Wall -Wextra -Werror -I. -c
CFLAGS = -I. -c -g
WFLAGS = -Wall -Wextra -Werror
DEBUG = -fsanitize=address -g #-ggdb
#DEBUG = -fsanitize=undefined
SRC = ft_ls_src/*.c
OBJ = *.o
#OBJ = $(SRC:.c=.o)
FT_PRINTF_DIR = ft_ls_src/ft_printf/
FT_PRINTF_STATIC = ft_ls_src/ft_printf/libftprintf.a
all: $(NAME)
$(NAME):
@make -C $(FT_PRINTF_DIR) # runs Makefile for ft_printf
@echo "${CYAN}Compiling Makefile for ft_ls...${NC}"
@$(CC) $(CFLAGS) $(WFLAGS) $(SRC) # Creates .o(object) files
@$(CC) $(OBJ) $(FT_PRINTF_STATIC) $(DEBUG) -o $(NAME)
@echo "${GREEN}Generated ft_ls succesfully.${NC}"
clean:
make clean -C ft_ls_src/ft_printf/
/bin/rm -rf $(OBJ)
@echo "${ORANGE}Removed object files for ft_ls.${NC}"
fclean:
make fclean -C ft_ls_src/ft_printf/
/bin/rm -rf $(NAME) $(OBJ)
@echo "${ORANGE}Removed obect files for ft_ls.${NC}"
@echo "${YELLOW}Removed ft_ls.${NC}"
re: fclean all
.PHONY: all clean fclean re