-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (37 loc) · 1.53 KB
/
Makefile
File metadata and controls
52 lines (37 loc) · 1.53 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ivan <ivan@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/03/25 20:11:10 by ivan #+# #+# #
# Updated: 2019/03/26 09:59:06 by ivan ### ########.fr #
# #
# **************************************************************************** #
CC := gcc
NAME := libftprintf.a
FLAGS := -c -Wall -Wextra -Werror -g
SRC_DIR := . fs_vector parsing preparation support_function
DIR_OBJ := obj
INCLUDES := I .
SOURCES := $(wildcard $(DIR_VEC), *.c)
OBJECTS := $(SOURCE: .c=.o)
SRCS := $(addprefix ../,$(SRC_DIR))
SEARCH_WILD := $(addsuffix /*.c, $(SRC_DIR))
VPATH := $(SRC_DIR)
all: $(NAME)
$(notdir $(patsubst %.c,%.o$(wildcard $(SEARCH_WILD))))
$(CC) $^ -o $@
$(NAME):
$(CC) $(FLAGS) $(addprefix ,$(SEARCH_WILD)) $<
ar rc $(NAME) $(addprefix $(OBJ_DIR), $(OBJECTS))
ranlib $(NAME)
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -rf $(NAME)
re:
@$(MAKE) fclean
@$(MAKE) all
.PHONY: all clean fclean re