aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/minisat/Makefile.profiled
blob: f411b5e79a44f24909ab4a8fb456a09f11d6b0d0 (plain)
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
# -*- mode: makefile; -*-

CFILES=main.c solver.c clock.c
CCOMP=../../../ccomp

GCC=aarch64-linux-gnu-gcc
#GCC=k1-cos-gcc
EXECUTE=qemu-aarch64
#EXECUTE=k1-cluster --
EXECUTE_CYCLES=k1-cluster --cycle-based --

LIBS=-lm
PROFILING_DAT=compcert_profiling.dat
EXAMPLE=sudoku.sat
CCOMPFLAGS=-finline-auto-threshold 50 -static -finline-asm
GCCFLAGS=-static
ALL=minisat.ccomp.log minisat.ccomp.trace-linearize.log minisat.ccomp.profiled.log minisat.gcc-O3.log minisat.gcc-O3.profiled.log

all: $(ALL)
exe: $(ALL:.log=.exe)

minisat.ccomp.exe: $(CFILES)
	$(CCOMP) $(CCOMPFLAGS) $(CFILES) -o $@ $(LIBS)

minisat.ccomp.profile-arcs.exe: $(CFILES)
	$(CCOMP) -DARM_NO_PRIVILEGE $(CCOMPFLAGS) -fprofile-arcs $(CFILES) -o $@ $(LIBS)

minisat.gcc-O3.exe: $(CFILES)
	$(GCC) $(GCCFLAGS) -O3 $(CFILES) -o $@ $(LIBS)

clock.gcc-O3.noprofile.o : clock.c
	$(GCC) -DARM_NO_PRIVILEGE $(GCCFLAGS) -O3 -c $< -o @

minisat.gcc-O3.profile-arcs.exe: main.c solver.c clock.gcc-O3.noprofile.o
	$(GCC) -DARM_NO_PRIVILEGE $(GCCFLAGS) -fprofile-arcs -O3 $+ -o $@ $(LIBS)

gcda: minisat.gcc-O3.profile-arcs.exe
	$(EXECUTE) $< $(EXAMPLE)

main.gcda solver.gcda: gcda

minisat.gcc-O3.profiled.exe: $(CFILES) $(GCDAFILES)
	$(GCC) $(GCCFLAGS) -O3 -fprofile-use $(CFILES) -o $@ $(LIBS)

minisat.ccomp.trace-linearize.exe: $(CFILES)
	$(CCOMP) $(CCOMPFLAGS) -fduplicate 0 -ftracelinearize $(CFILES) -o $@ $(LIBS)

$(PROFILING_DAT): minisat.ccomp.profile-arcs.exe
	-rm -f $(PROFILING_DAT)
	$(EXECUTE) $< $(EXAMPLE)

minisat.ccomp.profiled.exe: $(CFILES) $(PROFILING_DAT)
	$(CCOMP) $(CCOMPFLAGS) -fprofile-use= $(PROFILING_DAT) -ftracelinearize $(CFILES) -o $@ $(LIBS)

%.log : %.exe
	$(EXECUTE_CYCLES) $< $(EXAMPLE) 2>&1 | tee $@

clean:
	-rm -f *.log *.exe $(PROFILING_DAT) $(GCDAFILES)

.PHONY: clean gcda exe all

.SECONDARY: