-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 2.67 KB
/
Makefile
File metadata and controls
69 lines (58 loc) · 2.67 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
59
60
61
62
63
64
65
66
67
68
69
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gabrodri <gabrodri@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/10/12 19:53:25 by gabrodri #+# #+# #
# Updated: 2023/10/12 19:54:36 by gabrodri ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
# CFLAGS are flags passed to the compiler. -Wall -Werror -Wextra are used to
CFLAGS = -Wall -Werror -Wextra -I. -c
# Part is the Mandatory files to submmit
MANDATORY = ft_printf.c ft_printf_utils.c
MANDATORY_OBJ = $(MANDATORY:.c=.o)
# This is the bonus part
BONUS = ft_printf_bonus.c
BONUS_OBJ = $(BONUS:.c=.o)
# The rule to compile all the files
all: $(NAME)
# The rule to compile the library without the bonus
$(NAME): $(MANDATORY_OBJ)
# ar: create, replace, and index; -options
@echo "------------------------------------"
@echo "Compiling the Library (no bonus)"
@echo "------------------------------------"
ar -rc $(NAME) $(MANDATORY_OBJ)
# The rule to compile the library with mandatory and bonus
bonus: $(BONUS_OBJ)
@echo "------------------------------------"
@echo "Compiling the Library (w/ bonus)"
@echo "------------------------------------"
ar -rc $(NAME) $(BONUS_OBJ)
# Add a target to run tests using the test.sh script
#test: all
# @echo "------------------------------------"
# @echo "Running the tests of the project"
# @echo "------------------------------------"
# sh ./tests/test.sh
# The rule to clean the object files
clean:
@echo "------------------------------------"
@echo "Cleaning the object files"
@echo "------------------------------------"
rm -f $(MANDT_OBJ) $(BONUS_OBJ)
# The rule to clean the object files and the library
fclean: clean
@echo "------------------------------------"
@echo "Cleaning the object files and the library"
@echo "------------------------------------"
rm -f $(NAME)
# The rule to clean the object files, the library, and recompile
re: fclean all
# The rule to clean the object files, the library, and recompile with bonus
# .PHONY targets for clean, fclean, all, and re for better Makefile behavior
.PHONY: clean fclean all re