--- Makefile.orig 2015-06-23 16:32:51 UTC +++ Makefile @@ -8,9 +8,13 @@ bindir = $(prefix)/bin SEQAN_DIR = SeqAn-1.1 SEQAN_INC = -I $(SEQAN_DIR) INC = $(SEQAN_INC) -I third_party -CPP = g++ -CXX = $(CPP) -CC = gcc + +# Use ?= to allow environment CPP, CC, CXX to take precedence. This avoids +# the need to modify the Makefile on different platforms. Package managers +# such as FreeBSD ports, MacPorts, etc. set these variables automatically. +CPP ?= g++ +CXX ?= $(CPP) +CC ?= gcc HEADERS = $(wildcard *.h) BOWTIE_MM = 1 BOWTIE_SHARED_MEM = 1 @@ -90,10 +94,10 @@ PREFETCH_LOCALITY = 2 PREF_DEF = -DPREFETCH_LOCALITY=$(PREFETCH_LOCALITY) ifeq (1,$(WITH_TBB)) - LIBS = $(PTHREAD_LIB) -ltbb -ltbbmalloc_proxy + LIBS = ${LDFLAGS} $(PTHREAD_LIB) -ltbb -ltbbmalloc_proxy EXTRA_FLAGS += -DWITH_TBB else - LIBS = $(PTHREAD_LIB) + LIBS = ${LDFLAGS} $(PTHREAD_LIB) endif SEARCH_LIBS = @@ -123,7 +127,7 @@ SEARCH_FRAGMENTS = $(wildcard search_*_p VERSION = $(shell cat VERSION) BITS=32 -ifeq (x86_64,$(shell uname -m)) +ifeq (amd64,$(shell uname -m)) BITS=64 endif # msys will always be 32 bit so look at the cpu arch instead. @@ -143,8 +147,8 @@ ifeq (32,$(BITS)) $(error bowtie2 compilation requires a 64-bit platform ) endif -DEBUG_FLAGS = -O0 -g3 -m64 -RELEASE_FLAGS = -O3 -m64 +DEBUG_FLAGS = -O0 -g3 +RELEASE_FLAGS = -O NOASSERT_FLAGS = -DNDEBUG FILE_FLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE