-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (67 loc) · 2.08 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ybarbier <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/05/01 14:16:31 by ybarbier #+# #+# #
# Updated: 2017/05/01 16:43:52 by ybarbier ### ########.fr #
# #
# **************************************************************************** #
#_____________CONFIG____________#
ifeq ($(HOSTTYPE),)
HOSTTYPE := $(shell uname -m)_$(shell uname -s)
endif
NAME = libft_malloc_$(HOSTTYPE).so
NAME_LINK = libft_malloc.so
PATH_SRC = ./src/
PATH_INC = ./inc
# PATH_INC_LIBFT = ./libft/includes/
# INCLUDES = -I $(PATH_INC) -I $(PATH_INC_LIBFT)
INCLUDES = -I $(PATH_INC)
CC = cc
ifeq ($(DEBUG),yes)
CFLAGS = $(INCLUDES) -g -fPIC
LDFLAGS = -shared
else
CFLAGS = -Wall -Wextra -Werror $(INCLUDES) -fPIC
LDFLAGS = -shared
endif
# LIBS = -L libft/ -lft
#_____________FILES____________#
SRC = malloc.c \
realloc.c \
free.c \
block_initialisation.c \
block_creation.c \
zone_initialisation.c \
zone_creation.c \
zone_deletion.c \
show_alloc_mem.c \
ft_puthexa.c \
ft_putnbr.c \
ft_putstr.c \
ft_putchar.c \
ft_memset.c \
ft_bzero.c \
calloc.c \
reallocf.c
OBJ = $(addprefix $(PATH_SRC), $(SRC:.c=.o))
#____________RULES_____________#
.PHONY: clean fclean re test
all: $(NAME)
$(NAME): $(OBJ)
# make -C libft/
# $(CC) $(OBJ) -o $(NAME) $(LIBS) $(LDFLAGS)
$(CC) $(OBJ) -o $(NAME) $(LDFLAGS)
ln -s $(NAME) $(NAME_LINK)
#____CLEAN____#
clean:
rm -f $(OBJ)
#___FCLEAN___#
fclean: clean
rm -f $(NAME)
rm -f $(NAME_LINK)
#____RE____#
re: fclean all