-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
69 lines (56 loc) · 1.48 KB
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
# ======================================================
# Compiler
# ======================================================
CC = gcc
# ======================================================
# Project
# ======================================================
NAME = myshell
# ======================================================
# Sources
# ======================================================
SRC = \
src/myshell.c \
src/execute.c \
src/redirect.c \
src/builtin.c \
src/path.c \
src/print_prompt.c \
src/signals.c \
src/execute_pipe.c \
src/tokenizer.c \
commands/ls.c \
commands/cat.c \
commands/mkdir.c \
commands/history.c \
commands/run.c \
commands/touch.c
# ======================================================
# Objects
# ======================================================
OBJ = $(SRC:.c=.o)
# ======================================================
# Compiler flags
# ======================================================
CFLAGS = -Wall -Wextra -Werror -Iinclude
# ======================================================
# Libraries
# ======================================================
LIBS = -lreadline
# ======================================================
# Rules
# ======================================================
all: $(NAME)
$(NAME): $(OBJ)
$(CC) $(OBJ) -o $(NAME) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(NAME)
./$(NAME)
clean:
rm -f $(OBJ)
rm -f history.txt
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all run clean fclean re