Move required language extensions into pragmas for shootout.
[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 CLEAN_FILES += fasta-c revcomp-c reverse-complement *stdout *stdin
9
10 # These values are only used in this file. They are ignored by the
11 # executable itself.
12 FAST_OPTS = 250000
13 NORM_OPTS = 10000000
14 SLOW_OPTS = 25000000 # official shootout setting
15
16 # The benchmark game also uses -fllvm, which we can't since it might
17 # not be available on the developer's machine.
18 HC_OPTS += -funfolding-use-threshold=32
19
20 #------------------------------------------------------------------
21 # Create input
22
23 fasta-c : ../fasta/fasta-c.c
24 $(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
25
26 reverse-complement.faststdin : fasta-c
27 ./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
28
29 reverse-complement.stdin : fasta-c
30 ./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
31
32 reverse-complement.slowstdin : fasta-c
33 ./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
34
35 # Since we only decide here what the INPUT_FILE is, it's required to first run
36 # `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
37 # doesn't call `runstdtest` correctly)
38 ifeq "$(mode)" "slow"
39 INPUT_FILE = reverse-complement.slowstdin
40 else
41 ifeq "$(mode)" "fast"
42 INPUT_FILE = reverse-complement.faststdin
43 else
44 INPUT_FILE = reverse-complement.stdin
45 endif
46 endif
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 $(INPUT_FILE)
55 ./revcomp-c < $(INPUT_FILE) | tr -d '\r' > $@
56
57 reverse-complement.stdout : revcomp-c $(INPUT_FILE)
58 ./revcomp-c < $(INPUT_FILE) | tr -d '\r' > $@
59
60 reverse-complement.slowstdout : revcomp-c $(INPUT_FILE)
61 ./revcomp-c < $(INPUT_FILE) | tr -d '\r' > $@
62
63 # Since we only decide here what the OUTPUT_FILE is, it's required to first run
64 # `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
65 # doesn't call `runstdtest` correctly)
66 ifeq "$(mode)" "slow"
67 OUTPUT_FILE = reverse-complement.slowstdout
68 else
69 ifeq "$(mode)" "fast"
70 OUTPUT_FILE = reverse-complement.faststdout
71 else
72 OUTPUT_FILE = reverse-complement.stdout
73 endif
74 endif
75
76 boot :: $(INPUT_FILE) $(OUTPUT_FILE)
77
78 include $(TOP)/mk/target.mk