-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 1.39 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ugerkens <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/07/14 16:05:56 by ugerkens #+# #+# #
# Updated: 2024/01/17 14:03:51 by ugerkens ### ########.fr #
# #
# **************************************************************************** #
# Variables
NAME = get_next_line.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror -Isrc -Iinclude
RM = rm -rf
# Paths and Files
VPATH = src
SRCS = get_next_line.c get_next_line_utils.c
OBJS = $(addprefix build/,$(SRCS:.c=.o))
# Rules
$(NAME): $(OBJS)
ar rcs $(NAME) $(OBJS)
all: $(NAME)
build:
mkdir -p build
build/%.o: %.c | build
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) build
fclean: clean
$(RM) $(NAME)
re: fclean all
.SILENT:
.PHONY: all clean fclean re