-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
124 lines (88 loc) · 4.91 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
# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -g
# Source files
SRC = src/syscall-simulator.c
OBJ = syscall-simulator.o
# Header files
DEPS = src/syscall-simulator.h
# Executable name
TARGET = sim
# Default rule (build the program)
all: $(TARGET) rm-obj
# rm-obj rule to remove object files
rm-obj:
rm -f $(OBJ)
# Object file rule (dependencies for object file)
$(OBJ): $(SRC) $(DEPS)
$(CC) $(CFLAGS) -c src/syscall-simulator.c
# Build the executable from object file
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJ)
# Clean up
clean:
rm -f $(TARGET) $(OBJ) tests/test*/execution*.txt execution*.txt
# Test all: run all tests
test: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 test20 rm-obj
# tests
# Test 1: Run the program with trace1.txt, vector.txt, and execution1.txt
test1: $(TARGET)
./$(TARGET) tests/test1/trace1.txt additionalFiles/vector_table.txt tests/test1/execution1.txt
# Test 2: Run the program with different arguments (trace2.txt, vector2.txt, execution2.txt)
test2: $(TARGET)
./$(TARGET) tests/test2/trace2.txt additionalFiles/vector_table.txt tests/test2/execution2.txt
# Test 3: Run the program with different arguments (trace3.txt, vector3.txt, execution3.txt)
test3: $(TARGET)
./$(TARGET) tests/test3/trace3.txt additionalFiles/vector_table.txt tests/test3/execution3.txt
# Test 4: Run the program with different arguments (trace4.txt, vector4.txt, execution4.txt)
test4: $(TARGET)
./$(TARGET) tests/test4/trace4.txt additionalFiles/vector_table.txt tests/test4/execution4.txt
# Test 5: Run the program with different arguments (trace5.txt, vector5.txt, execution5.txt)
test5: $(TARGET)
./$(TARGET) tests/test5/trace5.txt additionalFiles/vector_table.txt tests/test5/execution5.txt
# Test 6: Run the program with different arguments (trace6.txt, vector6.txt, execution6.txt)
test6: $(TARGET)
./$(TARGET) tests/test6/trace6.txt additionalFiles/vector_table.txt tests/test6/execution6.txt
# Test 7: Run the program with different arguments (trace7.txt, vector7.txt, execution7.txt)
test7: $(TARGET)
./$(TARGET) tests/test7/trace7.txt additionalFiles/vector_table.txt tests/test7/execution7.txt
# Test 8: Run the program with different arguments (trace8.txt, vector8.txt, execution8.txt)
test8: $(TARGET)
./$(TARGET) tests/test8/trace8.txt additionalFiles/vector_table.txt tests/test8/execution8.txt
# Test 9: Run the program with different arguments (trace9.txt, vector9.txt, execution9.txt)
test9: $(TARGET)
./$(TARGET) tests/test9/trace9.txt additionalFiles/vector_table.txt tests/test9/execution9.txt
# Test 10: Run the program with different arguments (trace10.txt, vector10.txt, execution10.txt)
test10: $(TARGET)
./$(TARGET) tests/test10/trace10.txt additionalFiles/vector_table.txt tests/test10/execution10.txt
# Test 11: Run the program with different arguments (trace11.txt, vector11.txt, execution11.txt)
test11: $(TARGET)
./$(TARGET) tests/test11/trace11.txt additionalFiles/vector_table.txt tests/test11/execution11.txt
# Test 12: Run the program with different arguments (trace12.txt, vector12.txt, execution12.txt)
test12: $(TARGET)
./$(TARGET) tests/test12/trace12.txt additionalFiles/vector_table.txt tests/test12/execution12.txt
# Test 13: Run the program with different arguments (trace13.txt, vector13.txt, execution13.txt)
test13: $(TARGET)
./$(TARGET) tests/test13/trace13.txt additionalFiles/vector_table.txt tests/test13/execution13.txt
# Test 14: Run the program with different arguments (trace14.txt, vector14.txt, execution14.txt)
test14: $(TARGET)
./$(TARGET) tests/test14/trace14.txt additionalFiles/vector_table.txt tests/test14/execution14.txt
# Test 15: Run the program with different arguments (trace15.txt, vector15.txt, execution15.txt)
test15: $(TARGET)
./$(TARGET) tests/test15/trace15.txt additionalFiles/vector_table.txt tests/test15/execution15.txt
# Test 16: Run the program with different arguments (trace16.txt, vector16.txt, execution16.txt)
test16: $(TARGET)
./$(TARGET) tests/test16/trace16.txt additionalFiles/vector_table.txt tests/test16/execution16.txt
# Test 17: Run the program with different arguments (trace17.txt, vector17.txt, execution17.txt)
test17: $(TARGET)
./$(TARGET) tests/test17/trace17.txt additionalFiles/vector_table.txt tests/test17/execution17.txt
# Test 18: Run the program with different arguments (trace18.txt, vector18.txt, execution18.txt)
test18: $(TARGET)
./$(TARGET) tests/test18/trace18.txt additionalFiles/vector_table.txt tests/test18/execution18.txt
# Test 19: Run the program with different arguments (trace19.txt, vector19.txt, execution19.txt)
test19: $(TARGET)
./$(TARGET) tests/test19/trace19.txt additionalFiles/vector_table.txt tests/test19/execution19.txt
# Test 20: Run the program with different arguments (trace20.txt, vector20.txt, execution20.txt)
test20: $(TARGET)
./$(TARGET) tests/test20/trace20.txt additionalFiles/vector_table.txt tests/test20/execution20.txt