-
Notifications
You must be signed in to change notification settings - Fork 0
/
KYJO_makefile
46 lines (46 loc) · 1.21 KB
/
KYJO_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
NAME = client
NAME_TWO = server
CC = cc
CFLAGS = -Wall -Wextra -Werror
SRCS = client.c
SRCS_TWO = server.c
BNS_SRCS = client_bonus.c
BNS_SRCS_TWO = server_bonus.c
OBJS = $(SRCS:.c=.o)
OBJS_TWO = $(SRCS_TWO:.c=.o)
BNS_OBJS = $(BNS_SRCS:.c=.o)
BNS_OBJS_TWO = $(BNS_SRCS_TWO:.c=.o)
all : $(NAME) $(NAME_TWO)
%.o : %.c
$(CC) $(CFLAGS) -c $^ -o $@ -I./
$(NAME) : $(OBJS)
make -C ./libft all
$(CC) $(CFLAGS) $^ -I./minitalk.h libft/libft.a -o $@
touch all
rm -rf bonus
bonus : $(BNS_OBJS) $(BNS_OBJS_TWO)
make -C ./libft all
make -C ./ft_printf all
$(CC) $(CFLAGS) $(BNS_OBJS) -I./minitalk_bonus.h libft/libft.a -o $(NAME)
$(CC) $(CFLAGS) $(BNS_OBJS_TWO) -I./minitalk_bonus.h ft_printf/libftprintf.a -o $(NAME_TWO)
rm -f all
touch bonus
$(NAME_TWO) : $(OBJS_TWO)
make -C ./ft_printf all
$(CC) $(CFLAGS) $^ -I./ ft_printf/libftprintf.a -o $@
clean :
make -C ./ft_printf fclean
make -C ./libft fclean
rm -rf $(OBJS) $(BNS_OBJS)
rm -rf $(OBJS_TWO) $(BNS_OBJS_TWO)
fclean : clean
make -C ./ft_printf fclean
make -C ./libft fclean
rm -rf $(NAME)
rm -rf $(NAME_TWO)
rm -rf all
rm -rf bonus
re :
$(MAKE) fclean
$(MAKE) all
.PHONY: all clean fclean re