-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 2.05 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vtarasiu <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/03/24 10:11:17 by vtarasiu #+# #+# #
# Updated: 2018/07/01 17:35:38 by vtarasiu ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
FLAGS = -std=c99 -Wall -Wextra -Werror
HEADER = include
SRC_DIR = ./src/
OBJ_DIR = ./obj/
LIB_DIR = ./libft
LIB_NAME = libft.a
PRINTF_SRC = stringf.c integerf.c nbr_util.c ft_printf.c generic_functions.c \
generic_functions2.c util.c unicode.c parsing.c evals.c evals2.c \
variations.c
OBJ = $(addprefix $(OBJ_DIR), $(PRINTF_SRC:.c=.o))
$(NAME): $(OBJ)
make -C $(LIB_DIR)
@mkdir -p $(OBJ_DIR)
cp $(LIB_DIR)/$(LIB_NAME) ./$(NAME)
@echo "ar rc $(NAME) $(OBJ_DIR)*.o"
@ar rc $(NAME) $(OBJ)
ranlib $(NAME)
$(OBJ_DIR)%.o: $(SRC_DIR)%.c
@mkdir -p $(OBJ_DIR)
gcc $(FLAGS) -I $(HEADER) -o $@ -c $<
all: $(NAME)
debug: all
gcc -g $(FLAGS) -o $(EXEC) main.c libftprintf.a
clean:
make -C ./libft clean
@echo "rm -rf $(OBJ_DIR)*.o"
@/bin/rm -rf $(OBJ)
/bin/rm -rf $(OBJ_DIR)
norme:
norminette $(wildcard $(SRC_DIR)*.c)
norminette $(HEADER)
norminette $(wildcard $(LIB_DIR)/*.c)
norminette $(wildcard $(LIB_DIR)/*.h)
fclean: clean
make -C $(LIB_DIR) fclean
/bin/rm -f $(NAME)
re: fclean all
check:
gcc -c ft_*.c -std=c99 -Wall -Wextra -Werror && norminette ft_*.c *.h
love:
@echo "Not all."
.PHONY: clean all fclean re check love debug norme