Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (60 loc) · 1.76 KB
/
Copy pathMakefile
File metadata and controls
75 lines (60 loc) · 1.76 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
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
# SPDX-FileCopyrightText: Copyright (c) 2020-2026 Objectionary
# SPDX-License-Identifier: MIT
.PHONY: all clean ltex vale spell
.ONESHELL:
.SHELLFLAGS := -e -o pipefail -c
.SECONDARY:
SHELL := bash
TARGPATH_JAVA = src/java/targets
TARGPATH_CPP = src/cpp/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 \
}
.PHONY: all compile cpp java eo run clean test
all: compile run
compile: cpp java eo
cpp:
$(MAKE) -C src/cpp
java:
$(MAKE) -C src/java
eo:
$(MAKE) -C src/eo
run: target/run/kruskal.txt target/run/prim.txt target/run/dijkstra.txt target/run/fordfulkerson.txt
target/run/%.txt: ALGO_NAME = $(subst kruskal,Kruskal's,$(subst prim,Prim's,$(subst dijkstra,Dijkstra's,$(subst fordfulkerson,FordFulkerson's,$*))))
target/run/%.txt: EOC_TARGET = target/eo/$*
target/run/%.txt: TEST_DIR = $(if $(filter kruskal prim,$*),edges,list)
target/run/%.txt: | compile
@mkdir -p target/run
@echo "========================================\n"
@echo "Now we are going to run $(ALGO_NAME) algorithm\n"
@for FILE in tests/$(TEST_DIR)/*; do \
var=$$(cat $$FILE); \
eoc --no-color --batch --blind --parser 0.63.2 --home-tag 0.63.2 --target $(EOC_TARGET) --alone dataize --heap=8G $*.$*App $$var; \
echo $$? > $@; \
done
clean:
@for dir in src/eo src/java src/cpp; do \
$(MAKE) -C $$dir clean; \
done
rm -rf target