-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (50 loc) · 1.74 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: akupriia <akupriia@student.unit.ua> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/12/28 19:24:02 by vbrazas #+# #+# #
# Updated: 2018/11/15 20:06:58 by akupriia ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_ls
LIB = ft_printf/
LIB_HDR = $(LIB)hdr/
SRC_D = sources/
SRC = $(SRC_D)ls_main.c \
$(SRC_D)open_read.c \
$(SRC_D)sort_hdir.c \
$(SRC_D)extr_print_sinfo.c \
$(SRC_D)print_output.c \
$(SRC_D)assign_al.c \
$(SRC_D)do_sorting.c \
$(SRC_D)print_perm.c \
$(SRC_D)print_lstat.c \
$(SRC_D)handle_cap_r.c \
$(SRC_D)utils.c \
$(SRC_D)handle_xattr.c
OBJ_D = obj/
OBJ = $(addprefix $(OBJ_D), $(SRC:.c=.o))
LFLAGS = -lftprintf -L $(LIB)
IFLAGS = -I $(LIB_HDR) -I ./
CFLAGS = -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(OBJ)
make -C $(LIB)
gcc -o $(NAME) $(CFLAGS) $(LFLAGS) $(OBJ)
$(OBJ): | $(OBJ_D)
$(OBJ_D):
mkdir -p $(OBJ_D)$(SRC_D)
$(OBJ_D)%.o: %.c
gcc $(CFLAGS) $(IFLAGS) -o $@ -c $<
clean:
rm -f $(OBJ)
make clean -C $(LIB)
fclean: clean
rm -f $(NAME)
rm -rf $(OBJ_D)
make fclean -C $(LIB)
re: fclean all
.PHONY: all clean fclean re