Skip to content

Commit

Permalink
Add HTSLIBDIR parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
karel-brinda committed Aug 28, 2016
1 parent 554e709 commit 9efcb10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
27 changes: 16 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
CXX ?= g++
CXXFLAGS = -std=c++11 -Wall -Wextra -Wno-missing-field-initializers -Wshadow -g -O2
LIBS = -lm -lz -lpthread
CXXFLAGS = -std=c++11 -Wall -Wextra -Wno-missing-field-initializers -Wshadow -g -O2
LIBS = -lm -lz -lpthread

PREFIX = $(DESTDIR)/usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
MANPAGE = ococo.1
PREFIX = $(DESTDIR)/usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
MANPAGE = ococo.1

HTSLIBDIR = ext/htslib
HTSLIB = $(HTSLIBDIR)/libhts.a

export CXX
export CXXFLAGS

export HTSLIBDIR
export HTSLIB

.PHONY: all clean install ococo

all: ococo
Expand All @@ -18,14 +24,13 @@ install: ococo
install ococo $(BINDIR)/ococo
install $(MANPAGE) $(MANDIR)/$(MANPAGE)

ococo:
$(MAKE) -C ./ext/htslib lib-static
ococo: $(HTSLIB)
$(MAKE) -C ./src

$(CXX) $(CXXFLAGS) $(DFLAGS) ./src/*.o -o $@ -L. $(LIBS) ./ext/htslib/libhts.a
$(CXX) $(CXXFLAGS) $(DFLAGS) ./src/*.o -o $@ -L. $(LIBS) $(HTSLIB)

ext/htslib/libhts.a:
$(MAKE) -C ext/htslib lib-static
$(HTSLIB):
$(MAKE) -C $(HTSLIBDIR) lib-static

clean:
$(MAKE) -C ext/htslib clean
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ all: misc.o main.o params.o
HEADERS=types.h stats.h version.h

main.o: main.cpp consensus.h caller.h version.h $(HEADERS)
$(CXX) $(CXXFLAGS) $(DFLAGS) -c $< -I ../ext/htslib/
$(CXX) $(CXXFLAGS) $(DFLAGS) -c $< -I ../$(HTSLIB)


%.o: %.cpp %.h $(HEADERS)
$(CXX) $(CXXFLAGS) $(DFLAGS) -c $< -I ../ext/htslib/
$(CXX) $(CXXFLAGS) $(DFLAGS) -c $< -I ../$(HTSLIB)

clean:
rm -f *.o

0 comments on commit 9efcb10

Please sign in to comment.