-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
62 lines (48 loc) · 1.73 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: pbondoer <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/12/05 02:12:10 by pbondoer #+# #+# #
# Updated: 2017/02/03 09:55:50 by pbondoer ### ########.fr #
# #
# **************************************************************************** #
NAME := fillit
# directories
SRC_DIR := ./src
INC_DIR := ./includes
OBJ_DIR := ./obj
LIB_DIR := ./lib
# src / obj files
SRC := main.c \
reader.c \
solver.c
OBJ := $(addprefix $(OBJ_DIR)/,$(SRC:.c=.o))
# compiler and flags
CC := gcc
CFLAGS := -Wall -Wextra -Werror
CFLAGS += -O3 -march=native -pipe
# libraries
L_FT := $(LIB_DIR)/libft
include $(L_FT)/libft.mk
.PHONY: all clean fclean re
all:
mkdir -p $(OBJ_DIR)
@$(MAKE) -C $(L_FT) --no-print-directory
@$(MAKE) $(NAME) --no-print-directory
$(OBJ_DIR)/%.o:$(SRC_DIR)/%.c
$(CC) $(CFLAGS) $(LIB_INC) -I $(INC_DIR) -o $@ -c $<
$(NAME): $(OBJ)
$(CC) $(OBJ) $(LIB_LNK) -o $(NAME)
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -rf $(NAME)
re:
@$(MAKE) fclean --no-print-directory
@$(MAKE) all --no-print-directory
relibs:
@$(MAKE) -C $(L_FT) re --no-print-directory
@$(MAKE) re --no-print-directory