-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (44 loc) · 1.53 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
.POSIX:
.SUFFIXES:
.SUFFIXES: .o .cpp
CXX = g++
CXXFLAGS = -std=c++11 -ggdb
LDLIBS = -lpthread
.cpp.o:
$(CXX) $(CXXFLAGS) -c $<
BIN = test-2 test-3 test-5
OBJ = ConcurrentHashMap.o
all: $(BIN)
$(BIN): ListaAtomica.hpp
main: main.cpp $(OBJ)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
ConcurrentHashMap: ListaAtomica.o ConcurrentHashMap.cpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
ListaAtomica: ListaAtomica.hpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(LDLIBS)
test-2: $(OBJ) test-2.cpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ test-2.cpp $(OBJ) $(LDLIBS)
test-2-run: test-2
awk -f corpus.awk corpus | sort >corpus-post
./test-2 | sort | diff -u - corpus-post
rm -f corpus-post
test-3: $(OBJ) test-3.cpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ test-3.cpp $(OBJ) $(LDLIBS)
test-3-run: test-3
awk -f corpus.awk corpus | sort >corpus-post
for i in {1 .. 50}; do sed -n "$$((i * 500 + 1)),$$(((i + 1) * 500))p" corpus >corpus-"$$i"; done
for i in 0 1 2 3 4; do ./test-3 $$((i + 1)) | sort | diff -u - corpus-post; done
#rm -f corpus-post corpus-[0-4]
test-5: $(OBJ) test-5.cpp
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ test-5.cpp $(OBJ) $(LDLIBS)
test-5-run: test-5
awk -f corpus.awk corpus | sort -nk 2 | tail -n 1 >corpus-max
cat corpus-max
for i in 0 1 2 3 4; do sed -n "$$((i * 500 + 1)),$$(((i + 1) * 500))p" corpus >corpus-"$$i"; done
for i in 0 1 2 3 4; do for j in 0 1 2 3 4; do \
./test-5 $$((i + 1)) $$((j + 1)) | diff -u - corpus-max; \
done; done
rm -f corpus-max corpus-[0-4]
clean:
rm -f $(BIN) $(OBJ)
rm -f corpus-*