-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.5 KB
/
Makefile
File metadata and controls
48 lines (36 loc) · 1.5 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: kstallen <marvin@codam.nl> +#+ #
# +#+ #
# Created: 2020/01/13 16:57:49 by kstallen #+# #+# #
# Updated: 2020/03/10 13:55:16 by kstallen ######## odam.nl #
# #
# **************************************************************************** #
NAME = libftprintf.a
CC = clang
AR = ar rcs
IDIR = inc
CFLAGS = -g -Wall -Wextra -Werror -I $(IDIR)
HDR = $(IDIR)/ft_printf.h
SRC = ft_printf.c populate.c print1.c print2.c print_utils.c utils.c libft.c \
print_di.c print_di_minus.c print_hex.c print_lu.c print_utils.c
ODIR = obj
OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o))
vpath %.c src
all: $(NAME)
$(NAME): $(OBJ)
@$(AR) $@ $^
$(ODIR)/%.o: %.c $(HDR)
@mkdir -p $(ODIR)
@$(CC) $(CFLAGS) -c $< -o $@
clean:
@$(RM) -r $(ODIR)
fclean: clean
@$(RM) $(NAME) $(TEST_NAME)
test: all test.c
gcc -Wall -Werror -Wextra test.c -L. -no-pie libftprintf.a
re: fclean all
.PHONY: clean fclean