-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (49 loc) · 2.04 KB
/
Copy pathMakefile
File metadata and controls
56 lines (49 loc) · 2.04 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tbui-quo <tbui-quo@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/01/23 13:00:46 by tbui-quo #+# #+# #
# Updated: 2023/01/25 14:48:10 by tbui-quo ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
# Name des kompilierten Programms
SRCS = ft_printf.c ft_utils.c
# Hier alle zu kompilierenden .c-Dateien erfassen
OBJS = ${SRCS:.c=.o}
# Damit nur veränderte .c-Dateien in .o-Dateien kompiliert werden
SUB_DIRECTORIES = libft
# auflistung aller Subdirectories
OBJS_SUB = $(shell find $(SUB_DIRECTORIES) -type f -name "*.o")
RM = rm -f
# -f (force) macht fclean jederzeit ausführbar (auch ohne .o-Dateien)
CC = cc
# Kompiliersprache
CFLAGS = -Wall -Wextra -Werror
MAIN = main.c
MAGENTA = \033[0;95m
all: ${NAME}
# Die verwendeten Flags
${NAME}: makelibft ${OBJS}
ar rcs ${NAME} ${OBJS}
compile:
$(CC) $(MAIN) $(NAME)
makelibft:
@echo "$(MAGENTA)Compiling:"
make -C libft
cp libft/libft.a ${NAME}
clean:
${RM} ${OBJS}
${RM} $(shell find $(SUB_DIRECTORIES) -type f -name "*.o")
# Löscht die .o-Dateien und die .o-Datein der Subdirectories
fclean: clean
${RM} ${NAME}
${RM} $(shell find $(SUB_DIRECTORIES) -type f -name "*.a")
# Löscht die .a- und exe-Dateien und die .a-Dateien der Subdirectories
re: fclean all
# Löscht und rekompiliert
.PHONY: all clean fclean re
# Führt die Befehle aus, auch wenn eine gleichnamige Datei existiert