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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617
|
#
# Copyright 2011, Ben Langmead <langmea@cs.jhu.edu>
#
# This file is part of Bowtie 2.
#
# Bowtie 2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bowtie 2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bowtie 2. If not, see <http://www.gnu.org/licenses/>.
#
#
# Makefile for bowtie, bowtie2-build, bowtie2-inspect
#
PREFIX := /usr/local
bindir := $(PREFIX)/bin
LDLIBS := -lpthread -lz
HEADERS := $(sort $(wildcard *.h))
BOWTIE_MM := 1
BOWTIE_SHARED_MEM :=
CXXFLAGS += -std=c++11 -Wall -Wno-unused-but-set-variable
SRA_TOOLS_VER ?= 3.0.9
VDB_VER ?= 3.0.9
ifneq (,$(findstring $(shell uname),Linux))
LDLIBS += -lrt
endif
# Detect Cygwin or MinGW
ifneq (,$(findstring mingw,$(shell $(CXX) --version)))
WINDOWS := 1
MINGW := 1
endif
ifeq (1, $(MINGW))
LDLIBS := $(subst -lrt,,$(LDLIBS))
CXX = x86_64-w64-mingw32-g++-posix
CC = x86_64-w64-mingw32-gcc-posix
AR = x86_64-w64-mingw32-ar
RC = x86_64-w64-mingw32-windres
LD = x86_64-w64-mingw32-ld
STRIP = x86_64-w64-mingw32-strip
endif
# POSIX memory-mapped files not currently supported on Windows
ifeq (1, $(WINDOWS))
BOWTIE_MM :=
BOWTIE_SHARED_MEM :=
endif
MACOS :=
ifneq (,$(findstring Darwin,$(shell uname)))
MACOS := 1
ifeq (1,$(shell uname -r | awk -F. '{ if ($$1 > 12 && $$1 < 16) print 1; }'))
CXXFLAGS += -stdlib=libstdc++
endif
ifdef STATIC_BUILD
CXXFLAGS += -mmacosx-version-min=10.9
endif
endif
CXXFLAGS += -fopenmp-simd
CPPFLAGS += -Ithird_party
ifneq (,$(findstring $(shell dpkg-architecture -q DEB_TARGET_ARCH), x86_64 amd64))
ifeq (1, $(SSE_AVX2))
SSE_FLAG := -mavx2 -faligned-new -DSSE_AVX2
else
SSE_FLAG := -msse2
endif
POPCNT_CAPABILITY ?= 1
else
SSE_FLAG :=
POPCNT_CAPABILITY ?= 0
endif
ifeq (1, $(if $(or $(USE_SAIS),$(USE_SAIS_OPENMP)),1))
CPPFLAGS += -Ithird_party/libsais/include
ifdef USE_SAIS_OPENMP
BUILD_CXXFLAGS += -fopenmp
endif
BUILD_CXXFLAGS += -DUSE_SAIS
BUILD_LDFLAGS += -Lthird_party/libsais/lib
BUILD_LDLIBS += -lsais
endif
# msys will always be 32 bit so look at the cpu arch instead.
ifneq (,$(findstring AMD64,$(PROCESSOR_ARCHITEW6432)))
ifeq (1,$(MINGW))
BITS := 64
endif
endif
ifeq (32,$(BITS))
$(error bowtie2 compilation requires a 64-bit platform )
endif
ifdef STATIC_BUILD
WITH_ZSTD = 1
LDFLAGS += -L$(CURDIR)/.tmp/lib
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
ifeq (1, $(POPCNT_CAPABILITY))
CXXFLAGS += -DPOPCNT_CAPABILITY
CPPFLAGS += -I third_party
endif
MM_DEF :=
ifeq (1,$(BOWTIE_MM))
MM_DEF := -DBOWTIE_MM
endif
SHMEM_DEF :=
ifdef BOWTIE_SHARED_MEM
SHMEM_DEF := -DBOWTIE_SHARED_MEM
endif
PTHREAD_PKG :=
PTHREAD_LIB :=
ifeq (1,$(MINGW))
PTHREAD_LIB :=
else
PTHREAD_LIB := -lpthread
endif
ifeq (1,$(NO_SPINLOCK))
CXXFLAGS += -DNO_SPINLOCK
endif
USE_SRA ?=
ifeq (1, $(USE_SRA))
ifdef MINGW
$(error "SRA binaries cannot be built on MINGW")
else
LDFLAGS += -L$(CURDIR)/.tmp/lib64
ifndef ($(STATIC_BUILD))
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
ALIGN_LDLIBS += -lncbi-ngs-static
ALIGN_LDLIBS += -lncbi-vdb-static
ALIGN_LDLIBS += -ldl
CXXFLAGS += -DUSE_SRA
endif
endif
ifeq (1,$(WITH_THREAD_PROFILING))
CXXFLAGS += -DPER_THREAD_TIMING=1
endif
ifeq (1,$(WITH_AFFINITY))
CXXFLAGS += -DWITH_AFFINITY=1
endif
#default is to use queue lock for better thread scaling performance
ifneq (1,$(NO_QUEUELOCK))
CXXFLAGS += -DNO_SPINLOCK
CXXFLAGS += -DWITH_QUEUELOCK=1
endif
SHARED_CPPS := ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp \
edit.cpp bt2_locks.cpp bt2_idx.cpp bt2_io.cpp bt2_util.cpp \
reference.cpp ds.cpp multikey_qsort.cpp limit.cpp \
random_source.cpp
SEARCH_CPPS := qual.cpp pat.cpp sam.cpp \
read_qseq.cpp aligner_seed_policy.cpp \
aligner_seed.cpp \
aligner_seed2.cpp \
aligner_sw.cpp \
aligner_sw_driver.cpp aligner_cache.cpp \
aligner_result.cpp ref_coord.cpp mask.cpp \
pe.cpp aln_sink.cpp dp_framer.cpp \
scoring.cpp presets.cpp unique.cpp \
simple_func.cpp \
random_util.cpp \
aligner_bt.cpp sse_util.cpp \
aligner_swsse.cpp outq.cpp \
aligner_swsse_loc_i16.cpp \
aligner_swsse_ee_i16.cpp \
aligner_swsse_loc_u8.cpp \
aligner_swsse_ee_u8.cpp \
aligner_driver.cpp
ifeq (1, $(WITH_ZSTD))
LDLIBS += -lzstd
CXXFLAGS += -DWITH_ZSTD
SHARED_CPPS += zstd_decompress.cpp
endif
SEARCH_CPPS_MAIN := $(SEARCH_CPPS) bowtie_main.cpp
DP_CPPS := qual.cpp aligner_sw.cpp aligner_result.cpp ref_coord.cpp mask.cpp \
simple_func.cpp sse_util.cpp aligner_bt.cpp aligner_swsse.cpp \
aligner_swsse_loc_i16.cpp aligner_swsse_ee_i16.cpp \
aligner_swsse_loc_u8.cpp aligner_swsse_ee_u8.cpp scoring.cpp
BUILD_CPPS := diff_sample.cpp
BUILD_CPPS_MAIN := $(BUILD_CPPS) bowtie_build_main.cpp
SEARCH_FRAGMENTS := $(wildcard search_*_phase*.c)
VERSION := $(shell cat BOWTIE2_VERSION)
DEBUG_FLAGS := -O0 -g3 $(SSE_FLAG)
RELEASE_FLAGS := -O3 $(SSE_FLAG) -funroll-loops -g3
NOASSERT_FLAGS := -DNDEBUG
FILE_FLAGS := -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(filter-out -fdebug-prefix-map=% -ffile-prefix-map=%,$(DEBUG_FLAGS) $(CXXFLAGS))\""
RELEASE_DEFS = -DCOMPILER_OPTIONS="\"$(filter-out -fdebug-prefix-map=% -ffile-prefix-map=%,$(RELEASE_FLAGS) $(CXXFLAGS))\""
BOWTIE2_BIN_LIST := bowtie2-build-s \
bowtie2-build-l \
bowtie2-align-s \
bowtie2-align-l \
bowtie2-inspect-s \
bowtie2-inspect-l
BOWTIE2_BIN_LIST_DBG := bowtie2-build-s-debug \
bowtie2-build-l-debug \
bowtie2-align-s-debug \
bowtie2-align-l-debug \
bowtie2-inspect-s-debug \
bowtie2-inspect-l-debug
GENERAL_LIST := $(wildcard scripts/*.sh) \
$(wildcard scripts/*.pl) \
doc/manual.html \
doc/README \
doc/style.css \
$(wildcard example/index/*.bt2) \
$(wildcard example/reads/*.fq) \
$(wildcard example/reads/*.pl) \
example/reads/combined_reads.bam \
example/reference/lambda_virus.fa \
$(PTHREAD_PKG) \
bowtie2 \
bowtie2-build \
bowtie2-inspect \
AUTHORS \
LICENSE \
NEWS \
MANUAL \
MANUAL.markdown \
README.md \
TUTORIAL \
BOWTIE2_VERSION
ifeq (1,$(WINDOWS))
BOWTIE2_BIN_LIST := $(BOWTIE2_BIN_LIST) bowtie2.bat bowtie2-build.bat bowtie2-inspect.bat
CXXFLAGS += -static-libgcc -static-libstdc++ -static
endif
# This is helpful on Windows under MinGW/MSYS, where Make might go for
# the Windows FIND tool instead.
FIND := $(shell which find)
SRC_PKG_LIST = $(wildcard *.h) \
$(wildcard *.hh) \
$(wildcard *.c) \
$(wildcard *.cpp) \
$(wildcard third_party/*) \
Makefile \
CMakeLists.txt \
$(GENERAL_LIST)
ifeq (1,$(WINDOWS))
BIN_PKG_LIST := $(GENERAL_LIST) bowtie2.bat bowtie2-build.bat bowtie2-inspect.bat
else
BIN_PKG_LIST := $(GENERAL_LIST)
endif
.PHONY: all allall both both-debug
all: $(BOWTIE2_BIN_LIST) ;
allall: $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG) ;
both: bowtie2-align-s bowtie2-build-s bowtie2-align-l bowtie2-build-l ;
both-debug: bowtie2-align-s-debug bowtie2-build-s-debug bowtie2-align-l-debug bowtie2-build-l-debug ;
DEFS := -fno-strict-aliasing \
-DBOWTIE2_VERSION="\"`cat BOWTIE2_VERSION`\"" \
-DBUILD_HOST="\"$${HOSTNAME:-`hostname`}\"" \
-DBUILD_TIME="\"`LC_ALL=C date -u -d@$(SOURCE_DATE_EPOCH)`\"" \
-DCOMPILER_VERSION="\"`$(CXX) -v 2>&1 | tail -1`\"" \
$(FILE_FLAGS) \
$(PREF_DEF) \
$(MM_DEF) \
$(SHMEM_DEF) \
$(CPPFLAGS) \
$(CFLAGS)
bowtie2-build-%: CXXFLAGS += $(BUILD_CXXFLAGS)
bowtie2-build-%: LDFLAGS += $(BUILD_LDFLAGS)
bowtie2-build-%: LDLIBS += $(BUILD_LDLIBS)
bowtie2-align-%: LDLIBS += $(ALIGN_LDLIBS)
#
# bowtie2-build targets
#
bowtie2-build-s-sanitized bowtie2-build-s: bt2_build.cpp $(SHARED_CPPS) $(HEADERS)
$(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 $(NOASSERT_FLAGS) \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(BUILD_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-build-l-sanitized bowtie2-build-l: bt2_build.cpp $(SHARED_CPPS) $(HEADERS)
$(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_64BIT_INDEX $(NOASSERT_FLAGS) \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(BUILD_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-build-s-debug: bt2_build.cpp $(SHARED_CPPS) $(HEADERS)
$(CXX) $(DEBUG_FLAGS) $(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(BUILD_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-build-l-debug: bt2_build.cpp $(SHARED_CPPS) $(HEADERS)
$(CXX) $(DEBUG_FLAGS) $(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_64BIT_INDEX \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(BUILD_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
#
# bowtie2-align targets
#
bowtie2-align-s-sanitized bowtie2-align-s: bt2_search.cpp $(SEARCH_CPPS) $(SHARED_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS)
$(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 $(NOASSERT_FLAGS) \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(SEARCH_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-align-l-sanitized bowtie2-align-l: bt2_search.cpp $(SEARCH_CPPS) $(SHARED_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS)
$(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_64BIT_INDEX $(NOASSERT_FLAGS) \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(SEARCH_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-align-s-debug: bt2_search.cpp $(SEARCH_CPPS) $(SHARED_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS)
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(SEARCH_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
bowtie2-align-l-debug: bt2_search.cpp $(SEARCH_CPPS) $(SHARED_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS)
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_64BIT_INDEX \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) $(SEARCH_CPPS_MAIN) \
$(LDFLAGS) $(LDLIBS)
#
# bowtie2-inspect targets
#
bowtie2-inspect-s-sanitized bowtie2-inspect-s: bt2_inspect.cpp $(HEADERS) $(SHARED_CPPS)
$(CXX) $(RELEASE_FLAGS) \
$(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_INSPECT_MAIN \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
bowtie2-inspect-l-sanitized bowtie2-inspect-l: bt2_inspect.cpp $(HEADERS) $(SHARED_CPPS)
$(CXX) $(RELEASE_FLAGS) \
$(RELEASE_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_INSPECT_MAIN -DBOWTIE_64BIT_INDEX \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
bowtie2-inspect-s-debug: bt2_inspect.cpp $(HEADERS) $(SHARED_CPPS)
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_INSPECT_MAIN \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
bowtie2-inspect-l-debug: bt2_inspect.cpp $(HEADERS) $(SHARED_CPPS)
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_64BIT_INDEX -DBOWTIE_INSPECT_MAIN \
$(CPPFLAGS) \
-o $@ $< \
$(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
#
# bowtie2-dp targets
#
bowtie2-dp: bt2_dp.cpp $(HEADERS) $(SHARED_CPPS) $(DP_CPPS)
$(CXX) $(RELEASE_FLAGS) \
$(RELEASE_DEFS) $(CXXFLAGS) $(NOASSERT_FLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_DP_MAIN \
$(CPPFLAGS) \
-o $@ $< \
$(DP_CPPS) $(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
bowtie2-dp-debug: bt2_dp.cpp $(HEADERS) $(SHARED_CPPS) $(DP_CPPS)
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
$(DEFS) -DBOWTIE2 -DBOWTIE_DP_MAIN \
$(CPPFLAGS) \
-o $@ $< \
$(DP_CPPS) $(SHARED_CPPS) \
$(LDFLAGS) $(LDLIBS)
bowtie2.bat:
echo "@echo off" > bowtie2.bat
echo "perl %~dp0/bowtie2 %*" >> bowtie2.bat
bowtie2-build.bat:
echo "@echo off" > bowtie2-build.bat
echo "python3 %~dp0/bowtie2-build %*" >> bowtie2-build.bat
bowtie2-inspect.bat:
echo "@echo off" > bowtie2-inspect.bat
echo "python3 %~dp0/bowtie2-inspect %*" >> bowtie2-inspect.bat
.PHONY: bowtie2-src-pkg
bowtie2-src-pkg: $(SRC_PKG_LIST)
chmod a+x scripts/*.sh scripts/*.pl
mkdir .src.tmp
mkdir .src.tmp/bowtie2-$(VERSION)
zip tmp.zip $(SRC_PKG_LIST)
mv tmp.zip .src.tmp/bowtie2-$(VERSION)
cd .src.tmp/bowtie2-$(VERSION) ; unzip tmp.zip ; rm -f tmp.zip
cd .src.tmp ; zip -r bowtie2-$(VERSION)-source.zip bowtie2-$(VERSION)
cp .src.tmp/bowtie2-$(VERSION)-source.zip .
rm -rf .src.tmp
.PHONY: bowtie2-bin-pkg
bowtie2-bin-pkg: PKG_DIR := bowtie2-$(VERSION)-$(if $(USE_SRA),sra-)$(if $(MACOS),macos,$(if $(MINGW),mingw,linux))-$(ARCH)
bowtie2-bin-pkg: $(BIN_PKG_LIST) $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)
chmod a+x scripts/*.sh scripts/*.pl
rm -rf .bin.tmp
mkdir -p .bin.tmp/$(PKG_DIR)
if [ -f bowtie2-align-s.exe ] ; then \
zip tmp.zip $(BIN_PKG_LIST) $(addsuffix .exe,$(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)) ; \
else \
zip tmp.zip $(BIN_PKG_LIST) $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG) ; \
fi
mv tmp.zip .bin.tmp/$(PKG_DIR)
cd .bin.tmp/$(PKG_DIR) ; unzip tmp.zip ; rm -f tmp.zip
cd .bin.tmp ; zip -r $(PKG_DIR).zip $(PKG_DIR)
cp .bin.tmp/$(PKG_DIR).zip .
rm -rf .bin.tmp
bowtie2-seeds-debug: aligner_seed.cpp ccnt_lut.cpp alphabet.cpp aligner_seed.h bt2_idx.cpp bt2_io.cpp
$(CXX) $(DEBUG_FLAGS) \
$(DEBUG_DEFS) $(CXXFLAGS) \
-DSCAN_MAIN \
$(DEFS) \
$(CPPFLAGS) \
-o $@ $< \
aligner_seed.cpp bt2_idx.cpp ccnt_lut.cpp alphabet.cpp bt2_io.cpp \
$(LDFLAGS) $(LDLIBS)
.PHONY: doc
doc: doc/manual.html MANUAL
doc/manual.html: MANUAL.markdown
echo "<h1>Table of Contents</h1>" > .tmp.head
pandoc -B .tmp.head \
--metadata title:"Bowtie 2 Manual"\
--css doc/style.css -o $@ \
--from markdown-smart \
--to HTML \
--table-of-contents $^
rm -f .tmp.head
MANUAL: MANUAL.markdown
pandoc -f markdown-smart -t plain $^ -o $@
.PHONY: install
install: all
mkdir -p $(DESTDIR)$(bindir)
for file in $(BOWTIE2_BIN_LIST) bowtie2-inspect bowtie2-build bowtie2 ; do \
cp -f $$file $(DESTDIR)$(bindir) ; \
done
.PHONY: simple-test
simple-test: all
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp` ; \
sh ./scripts/test/simple_tests.sh
.PHONY: random-test
random-test: all
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp` ; \
sh ./scripts/sim/run.sh $(if $(NUM_CORES), $(NUM_CORES), 2)
.PHONY: perl-deps
perl-deps:
if [ ! -d "$(CURDIR)/.tmp" ]; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate -O-" ) || echo "curl -L") ; \
$$DL http://cpanmin.us | perl - -l $(CURDIR)/.tmp App::cpanminus local::lib ; \
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp`
.PHONY: static-libs
static-libs:
if [ ! -d "$(CURDIR)/.tmp" ] ; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi ; \
if [ `uname` = "Darwin" ]; then \
export CFLAGS=-mmacosx-version-min=10.9 ; \
export CXXFLAGS=-mmacosx-version-min=10.9 ; \
fi ; \
cd $(CURDIR)/.tmp ; \
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate" ) || echo "curl -LOk") ; \
if [ ! -f "$(CURDIR)/.tmp/lib/libz.a" ] ; then \
$$DL http://zlib.net/zlib-1.3.tar.gz && tar xzf zlib-1.3.tar.gz && cd zlib-1.3 ; \
$(if $(MINGW), $(MAKE) libz.a -f win32/Makefile.gcc CC=$(CC) AR=$(AR) RC=$(RC) STRIP=$(STRIP) LD=$(LD), ./configure --static && make) && \
cp zlib.h zconf.h $(CURDIR)/.tmp/include && cp libz.a $(CURDIR)/.tmp/lib ; \
rm -rf zlib-1.3* ; \
fi ; \
if [ ! -f "$(CURDIR)/.tmp/lib/libzstd.a" ]; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz && tar xzf zstd-1.5.5.tar.gz ; \
cd zstd-1.5.5 && $(MAKE) CC=$(CC) AR=$(AR) RC=$(RC) STRIP=$(STRIP) LD=$(LD) lib ; \
cd $(CURDIR)/.tmp/zstd-1.5.5/lib && cp zstd.h $(CURDIR)/.tmp/include && cp libzstd.a $(CURDIR)/.tmp/lib ; \
rm -rf zstd-1.5.5* ; \
fi
.PHONY: libsais
libsais:
if [ ! -d $(CURDIR)/third_party/libsais ]; then \
git submodule init && git submodule update --recursive ; \
fi ; \
if [ -n "$(USE_SAIS_OPENMP)" ]; then \
export CFLAGS="$(CFLAGS) -fopenmp -O2" ; \
fi ; \
cd $(CURDIR)/third_party/libsais && $(MAKE) -B CC=$(CC) && $(MAKE) install PREFIX=$$PWD ;
.PHONY: sra-deps
sra-deps:
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate" ) || echo "curl -LOk") ; \
if [ ! -d "$(CURDIR)/.tmp" ] ; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi ; \
if [ `uname` = "Darwin" ]; then \
export CFLAGS=-mmacosx-version-min=10.9 ; \
export CXXFLAGS=-mmacosx-version-min=10.9 ; \
fi ; \
if [ ! -f "$(CURDIR)/.tmp/include/ncbi-vdb/NGS.hpp" ] ; then \
if [ ! -d "$(CURDIR)/.tmp/ncbi-vdb-$(VDB_VER)/vdb3" ] ; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/ncbi/ncbi-vdb/archive/refs/tags/$(VDB_VER).tar.gz ; \
tar zxvf $(VDB_VER).tar.gz ; \
rm -f $(VDB_VER).tar.gz ; \
fi ; \
cd $(CURDIR)/.tmp/ncbi-vdb-$(VDB_VER) \
&& ./configure --prefix=$(CURDIR)/.tmp --build-prefix=`pwd`/build --without-debug \
&& make && make install ; \
fi ; \
if [ ! -f "$(CURDIR)/.tmp/include/ngs/Alignment.hpp" ] ; then \
if [ ! -d "$(CURDIR)/.tmp/sra-tools-$(SRA_TOOLS_VER)" ] ; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/ncbi/sra-tools/archive/$(SRA_TOOLS_VER).tar.gz ; \
tar xzvf $(SRA_TOOLS_VER).tar.gz ; \
rm -f $(SRA_TOOLS_VER).tar.gz ; \
fi ; \
cd $(CURDIR)/.tmp/sra-tools-$(SRA_TOOLS_VER) \
&& ./configure --prefix=$(CURDIR)/.tmp --build-prefix=`pwd`/build \
--with-ncbi-vdb-prefix="$(CURDIR)/.tmp" --enable-static --without-debug \
&& make && make install ; \
fi ;
.PHONY: test
test: simple-test
.PHONY: clean
clean:
rm -f $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG) $(BOWTIE2_BIN_LIST_SAN) \
$(addsuffix .exe,$(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)) \
bowtie2-*.zip
rm -f core.* .tmp.head
rm -rf *.dSYM
rm -rf .tmp
|