-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (44 loc) · 2.03 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
49
50
51
52
53
54
55
56
57
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aabduvak <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/01/19 17:06:01 by aabduvak #+# #+# #
# Updated: 2022/01/21 21:30:19 by aabduvak ### ########.fr #
# #
# **************************************************************************** #
SRCS = $(wildcard sources/*.c)
OBJS = $(SRCS:.c=.o)
NAME = libftprintf.a
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror
all : ${NAME}
$(NAME) : ${OBJS}
ar rc $(NAME) $(OBJS)
ranlib $(NAME)
.c.o :
${CC} ${CFLAGS} -c $< -o $@
# $< input files
# $@ output files
# in makefile used to create oputput files in their subfolder
clean :
${RM} ${OBJS}
fclean : clean
${RM} ${NAME}
norm :
norminette sources/*.[ch]
re : fclean all
help :
@echo "------------------------------------ <<HELP COMMAND>> ------------------------------------"
@echo ""
@echo "make --------- compiles all *.c files and create libftprintf.a library"
@echo "make bonus --------- compiles all bonus functions and create libftprintf.a library"
@echo "make clean --------- cleans all *.o files in sources"
@echo "make fclean --------- cleans all *.o files in sources and libftprintf.a library"
@echo "make re --------- cleans all files and compiles again"
@echo "make norm --------- controls all *.c and *.h codes to norminette standart"
@echo " --------- if finds norminette error will break"
.PHONY: all clean fclean re .c.o bonus