File: Makefile.in

package info (click to toggle)
mash 2.1+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 33,484 kB
  • sloc: cpp: 5,750; ansic: 181; makefile: 110; python: 31; sh: 14
file content (101 lines) | stat: -rw-r--r-- 2,816 bytes parent folder | download | duplicates (2)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
CXXFLAGS += -O3 -std=c++14 -Isrc -I@capnp@/include -I@mathinc@
CPPFLAGS += @amcppflags@

UNAME_S=$(shell uname -s)

ifeq ($(UNAME_S),Darwin)
	CXXFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
endif

SOURCES=\
	src/mash/Command.cpp \
	src/mash/CommandBounds.cpp \
	src/mash/CommandContain.cpp \
	src/mash/CommandDistance.cpp \
	src/mash/CommandScreen.cpp \
	src/mash/CommandTriangle.cpp \
	src/mash/CommandFind.cpp \
	src/mash/CommandInfo.cpp \
	src/mash/CommandPaste.cpp \
	src/mash/CommandSketch.cpp \
	src/mash/CommandList.cpp \
	src/mash/hash.cpp \
	src/mash/HashList.cpp \
	src/mash/HashPriorityQueue.cpp \
	src/mash/HashSet.cpp \
	src/mash/MinHashHeap.cpp \
	src/mash/mash.cpp \
	src/mash/Sketch.cpp \
	src/mash/sketchParameterSetup.cpp \

OBJECTS=$(SOURCES:.cpp=.o) src/mash/capnp/MinHash.capnp.o

all : mash libmash.a

mash : $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o mash $(OBJECTS) -lkj -lcapnp @mathlib@ -lstdc++ -lz -lm -lpthread -lmurmurhash $(LDFLAGS)

libmash.a : $(OBJECTS)
	ar -cr libmash.a $(OBJECTS)
	ranlib libmash.a

.SUFFIXES :

%.o : %.cpp src/mash/capnp/MinHash.capnp.h
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $<

%.o : %.c++
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $<

src/mash/capnp/MinHash.capnp.c++ : src/mash/capnp/MinHash.capnp.h

src/mash/capnp/MinHash.capnp.h : src/mash/capnp/MinHash.capnp
	cd src/mash/capnp;export PATH=@capnp@/bin/:${PATH};capnp compile -I @capnp@/include -oc++ MinHash.capnp

install : mash
	mkdir -p @prefix@/bin/
	mkdir -p @prefix@/lib/
	mkdir -p @prefix@/include/
	mkdir -p @prefix@/include/mash
	mkdir -p @prefix@/include/mash/capnp
	cp `pwd`/mash @prefix@/bin/
	cp `pwd`/libmash.a @prefix@/lib/
	cp `pwd`/src/mash/*.h @prefix@/include/mash/
	cp `pwd`/src/mash/capnp/MinHash.capnp.h @prefix@/include/mash/capnp/

.PHONY: uninstall
uninstall:
	rm -f @prefix@/bin/mash
	rm -f @prefix@/lib/libmash.a
	rm -rf @prefix@/include/mash

clean :
	-rm mash
	-rm libmash.a
	-rm src/mash/*.o
	-rm src/mash/capnp/*.o
	-rm src/mash/capnp/*.c++
	-rm src/mash/capnp/*.h

.PHONY: test
test : testSketch testDist testScreen

testSketch : mash test/genomes.msh test/reads.msh
	./mash info -d test/genomes.msh > test/genomes.json
	./mash info -d test/reads.msh > test/reads.json
	diff test/genomes.json test/ref/genomes.json
	diff test/reads.json test/ref/reads.json

test/genomes.msh : mash
	cd test ; ../mash sketch -o genomes.msh genome1.fna genome2.fna genome3.fna

test/reads.msh : mash
	cd test ; ../mash sketch -r -I reads reads1.fastq reads2.fastq -o reads.msh

testDist : mash test/genomes.msh test/reads.msh
	./mash dist test/genomes.msh test/reads.msh > test/genomes.dist
	diff test/genomes.dist test/ref/genomes.dist

testScreen : mash test/genomes.msh
	cd test ; ../mash screen genomes.msh reads1.fastq reads2.fastq > screen
	diff test/screen test/ref/screen