-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (53 loc) · 2.01 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: cgleason <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/07/25 21:58:39 by cgleason #+# #+# #
# Updated: 2018/08/06 13:23:52 by cgleason ### ########.fr #
# #
# **************************************************************************** #
NAME1 = checker
NAME2 = push_swap
NAME3 = viz
CC = @gcc
LIBDIR = libft
LIB = $(LIBDIR)/libft.a
CFLAGS = -Wall -Wextra -Werror
DBFLAGS = -g -o debug
CMNSRC = stack_ops.c rappers.c freers.c helpers.c printing.c sorters.c
SRC1 = executor.c
SRC2 = beset.c onset.c anhidrosis.c pile.c threes_company.c
SRC3 = visualizer.c
CMNOBJS = $(CMNSRC:.c=.o)
OBJS1 = $(SRC1:.c=.o)
OBJS2 = $(SRC2:.c=.o)
OBJS3 = $(SRC3:.c=.o);
both: $(NAME1) $(NAME2)
$(NAME1): $(OBJS1) $(CMNOBJS) $(LIB)
$(CC) $(CFLAGS) $(OBJS1) $(CMNOBJS) $(LIB) -o $(NAME1)
$(NAME2): $(OBJS2) $(CMNOBJS) $(LIB)
$(CC) $(CFLAGS) $(OBJS2) $(CMNOBJS) $(LIB) -o $(NAME2)
$(NAME3): $(SRC3) $(CMNSRC) $(LIB)
-$(CC) $(CFLAGS) $(SRC3) $(CMNSRC) $(LIB) -o $(NAME3)
$(LIB):
@cd $(LIBDIR) && make
.PHONY: clean fclean all re both
debug: $(SRC2) $(LIB)
$(CC) $(CFLAGS) $(DBFLAGS) $(SRC2) $(CMNSRC) $(LIB)
all: $(LIB) $(NAME1) $(NAME2) $(NAME3)
clean:
@-rm -f $(OBJS1)
@-rm -f $(OBJS2)
@-rm -f $(OBJS3)
@-rm -f $(CMNOBJS)
@cd $(LIBDIR) && make clean
fclean: clean
@-rm -f $(NAME1)
@-rm -f $(NAME2)
@-rm -f $(NAME3)
@-rm -rf debug debug.dSYM
@cd $(LIBDIR) && make fclean
re: fclean all