-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (47 loc) · 2.35 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
include Makefile.config
BENCHMARKS = eigenval.exe harris.exe transff.43.exe transff.44.exe transsf.43.exe transsf.44.exe transcf.43.exe transcf.44.exe stereobm.exe filter.exe resize.exe moments.exe morph.exe morph.uno.exe thresh.exe silhouette.exe pyramid.exe warpaff.exe remap.exe
OPT_BENCHMARKS = $(patsubst %.exe,%.opt.bc,$(BENCHMARKS))
CONC_BENCHMARKS = harris.conc stereobm.conc filter.conc resize.conc moments.conc transsf.43.conc transsf.44.conc transcf.43.conc transcf.44.conc morph.conc thresh.conc silhouette.conc pyramid.conc warpaff.conc remap.conc
LLVMGCC_COMPILE = $(LLVMGCC_PATH)/bin/llvm-g++ -g $(CXXFLAGS) -I. -I$(OPENCV_PATH)/include/opencv -I$(KLEE_PATH)/include/klee -I$(OPENCV_BUILD_PATH) -c -emit-llvm
GCC_COMPILE = g++ $(CXXFLAGS) -ggdb3 -D__CONCRETE -I. -I$(OPENCV_PATH)/include/opencv -I$(OPENCV_CONC_BUILD_PATH)
all: $(BENCHMARKS)
opt: $(OPT_BENCHMARKS)
conc: $(CONC_BENCHMARKS)
%.bc: %.cpp
$(LLVMGCC_COMPILE) $< -o $@
%.uno.bc: %.cpp
$(LLVMGCC_COMPILE) -DUSE_UNORDERED_EQ $< -o $@
%.43.bc: %.cpp
$(LLVMGCC_COMPILE) -DTRANS_N=4 -DTRANS_NC=3 $< -o $@
%.44.bc: %.cpp
$(LLVMGCC_COMPILE) -DTRANS_N=4 -DTRANS_NC=4 $< -o $@
%.o: %.cpp
$(GCC_COMPILE) -c $< -o $@
%.43.o: %.cpp
$(GCC_COMPILE) -DTRANS_N=4 -DTRANS_NC=3 -c $< -o $@
%.44.o: %.cpp
$(GCC_COMPILE) -DTRANS_N=4 -DTRANS_NC=4 -c $< -o $@
%.exe: %.bc
$(LLVM_BUILD_PATH)/bin/llvm-ld -disable-opt $< $(OPENCV_BUILD_PATH)/lib/libcv.a $(OPENCV_BUILD_PATH)/lib/libcxcore.a -o $@
%.opt.bc: %.exe
$(LLVM_BUILD_PATH)/bin/opt -simplifycfg -phi-node-folding-threshold=1000 -unsafe-phi-node-folding $<.bc -o $@
%.conc: %.o
g++ $< -L$(OPENCV_CONC_BUILD_PATH)/lib -Wl,-rpath,$(OPENCV_CONC_BUILD_PATH)/lib -lcv -lcxcore -o $@
OpenCV-2.1.0.tar.bz2:
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.1/OpenCV-2.1.0.tar.bz2
opencv: OpenCV-2.1.0.tar.bz2
rm -rf $(OPENCV_PATH) $(OPENCV_BUILD_PATH)
cd $(shell dirname $(OPENCV_PATH)) && \
tar xjf $(shell pwd)/OpenCV-2.1.0.tar.bz2 && \
if \! test -e $(OPENCV_PATH) ; then \
mv OpenCV-2.1.0 $(shell basename $(OPENCV_PATH)) ; \
fi
cd $(OPENCV_PATH) && \
for patch in $(shell pwd)/OpenCV-2.1.0-*.patch ; do \
patch -p1 < $$patch ; \
done
mkdir -p $(OPENCV_BUILD_PATH)
cd $(OPENCV_BUILD_PATH) && $(shell pwd)/cmake-opencv-rel $(OPENCV_PATH)
-make -C$(OPENCV_BUILD_PATH)
clean:
rm -f $(BENCHMARKS) $(CONC_BENCHMARKS) *.bc