-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.59 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: arepsa <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/17 10:25:25 by arepsa #+# #+# #
# Updated: 2023/05/17 10:25:36 by arepsa ### ########.fr #
# #
# **************************************************************************** #
NAME := libftprintf.a
SRCS = ft_printf.c\
ft_printf_utils.c\
ft_printf_ptr.c
CC := cc
CFLAGS := -Wall -Wextra -Werror
CPPFLAGS := -I. -g
LIBFLAGS := ar -rcs
RM := /bin/rm -f
SRCS_O := $(SRCS:.c=.o)
#create and index library (ar - archive, -r insert files by replacement, -c create the archve, -s index the files
#create .o files; also default compilation
#%.o : %.c
# $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
all: $(NAME)
$(NAME): $(SRCS_O)
$(LIBFLAGS) $(NAME) $(SRCS_O)
clean:
$(RM) $(SRCS_O)
fclean: clean
$(RM) $(NAME)
re: fclean all
#targets declared as .PHONY will force the command even if there is a subdirectory or file with it's name
.PHONY: all clean fclean re