-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.93 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 1.93 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
53
54
55
56
57
58
59
60
61
62
63
64
65
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: eprusako <eprusako@student.hive.fi> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/15 11:04:15 by eprusako #+# #+# #
# Updated: 2020/10/27 13:17:05 by eprusako ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
LIBFT = ./libft
LIBFTFLAGS= -L$(LIBFT) -lft
DIR_SRC = printf_src
DIR_OBJ = obj_dir
HEADER = includes
SRC = ft_printf.c parse_menu.c parse_flags.c \
print_csp.c print_uoxb.c print_di.c print_f.c print_width_hash.c print_buff.c \
YELLOW = "\033[1;33m"
NOCOLOR = "\033[0m"
SRCS = $(addprefix $(DIR_SRC)/, $(SRC))
OBJS = $(addprefix $(DIR_OBJ)/, $(SRC:.c=.o))
TEST = test
MAIN = testmain.c
all: $(NAME)
$(NAME): $(DIR_OBJ) $(OBJS)
@echo $(YELLOW)Compiling libftprintf.a...$(NOCOLOR)
@make -C $(LIBFT)
@cp libft/libft.a ./$(NAME)
@ar rc $(NAME) $(OBJS)
@ranlib $(NAME)
test: $(NAME)
gcc -g $(NAME) $(MAIN)
$(DIR_OBJ):
@echo $(YELLOW)Compiling to .o files...$(NOCOLOR)
@mkdir $(DIR_OBJ)
$(DIR_OBJ)/%.o: $(DIR_SRC)/%.c $(HEADER)/ft_printf.h
@gcc -g -Wall -Wextra -Werror -I$(HEADER) -c -o $@ $<
clean:
@echo $(YELLOW)Cleaning...$(NOCOLOR)
@/bin/rm -rf $(DIR_OBJ)
@make -C $(LIBFT) clean
fclean: clean
@echo $(YELLOW)F-cleaning...$(NOCOLOR)
@/bin/rm -f $(NAME)
@make -C $(LIBFT) fclean
re: fclean all
.PHONY: $(NAME), all, clean, fclean, re