-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (54 loc) · 1.79 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
69
70
71
72
73
74
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yinzhang <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/05/17 14:56:05 by yinzhang #+# #+# #
# Updated: 2019/05/31 15:54:19 by yinzhang ### ########.fr #
# #
# **************************************************************************** #
C = gcc
NAME = libftprintf.a
FLAGS = -Wall -Wextra -Werror
LIBFT = libft
DIR_S = srcs
DIR_O = obj
HEADER = includes
SOURCES = char.c conversions.c\
ft_printf.c modifers.c\
string.c auxilliary.c\
pointer.c int.c\
octal.c hex.c\
udecimalint.c float.c\
auxilliary2.c float2.c\
cat.c binary.c\
SRCS = $(addprefix $(DIR_S)/,$(SOURCES))
OBJS = $(addprefix $(DIR_O)/,$(SOURCES:.c=.o))
all: $(NAME)
$(NAME): $(OBJS)
@make -C $(LIBFT)
@cp libft/libft.a ./$(NAME)
@ar rc $(NAME) $(OBJS)
@ranlib $(NAME)
$(DIR_O)/%.o: $(DIR_S)/%.c $(HEADER)/ft_printf.h
@mkdir -p obj
@$(CC) $(FLAGS) -I $(HEADER) -o $@ -c $<
test:
@make all misc/main.c
norme:
norminette ./libft/
@echo
norminette ./$(HEADER)/
@echo
norminette ./$(DIR_S)/
clean:
@rm -f $(OBJS)
@rm -rf $(DIR_O)
@make clean -C $(LIBFT)
fclean: clean
@rm -f $(NAME)
@make fclean -C $(LIBFT)
re: fclean all
.PHONY: fclean re norme all clean