-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (58 loc) · 1.84 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: alischyn <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/03/24 13:09:20 by alischyn #+# #+# #
# Updated: 2017/03/28 17:18:45 by alischyn ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra -Ift_printf
LDFLAGS = -Lft_printf -lftprintf
SOURCES = main.c \
arg_parser.c \
fileinfo.c \
fileinfo_format.c \
fileinfo_format_perms.c \
fileinfo_format_nlinks.c \
fileinfo_format_owner_name.c \
fileinfo_format_owner_group.c \
fileinfo_format_size.c \
fileinfo_format_mtime.c \
fileinfo_format_name.c \
vec_alloc.c \
vec_stack.c \
vec_iter.c \
vec_sort.c \
ls_pre_main.c \
ls_main.c \
ls_print.c \
ls_print_prepare.c \
sort.c
OBJECTS = $(addprefix obj/,$(subst .c,.o,$(SOURCES)))
NAME = ft_ls
ifeq ($(DEBUG),1)
CFLAGS += -g
else
CFLAGS += -O3
endif
all: $(NAME)
$(NAME): $(OBJECTS) ft_printf/libftprintf.a
$(CC) -o $@ $^ $(LDFLAGS)
obj/%.o: %.c *.h
@mkdir -p obj
$(CC) $(CFLAGS) -c -o $@ $<
ft_printf/libftprintf.a:
make -C ft_printf
clean:
rm -rf obj
make -C ft_printf clean
fclean:
rm -rf obj $(NAME)
make -C ft_printf fclean
re: fclean all
norm:
norminette *.c *.h