-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
37 lines (28 loc) · 1.11 KB
/
makefile
File metadata and controls
37 lines (28 loc) · 1.11 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
# All Targets
BIN=./bin/
SOURCE=./src/
INCLUDE=./include/
.SILENT:
all: myshell
# Tool invocations
myshell: myshell.o LineParser.o LinkedList.o utils.o BuiltinCommands.o
gcc -g -Wall -o myshell $(BIN)/myshell.o $(BIN)/LineParser.o $(BIN)/LinkedList.o $(BIN)/utils.o $(BIN)/BuiltinCommands.o -lreadline -ltinfo
# Depends on the source and header files
LineParser.o: $(SOURCE)/LineParser.c $(INCLUDE)/LineParser.h
gcc -g -Wall -c $(SOURCE)/LineParser.c -o $(BIN)/LineParser.o
myshell.o: $(SOURCE)/myshell.c
mkdir -p bin
gcc -g -Wall -c $(SOURCE)/myshell.c -o $(BIN)/myshell.o
LinkedList.o: $(SOURCE)/LinkedList.c $(INCLUDE)/LinkedList.h
gcc -g -Wall -c $(SOURCE)/LinkedList.c -o $(BIN)/LinkedList.o
utils.o: $(SOURCE)/utils.c $(INCLUDE)/utils.h
gcc -g -Wall -c $(SOURCE)/utils.c -o $(BIN)/utils.o
BuiltinCommands.o: $(SOURCE)/BuiltinCommands.c $(INCLUDE)/BuiltinCommands.h
gcc -g -Wall -c $(SOURCE)/BuiltinCommands.c -o $(BIN)/BuiltinCommands.o
#tell make that "clean" is not a file name!
.PHONY: clean run
#Clean the build directory
clean:
rm -vf myshell $(BIN)/*
run:
./myshell