-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
74 lines (59 loc) · 1.21 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
NAME = minishell
CFLAGS = -Wall -Werror -Wextra \
CC = gcc
LIBS = execution/libexecution.a \
parser/libparser.a \
libx/libx.a \
SRC = minishell.c \
buffer.c \
errors.c \
terminal.c \
usage.c \
history.c \
cursor.c \
heredoc.c \
heredoc_loop.c \
heredoc_entry.c \
heredoc_extra.c \
hd_enter_triggered.c \
signal_interceptor.c \
backspace_triggered.c \
arrows_triggered.c \
ctrl_d_triggered.c \
enter_triggered.c \
ctrl_l_triggered.c \
tsettings.c \
OBJ = ${SRC:.c=.o}
MAKE = make --no-print-directory -C
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
CFLAGS += -fcommon
LDFLAGS += -lncurses
endif
ifeq ($(UNAME),Darwin)
LDFLAGS += -ltermcap
endif
all: $(NAME)
options:
@echo ${NAME} build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
@echo
$(NAME):
@$(MAKE) libx
@$(MAKE) parser
@$(MAKE) execution
@$(CC) $(CFLAGS) $(SRC) $(LIBS) -o $(NAME) $(LDFLAGS)
clean:
@$(MAKE) libx clean
@$(MAKE) parser clean
@$(MAKE) execution clean
@rm -rf $(OBJ)
fclean: clean
@$(MAKE) libx fclean
@$(MAKE) parser fclean
@$(MAKE) execution fclean
@rm -rf $(NAME) $(NAME).dSYM
re: fclean all
.PHONY: clean fclean re