Commit eccf5324 authored by Michal Terepeta's avatar Michal Terepeta Committed by Ben Gamari

Simplify some shootout Makefiles

Summary:
By following the naming conventions of the build system we can
simplify the `Makefile`s a bit.  This patch also avoids having to
explicitly pass the flags to `runstdtest` for `fasta`, `k-nucleotide`
and `reverse-complement`.  The only consquence of this is that it's a
requirement to run `make boot` before `make` for these benchmarks. But
that is already the case since `.depend` files are generated by with
`make boot`.

Finally, this also update the `.gitignore` with the new names of
the output/input files.
Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>

Test Plan: build & run

Reviewers: bgamari

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D3412
parent 488a0d89
......@@ -62,16 +62,16 @@ shootout/fasta/fasta.slowstdout
shootout/fasta/fasta.stdout
shootout/k-nucleotide/fasta-c
shootout/k-nucleotide/k-nucleotide
shootout/k-nucleotide/knucleotide-input250000.txt
shootout/k-nucleotide/knucleotide-input2500000.txt
shootout/k-nucleotide/knucleotide-input25000000.txt
shootout/k-nucleotide/k-nucleotide.faststdin
shootout/k-nucleotide/k-nucleotide.slowstdin
shootout/k-nucleotide/k-nucleotide.stdin
shootout/n-body/n-body
shootout/pidigits/pidigits
shootout/reverse-complement/fasta-c
shootout/reverse-complement/revcomp-c
shootout/reverse-complement/revcomp-input250000.txt
shootout/reverse-complement/revcomp-input2500000.txt
shootout/reverse-complement/revcomp-input25000000.txt
shootout/reverse-complement/reverse-complement.faststdin
shootout/reverse-complement/reverse-complement.slowstdin
shootout/reverse-complement/reverse-complement.stdin
shootout/reverse-complement/reverse-complement
shootout/reverse-complement/reverse-complement.faststdout
shootout/reverse-complement/reverse-complement.slowstdout
......
......@@ -28,9 +28,9 @@ fasta.stdout : fasta-c
fasta.slowstdout : fasta-c
./fasta-c $(SLOW_OPTS) > $@
# Since the stdout files are created during the run the runstdtest
# script doesn't correctly pick them up, so we have to specify them
# explicitly here.
# Since we only decide here what the INPUT_FILE is, it's required to first run
# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
# doesn't call `runstdtest` correctly)
ifeq "$(mode)" "slow"
STDOUT_FILE = fasta.slowstdout
else
......@@ -41,8 +41,6 @@ else
endif
endif
SRC_RUNTEST_OPTS += -o1 $(STDOUT_FILE)
all boot :: $(STDOUT_FILE)
boot :: $(STDOUT_FILE)
include $(TOP)/mk/target.mk
......@@ -17,27 +17,28 @@ HC_OPTS += -O2 -XBangPatterns -package bytestring
fasta-c : ../fasta/fasta-c.c
$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
knucleotide-input250000.txt : fasta-c
k-nucleotide.faststdin : fasta-c
./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
knucleotide-input2500000.txt : fasta-c
k-nucleotide.stdin : fasta-c
./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
knucleotide-input25000000.txt : fasta-c
k-nucleotide.slowstdin : fasta-c
./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
# Since we only decide here what the INPUT_FILE is, it's required to first run
# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
# doesn't call `runstdtest` correctly)
ifeq "$(mode)" "slow"
INPUT_FILE = knucleotide-input25000000.txt
INPUT_FILE = k-nucleotide.slowstdin
else
ifeq "$(mode)" "fast"
INPUT_FILE = knucleotide-input250000.txt
INPUT_FILE = k-nucleotide.faststdin
else
INPUT_FILE = knucleotide-input2500000.txt
INPUT_FILE = k-nucleotide.stdin
endif
endif
SRC_RUNTEST_OPTS += -i $(INPUT_FILE)
all boot :: $(INPUT_FILE)
boot :: $(INPUT_FILE)
include $(TOP)/mk/target.mk
......@@ -22,59 +22,56 @@ HC_OPTS += -O2 -XBangPatterns -funfolding-use-threshold=32 -XMagicHash \
fasta-c : ../fasta/fasta-c.c
$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
revcomp-input250000.txt : fasta-c
reverse-complement.faststdin : fasta-c
./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
revcomp-input2500000.txt : fasta-c
reverse-complement.stdin : fasta-c
./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
revcomp-input25000000.txt : fasta-c
reverse-complement.slowstdin : fasta-c
./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
# Since we only decide here what the INPUT_FILE is, it's required to first run
# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
# doesn't call `runstdtest` correctly)
ifeq "$(mode)" "slow"
INPUT_FILE = revcomp-input25000000.txt
INPUT_FILE = reverse-complement.slowstdin
else
ifeq "$(mode)" "fast"
INPUT_FILE = revcomp-input250000.txt
INPUT_FILE = reverse-complement.faststdin
else
INPUT_FILE = revcomp-input2500000.txt
INPUT_FILE = reverse-complement.stdin
endif
endif
SRC_RUNTEST_OPTS += -i $(INPUT_FILE)
all boot :: $(INPUT_FILE)
#------------------------------------------------------------------
# Create output to validate against
revcomp-c : revcomp-c.o
gcc $< -o $@ -pthread
reverse-complement.faststdout : revcomp-c
reverse-complement.faststdout : revcomp-c $(INPUT_FILE)
./revcomp-c < $(INPUT_FILE) > $@
reverse-complement.stdout : revcomp-c
reverse-complement.stdout : revcomp-c $(INPUT_FILE)
./revcomp-c < $(INPUT_FILE) > $@
reverse-complement.slowstdout : revcomp-c
reverse-complement.slowstdout : revcomp-c $(INPUT_FILE)
./revcomp-c < $(INPUT_FILE) > $@
# Since the stdout files are created during the run the runstdtest
# script doesn't correctly pick them up, so we have to specify them
# explicitly here.
# Since we only decide here what the OUTPUT_FILE is, it's required to first run
# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
# doesn't call `runstdtest` correctly)
ifeq "$(mode)" "slow"
STDOUT_FILE = reverse-complement.slowstdout
OUTPUT_FILE = reverse-complement.slowstdout
else
ifeq "$(mode)" "fast"
STDOUT_FILE = reverse-complement.faststdout
OUTPUT_FILE = reverse-complement.faststdout
else
STDOUT_FILE = reverse-complement.stdout
OUTPUT_FILE = reverse-complement.stdout
endif
endif
SRC_RUNTEST_OPTS += -o1 $(STDOUT_FILE)
all boot :: $(STDOUT_FILE)
boot :: $(INPUT_FILE) $(OUTPUT_FILE)
include $(TOP)/mk/target.mk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment