Merge remote-tracking branch 'michalt/fibon' into HEAD
[nofib.git] / shootout / reverse-complement / Makefile
1 TOP = ../..
2 include $(TOP)/mk/boilerplate.mk
3
4 # Override default SRCS; the default is all source files, but
5 # we don't want to include revcomp-c.c
6 SRCS = Main.hs
7
8 # These values are only used in this file. They are ignored by the
9 # executable itself.
10 FAST_OPTS = 250000
11 NORM_OPTS = 2500000
12 SLOW_OPTS = 25000000 # official shootout setting
13
14 # The benchmark game also uses -fllvm, which we can't since it might
15 # not be available on the developer's machine.
16 HC_OPTS += -O2 -XBangPatterns -funfolding-use-threshold=32 -XMagicHash \
17 -XUnboxedTuples
18
19 #------------------------------------------------------------------
20 # Create input
21
22 fasta-c : ../fasta/fasta-c.c
23 $(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
24
25 revcomp-input250000.txt : fasta-c
26 ./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
27
28 revcomp-input2500000.txt : fasta-c
29 ./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
30
31 revcomp-input25000000.txt : fasta-c
32 ./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
33
34 ifeq "$(mode)" "slow"
35 INPUT_FILE = revcomp-input25000000.txt
36 else
37 ifeq "$(mode)" "fast"
38 INPUT_FILE = revcomp-input250000.txt
39 else
40 INPUT_FILE = revcomp-input2500000.txt
41 endif
42 endif
43
44 SRC_RUNTEST_OPTS += -i $(INPUT_FILE)
45
46 all boot :: $(INPUT_FILE)
47
48 #------------------------------------------------------------------
49 # Create output to validate against
50
51 revcomp-c : revcomp-c.o
52 gcc $< -o $@ -pthread
53
54 reverse-complement.faststdout : revcomp-c
55 ./revcomp-c < $(INPUT_FILE) > $@
56
57 reverse-complement.stdout : revcomp-c
58 ./revcomp-c < $(INPUT_FILE) > $@
59
60 reverse-complement.slowstdout : revcomp-c
61 ./revcomp-c < $(INPUT_FILE) > $@
62
63 # Since the stdout files are created during the run the runstdtest
64 # script doesn't correctly pick them up, so we have to specify them
65 # explicitly here.
66 ifeq "$(mode)" "slow"
67 STDOUT_FILE = reverse-complement.slowstdout
68 else
69 ifeq "$(mode)" "fast"
70 STDOUT_FILE = reverse-complement.faststdout
71 else
72 STDOUT_FILE = reverse-complement.stdout
73 endif
74 endif
75
76 SRC_RUNTEST_OPTS += -o1 $(STDOUT_FILE)
77
78 all boot :: $(STDOUT_FILE)
79
80 include $(TOP)/mk/target.mk