-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (33 loc) · 779 Bytes
/
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
SRCS = main.c \
utils.c \
B_SRCS = ${wildcard *_bonus.c}
OBJS = $(SRCS:.c=.o)
B_OBJS = $(B_SRCS:.c=.o)
HEADS = pipex.h
B_HEADS = pipex_bonus.h
LIBNAME = libft.a
LIB = libft
NAME = pipex
GCC = gcc -g -Wall -Wextra -Werror -MMD
RM = rm -f
%.o: %.c
$(GCC) -c -I$(LIB) $< -o $@
$(NAME): $(HEADS) $(OBJS) $(LIBNAME)
$(GCC) $(OBJS) $(LIBNAME) -o $(NAME)
all: $(NAME)
$(LIBNAME): lib
lib:
@$(MAKE) -C $(LIB)
bonus: $(B_HEADS) $(B_OBJS) $(LIBNAME)
$(GCC) $(B_OBJS) $(LIBNAME) -o $(NAME)
clean:
@$(MAKE) -C $(LIB) clean
$(RM) $(OBJS)
$(RM) $(B_OBJS)
fclean: clean
@$(MAKE) -C $(LIB) fclean
$(RM) $(wildcard *.d)
$(RM) $(NAME)
re: fclean all
include $(wildcard *.d)
.PHONY: all bonus clean fclean re lib