-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (45 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
58 lines (45 loc) · 1.72 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
53
54
55
56
57
58
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ozamora- <ozamora-@student.42madrid.com +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/10/16 20:23:15 by ozamora- #+# #+# #
# Updated: 2024/11/09 17:33:34 by ozamora- ### ########.fr #
# #
# **************************************************************************** #
# Library name
NAME = libftprintf.a
# Compiler and its flags
CC = cc
CFLAGS = -Wall -Wextra -Werror
# Library archiver and its flags
AR = ar
ARFLAGS = rcs
# Source files
SRC = ft_printf.c ft_strlen.c\
ft_putchar.c ft_putstr.c ft_putptr.c \
ft_putnbr.c ft_putnbr_base.c ft_putnbr_unsigned.c \
# List of object files, replace .c with .o
OBJ = $(SRC:.c=.o)
# Header
INCLUDE = ft_printf.h
# Default rule to create the library
all: $(NAME)
# Rule to create the static library
$(NAME): $(OBJ)
$(AR) $(ARFLAGS) $(NAME) $(OBJ)
# Rule to compile object files from source files
%.o: %.c $(INCLUDE)
$(CC) $(CFLAGS) -c $< -o $@
# Rule to clean generated files
clean:
rm -f $(OBJ) *.out *gch
# Rule to clean generated files and the executablle
fclean: clean
rm -f $(NAME)
# Rule to recompile from zero.
re: fclean all
# Phony targets
.PHONY: all clean fclean re