-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (45 loc) · 1.8 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: mmarcell <[email protected]> +#+ #
# +#+ #
# Created: 2020/01/07 18:47:20 by mmarcell #+# #+# #
# Updated: 2020/07/04 12:01:43 by mmarcell ######## odam.nl #
# #
# **************************************************************************** #
include srcs/mini_srcs
NAME := lem-in
OBJS := $(MINI_SOURCES:%=objs/%.o) objs/main.o
CFLAGS := -Wall -Wextra -Werror
LIBFT_PATH := libft
LIBFT := $(LIBFT_PATH)/libft.a
HDRS_PATH := hdrs
INCLUDES := -I $(HDRS_PATH) -I $(LIBFT_PATH)
HDRS := $(HDRS_PATH)/lem_in.h
PLUS = $$(tput setaf 2)+$$(tput sgr0)
MINUS = $$(tput setaf 1)-$$(tput sgr0)
all: $(NAME)
$(NAME): $(LIBFT) $(OBJS)
@$(CC) $(CFLAGS) -o $@ $^ $(LIBFT)
@echo " $(PLUS) $@"
objs/%.o: srcs/%.c $(HDRS) | objs
@$(CC) -c $(CFLAGS) -o $@ $(INCLUDES) $<
@echo " $(PLUS) $@"
objs:
@mkdir -p $@
$(LIBFT): FORCE
@make -C $(LIBFT_PATH) | sed "s/^/$(LIBFT_PATH): /"
clean: lclean
@make clean -C $(LIBFT_PATH) | sed "s/^/$(LIBFT_PATH): /"
lclean:
@rm -rfv objs | sed "s/^/ $(MINUS) /"
fclean: clean lfclean
@rm -fv $(LIBFT) | sed "s/^/ $(MINUS) /"
lfclean: lclean
@rm -fv $(NAME) | sed "s/^/ $(MINUS) /"
re: fclean all
lre: lfclean all
FORCE:
.PHONY: all clean fclean re FORCE