-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.67 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kalmheir <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/09/30 12:12:15 by kalmheir #+# #+# #
# Updated: 2022/07/30 18:11:55 by kalmheir ### ########.fr #
# #
# **************************************************************************** #
NAME := libft.a
MANDSDIR := src/general
PRINTFDR := src/ft_printf
FDPRINTFDR := src/fd_printf
ADTDIR := src/data_structures
GNLDIR := src/get_next_line
SRCDIRS := $(MANDSDIR) $(PRINTFDR) $(ADTDIR) $(GNLDIR) $(FDPRINTFDR)
SOURCES := $(shell find $(SRCDIRS) -name '*.c')
MLXUTILS := $(shell find src/mlx -name '*.c')
MLXUOBJS := $(MLXFLAGS) $(MLXUTILS:.c=.o)
OBJECTS := $(SOURCES:.c=.o)
LIBC := ar rcs
CC := gcc
RM := rm -f
CFLAGS := -Wall -Wextra -Werror
MLXFLAGS := -Imlx
nomlxc: nomlx clean
$(NAME): nomlx
nomlx: $(OBJECTS)
$(LIBC) $(NAME) $(OBJECTS)
allc: all clean
all: $(NAME) $(OBJECTS) $(MLXUOBJS)
$(LIBC) $(NAME) $(OBJECTS) $(MLXUOBJS)
.c.o:
$(CC) $(CFLAGS) -c $< -o $(<:.c=.o)
clean:
$(RM) $(OBJECTS)
$(RM) $(MLXUOBJS)
fclean: clean
$(RM) $(NAME)
re: fclean nomlx
rea: fclean all