-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
82 lines (57 loc) · 1.82 KB
/
Makefile
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
PACKAGE=dbgfm
# Programs
SGA=sga
# Options
CXXFLAGS=-g -O3
# Directories
prefix=/usr/local
bindir=$(prefix)/bin
includedir=$(prefix)/include
libdir=$(prefix)/lib
pkgincludedir=$(includedir)/$(PACKAGE)
# Programs and libraries to build
PROGRAMS=dbgfm bwtdisk-prepare
LIBRARIES=libdbgfm.a
# Targets
all: $(PROGRAMS)
clean:
rm -f $(LIBRARIES) $(PROGRAMS) *.o
install: $(PROGRAMS)
install $(PROGRAMS) $(DESTDIR)$(bindir)
install $(LIBRARIES) $(DESTDIR)$(libdir)
install -d $(DESTDIR)$(pkgincludedir)
install $(HEADERS) $(DESTDIR)$(pkgincludedir)
test: $(PROGRAMS) chr20.pp.dbgfm
uninstall:
-cd $(DESTDIR)$(bindir) && rm -f $(PROGRAMS)
-cd $(DESTDIR)$(libdir) && rm -f $(LIBRARIES)
-cd $(DESTDIR)$(pkgincludedir) && rm -f $(HEADERS)
-rmdir $(DESTDIR)$(pkgincludedir)
.PHONY: all clean install test uninstall
.DELETE_ON_ERROR:
.SECONDARY:
# Headers
HEADERS = alphabet.h bwtdisk_reader.h dbg_query.h fm_index.h \
fm_index_builder.h fm_markers.h huffman_tree_codec.h \
packed_table_decoder.h sga_bwt_reader.h sga_rlunit.h \
stream_encoding.h utility.h
# Build libdbgfm.a
libdbgfm_a_OBJECTS = alphabet.o bwtdisk_reader.o dbg_query.o \
fm_index.o fm_index_builder.o sga_bwt_reader.o utility.o
libdbgfm.a: $(libdbgfm_a_OBJECTS) $(HEADERS)
$(AR) crs $@ $(libdbgfm_a_OBJECTS)
# Build dbgfm
dbgfm: main.o libdbgfm.a
$(CXX) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
# Build bwtdisk-prepare
bwtdisk-prepare: bwtdisk_prepare.o
$(CXX) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
# Tests
chr20.fa.gz:
wget ftp://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/vertebrates_mammals/Homo_sapiens/GRCh37/Primary_Assembly/assembled_chromosomes/FASTA/chr20.fa.gz
%.pp.fa: %.fa.gz
$(SGA) preprocess --permute $< >$@
%.bwtdisk: %.fa bwtdisk-prepare
./run_bwtdisk.sh $<
%.dbgfm: %.bwtdisk dbgfm
./dbgfm $*