-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (38 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
52 lines (38 loc) · 1.64 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ffahey <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/12/17 13:11:37 by ffahey #+# #+# #
# Updated: 2019/01/10 14:51:30 by marvin ### ########.fr #
# #
# **************************************************************************** #
vpath %.c srcs
vpath %.o bin
vpath %.h includes
CFLAGS = -Wall -Wextra -Werror
NAME = libftprintf.a
SRC_PATH = srcs
HEAD_PATH = includes
BIN_PATH = bin
SRC = ft_putchar.c ft_putwchar.c ft_putnchar.c ft_putstr.c ft_strlen.c ft_strdup.c ft_wstrlen.c ft_putwstr.c\
ft_printf.c ft_read_format.c ft_create_format.c ft_print_format.c \
ft_print_c.c ft_print_s.c ft_print_num.c ft_print_dec.c ft_itoa.c ft_print_oct.c ft_print_hex.c\
float_to_str.c ft_itoa.c ft_strjoin.c
OBJ = $(patsubst %.c,bin/%.o,$(SRC))
.PHONY: all clean fclean re
all: $(BIN_PATH) $(NAME)
$(BIN_PATH):
@mkdir bin
$(NAME): $(OBJ)
ar rc $@ $^
ranlib $@
$(BIN_PATH)/%.o: $(SRC_PATH)/%.c
gcc $(CFLAGS) -c $^ -o $@ -I$(HEAD_PATH)
clean:
@rm -rf bin
fclean: clean
@rm -f $(NAME)
re: fclean all