-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
93 lines (82 loc) · 2.21 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
.ONESHELL:
shell = bash
TARGPATH = ../../targets
C = printcpp() { \
echo "C++ gives this output:"; \
if [ $$? -eq 0 ]; then \
echo "$$@"; \
else \
echo "Execution error"; \
fi \
}
J = printjava() { \
echo "Java gives this output:"; \
if [ $$? -eq 0 ]; then \
echo "$$@"; \
else \
echo "Execution error"; \
fi \
}
E = printeo() { \
echo "EO gives this output:"; \
if [ $$? -eq 0 ]; then \
echo "$$@"; \
else \
echo "Execution error"; \
fi \
}
compile:
@rm -f -r targets/
@mkdir targets/
@cd src/cpp
@make
@cd ../java
@make
@cd ../eo/
@eoc dataize app --verbose
run:
@clear
@java -cp targets/java/ GraphGenerator 0 10 > tests/edges/star3.graph
@java -cp targets/java/ GraphGenerator 1 10 > tests/list/dijkstra2.graph
@cd tests/edges
@echo "Now we are going to run Kruskal's algorithm \n";
@for FILE in *; do \
var=$$(cat $$FILE)
echo "Test ($$FILE) is running"; \
$(J); printjava $$(java -cp $(TARGPATH)/java Kruskal $$var); \
$(C); printcpp $$($(TARGPATH)/cpp/kruskal $$var); \
echo "\n";
done
@echo "Now we are going to run Prim's algorithm \n";
@for FILE in *; do \
var=$$(cat $$FILE)
echo "Test ($$FILE) is running"; \
$(J); printjava $$(java -cp $(TARGPATH)/java prim/PrimMST $$var); \
$(C); printcpp $$($(TARGPATH)/cpp/prim $$var); \
@cd ../../src/eo
$(E); printeo $$(eoc --alone dataize app $$var)
@cd ../../tests/edges/
echo "\n";
done
@cd ../list
@echo "Now we are going to run Dijkstra's algorithm \n";
@for FILE in *; do \
var=$$(cat $$FILE)
echo "Test ($$FILE) is running"; \
$(J); printjava $$(java -cp $(TARGPATH)/java Dijkstra $$var); \
$(C); printcpp $$($(TARGPATH)/cpp/dijkstra $$var); \
echo "\n";
done
@echo "Now we are going to run Ford-Falkerson algorithm \n";
@for FILE in *; do \
var=$$(cat $$FILE)
echo "Test ($$FILE) is running"; \
$(J); printjava $$(java -cp $(TARGPATH)/java FordFalkerson $$var); \
$(C); printcpp $$($(TARGPATH)/cpp/fordfalkersonalg $$var); \
echo "\n";
done
clean:
rm -f -r targets/
rm -f tests/edges/star3.graph
rm -f tests/list/dijkstra2.graph
rm -f -r src/eo/.eoc