-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (52 loc) · 1.82 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
#
# CS252 - Shell Project
#
#Use GNU compiler
cc= gcc
CC= g++
ccFLAGS= -g -std=c11
CCFLAGS= -g -std=c++17
WARNFLAGS= -Wall -Wextra -pedantic
LEX=lex -l
YACC=yacc -y -d -t --debug
EDIT_MODE_ON=
ifdef EDIT_MODE_ON
EDIT_MODE_OBJECTS=tty-raw-mode.o read-line.o
endif
all: git-commit shell
lex.yy.o: shell.l
$(LEX) -o lex.yy.cc shell.l
$(CC) $(CCFLAGS) -c lex.yy.cc
y.tab.o: shell.y
$(YACC) -o y.tab.cc shell.y
$(CC) $(CCFLAGS) -c y.tab.cc
PipeCommand.o: PipeCommand.cc PipeCommand.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c PipeCommand.cc
SimpleCommand.o: SimpleCommand.cc SimpleCommand.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c SimpleCommand.cc
ListCommands.o: ListCommands.cc ListCommands.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c ListCommands.cc
Command.o: Command.cc Command.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c Command.cc
Shell.o: Shell.cc Shell.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c Shell.cc
IfCommand.o: IfCommand.cc IfCommand.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c IfCommand.cc
WhileCommand.o: WhileCommand.cc WhileCommand.hh
$(CC) $(CCFLAGS) $(WARNFLAGS) -c WhileCommand.cc
shell: y.tab.o lex.yy.o Shell.o PipeCommand.o SimpleCommand.o ListCommands.o Command.o IfCommand.o WhileCommand.o Shell.o $(EDIT_MODE_OBJECTS)
$(CC) $(CCFLAGS) $(WARNFLAGS) -o shell lex.yy.o y.tab.o Shell.o PipeCommand.o SimpleCommand.o ListCommands.o Command.o IfCommand.o WhileCommand.o $(EDIT_MODE_OBJECTS)
tty-raw-mode.o: tty-raw-mode.c
$(cc) $(ccFLAGS) $(WARNFLAGS) -c tty-raw-mode.c
read-line.o: read-line.c
$(cc) $(ccFLAGS) $(WARNFLAGS) -c read-line.c
.PHONY: git-commit
git-commit:
git checkout master >> .local.git.out || echo
touch testall.out
git add *.cc *.hh *.l *.y Makefile testall.out >> .local.git.out || echo
git commit -a -m "Commit" >> .local.git.out || echo
git push origin master
.PHONY: clean
clean:
rm -f lex.yy.cc y.tab.cc y.tab.hh shell *.o