-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1.52 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: nrepak <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/01/15 19:34:18 by nrepak #+# #+# #
# Updated: 2018/01/16 20:58:58 by nrepak ### ########.fr #
# #
# **************************************************************************** #
NAME := libftprintf.a
SRC := ft_printf.c percentage.c character.c string.c wide_string.c \
decimal.c unsigned_decimal.c octal.c hexadecimal.c pointer.c \
width_and_precision.c zero_flag.c auxiliary.c auxiliary2.c
OBJ_DIR := obj
FLAGS := -Wall -Wextra -Werror
LIBDIR := ./libft
OBJ := $(addprefix $(OBJ_DIR)/, $(SRC:.c=.o))
all: $(NAME)
$(NAME): $(OBJ)
@make -C $(LIBDIR)
@cd $(LIBDIR) && mv *.o ../obj
@ar rc $(NAME) obj/*.o
$(OBJ_DIR)/%.o: ./%.c
@mkdir -p $(OBJ_DIR)
@gcc $(FLAGS) -c $< -o $@
clean:
@make clean -C $(LIBDIR)
@rm -rf obj
fclean: clean
@/bin/rm -f $(NAME)
@make fclean -C $(LIBDIR)
re: fclean all
.PHONY: all clean fclean re