--- Makefile.orig 2015-12-15 21:42:34 UTC +++ Makefile @@ -29,16 +29,15 @@ TEST_PROG= test/test-rbuf all: $(PROG) $(TEST_PROG) # Adjust $(HTSDIR) to point to your top-level htslib directory -HTSDIR = ../htslib -include $(HTSDIR)/htslib.mk -HTSLIB = $(HTSDIR)/libhts.a -BGZIP = $(HTSDIR)/bgzip -TABIX = $(HTSDIR)/tabix +HTSDIR = $(prefix)/include +HTSLIB = -lhts +BGZIP = $(HTSDIR)/../bin/bgzip +TABIX = $(HTSDIR)/../bin/tabix -CC = gcc -CPPFLAGS = -CFLAGS = -g -Wall -Wc++-compat -O2 -LDFLAGS = +CC ?= cc +CPPFLAGS += +CFLAGS += -Wall +LDFLAGS += LIBS = OBJS = main.o vcfindex.o tabix.o \ @@ -57,26 +56,20 @@ GSL_LIBS = ifdef USE_GPL EXTRA_CPPFLAGS += -DUSE_GPL OBJS += polysomy.o peakfit.o - GSL_LIBS = -lgsl -lcblas + GSL_LIBS = -lgsl -lgslcblas endif -prefix = /usr/local +prefix = ${STAGEDIR}${PREFIX} exec_prefix = $(prefix) bindir = $(exec_prefix)/bin libdir = $(exec_prefix)/lib libexecdir = $(exec_prefix)/libexec -mandir = $(prefix)/share/man +mandir = $(prefix)/man man1dir = $(mandir)/man1 plugindir = $(libexecdir)/bcftools pluginpath = $(plugindir) -MKDIR_P = mkdir -p -INSTALL = install -p -INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) -m 644 -INSTALL_DIR = $(MKDIR_P) -m 755 - MISC_PROGRAMS = plot-vcfstats vcfutils.pl plugins/color-chrs.pl all:$(PROG) plugins @@ -181,7 +174,7 @@ test/test-rbuf: test/test-rbuf.o $(CC) $(LDFLAGS) -o $@ $^ -lm $(LIBS) bcftools: $(HTSLIB) $(OBJS) - $(CC) -rdynamic $(LDFLAGS) -o $@ $(OBJS) $(HTSLIB) -lpthread -lz -lm -ldl $(GSL_LIBS) $(LIBS) + $(CC) -rdynamic $(LDFLAGS) -o $@ $(OBJS) $(HTSLIB) -pthread -lz -lm $(GSL_LIBS) $(LIBS) doc/bcftools.1: doc/bcftools.txt cd doc && a2x -adate="$(DOC_DATE)" -aversion=$(DOC_VERSION) --doctype manpage --format manpage bcftools.txt @@ -198,8 +191,9 @@ docs: doc/bcftools.1 doc/bcftools.html # Since there is no make dependency, bcftools.1 can be out-of-date and # make docs can be run to update if asciidoc is available install: $(PROG) - $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(plugindir) - $(INSTALL_PROGRAM) $(PROG) $(MISC_PROGRAMS) $(DESTDIR)$(bindir) + $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)/samtools_misc $(DESTDIR)$(man1dir) $(DESTDIR)$(plugindir) + $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) $(MISC_PROGRAMS) $(DESTDIR)$(bindir)/samtools_misc $(INSTALL_DATA) doc/bcftools.1 $(DESTDIR)$(man1dir) $(INSTALL_PROGRAM) plugins/*.so $(DESTDIR)$(plugindir)