-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (36 loc) · 1.46 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: inwagner <inwagner@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/19 19:58:12 by inwagner #+# #+# #
# Updated: 2023/04/16 20:46:08 by inwagner ### ########.fr #
# #
# **************************************************************************** #
# VARIABLES
NAME := ft_printf.a
FLAG := -Wall -Wextra -Werror
HDR := -I ./includes/
SRC := ./srcs/
OSRC := ./objs/
BSRC := ./srcs/bonus/
FTS := ft_printf_aux.c ft_printf.c
OBJS := $(FTS:%.c=$(OSRC)%.o)
all: $(NAME)
# Compile Objects
$(NAME): $(OBJS)
@ar -rcs $(NAME) $(OBJS)
# Make Objects
$(OSRC)%.o: $(SRC)%.c
@mkdir -p objs
@cc $(CFLAG) $(HDR) -c $< -o $@
bonus:
@$(MAKE) -C $(BSRC) all
clean:
@[ -d $(OSRC) ] && rm -rf $(OSRC) || [ -f Makefile ]
fclean: clean
@[ -f ./$(NAME) ] && rm $(NAME) && echo $(NAME) cleaned || [ -f Makefile ]
re: fclean all
.PHONY: all bonus clean fclean re