-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·65 lines (48 loc) · 1.64 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bsouchet <bsouchet@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/05/03 22:30:54 by bsouchet #+# #+# #
# Updated: 2017/05/05 19:49:03 by bsouchet ### ########.fr #
# #
# **************************************************************************** #
C = clang
NAME = libftprintf.a
FLAGS = -Wall -Wextra -Werror -O2
LIBFT = libft
DIR_S = sources
DIR_O = temporary
HEADER = include
SOURCES = ft_printf.c \
parse_arguments.c \
handle_numbers.c \
handle_strings.c \
bonus_functions.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
@mkdir -p temporary
@$(CC) $(FLAGS) -I $(HEADER) -o $@ -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