-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
125 lines (107 loc) · 3.6 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
help:
@echo "make recursive_factorial : For running the factorial program"
@echo "make error_check : For running the error checking program"
@echo "make binary_search : For running binary search program"
@echo "make recursion_with_memoization_dp : For running memoized dp program"
@echo "make loops_breaks_continue: For running loops, break and continue program"
@echo "make ternary_operators: For running ternary operator program"
@echo "make complex_expressions: For running a program expression program"
@echo "make multi_dimensional_array : For running multi dimesnional array program"
@echo "make function_calls : For running example containing function calls"
@echo "make conditional_statements : For running multi dimesnional array program"
@echo "make strings : For running program handling strings"
@echo "make block_and_scope : For running program with block scopes"
@echo "make all : For compiling the files"
@echo "make clean : For removing the compiled files"
all:
@ bison -d -Wno-yacc -Wnone -v parser.y
@ lex tok.l
@ gcc -c -g parser.tab.c lex.yy.c AST.c assembly.c
@ gcc -o out parser.tab.o lex.yy.o AST.o assembly.o
recursive_factorial:
@ make all --no-print-directory
@ ./out < test_programs/recursive_factorial_program.see
ifeq (,$(wildcard target.s))
@ spim -file target.s
endif
@ make clean --no-print-directory
error_check:
@ make all --no-print-directory
@ ./out < test_programs/error_check_program.see
ifeq ("$(wildcard target.s))","")
spim -file target.s
endif
@ make clean --no-print-directory
binary_search:
@ make all --no-print-directory
@ ./out < test_programs/binary_search_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
recursion_with_memoization_dp:
@ make all --no-print-directory
@ ./out < test_programs/recursion_with_memoization_dp_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
loops_breaks_continue:
@ make all --no-print-directory
@ ./out < test_programs/loops_breaks_continue_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
ternary_operators:
@ make all --no-print-directory
@ ./out < test_programs/ternary_operators_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
complex_expressions:
@ make all --no-print-directory
@ ./out < test_programs/complex_expressions_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
multi_dimensional_array:
@ make all --no-print-directory
@ ./out < test_programs/multi_dimensional_array_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
function_calls:
@ make all --no-print-directory
@ ./out < test_programs/function_calls_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
conditional_statements:
@ make all --no-print-directory
@ ./out < test_programs/conditional_statements_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
strings:
@ make all --no-print-directory
@ ./out < test_programs/strings_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
block_and_scope:
@ make all --no-print-directory
@ ./out < test_programs/block_and_scope_program.see
ifeq (,$(wildcard target.s))
spim -file target.s
endif
@ make clean --no-print-directory
clean:
@ rm *.o -f
@ rm parser.tab.c parser.tab.h parser.output y.tab.c lex.yy.c y.output y.tab.h target.s out -f