-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (26 loc) · 679 Bytes
/
Makefile
File metadata and controls
42 lines (26 loc) · 679 Bytes
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
NAME=libftprintf.a
MAKE_LIBFT=cd libft && make
LIBFT_INTO_LIBFTPRINTF=cp libft.a $(NAME)
FCLEAN_LIBFT=cd libft && make fclean
CC=gcc
CFLAGS=-Wall -Werror -Wextra
SRC=ft_printf.c ft_printf_other_convs.c ft_printf_int_convs.c
FTPRINTF_OBJ=$(SRC:.c=.o)
BONUS_SRC=ft_printf_bonus.c ft_printf_other_convs_bonus.c \
ft_printf_int_convs_bonus.c
BONUS_OBJ=$(BONUS_SRC:.c=.o)
all: $(NAME)
$(NAME): $(FTPRINTF_OBJ)
@$(MAKE_LIBFT)
@$(LIBFT_INTO_LIBFTPRINTF)
@$(FCLEAN_LIBFT)
@ar -r $(NAME) $(FTPRINTF_OBJ)
bonus: $(BONUS_OBJ)
@make FTPRINTF_OBJ="$(BONUS_OBJ)"
%.o: %.c
@$(CC) $(CFLAGS) -c $< -o $@
re: fclean all
fclean: clean
@rm -rf $(NAME)
clean:
@rm -rf *.o