-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 1.41 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: achan <achan@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/30 13:03:37 by achan #+# #+# #
# Updated: 2016/12/10 02:52:19 by achan ### ########.fr #
# #
# **************************************************************************** #
HDRS = hdrs
SRCS = srcs
OBJS = objs
CC = gcc
WFLAGS = -Wall -Wextra -Werror
CFLAGS = -c
GFLAGS =
IFLAGS = -I $(HDRS)
C_SRCS = $(wildcard $(SRCS)/*.c)
C_OBJS = $(addprefix $(OBJS)/, $(notdir ${C_SRCS:.c=.o}))
NAME = fillit
.PHONY: all clean fclean re
all: $(NAME)
$(NAME): $(C_OBJS)
@$(CC) $(WFLAGS) $(GFLAGS) $(IFLAGS) -L. -lft $(C_OBJS) -o $@
$(C_OBJS): $(C_SRCS)
@mkdir -p $(OBJS)
@$(CC) $(WFLAGS) $(IFLAGS) $(GFLAGS) $(CFLAGS) $(subst $(OBJS),$(SRCS),$*.c) -o $@
clean:
@rm -rf $(OBJS)
fclean: clean
@rm -rf $(NAME)
re: fclean $(NAME)