forked from samtools/bcftools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (56 loc) · 1.89 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
PROG= bcftools
all: $(PROG)
# Adjust $(HTSDIR) to point to your top-level htslib directory
HTSDIR = ../htslib
include $(HTSDIR)/htslib.mk
HTSLIB = $(HTSDIR)/libhts.a
CC= gcc
CFLAGS= -g -Wall -Wc++-compat -O2
DFLAGS=
OBJS= main.o vcfview.o bcfidx.o tabix.o \
vcfstats.o vcfisec.o vcfmerge.o vcfquery.o vcffilter.o filter.o vcfsom.o \
vcfnorm.o vcfgtcheck.o vcfsubset.o vcfannotate.o vcfroh.o \
vcfcall.o mcall.o vcmp.o \
ccall.o em.o prob1.o kmin.o # the original samtools calling
INCLUDES= -I. -I$(HTSDIR)
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
mandir = $(prefix)/share/man
man1dir = $(mandir)/man1
INSTALL = install -p
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
all:$(PROG)
# See htslib/Makefile
PACKAGE_VERSION = 0.0.1
ifneq "$(wildcard .git)" ""
PACKAGE_VERSION := $(shell git describe --always --dirty)
version.h: $(if $(wildcard version.h),$(if $(findstring "$(PACKAGE_VERSION)",$(shell cat version.h)),,force))
endif
version.h:
echo '#define BCFTOOLS_VERSION "$(PACKAGE_VERSION)"' > $@
.SUFFIXES:.c .o
.PHONY:all install lib test force
force:
.c.o: bcftools.h version.h
$(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
test: $(PROG)
./test/test.pl
main.o: version.h $(HTSDIR)/version.h bcftools.h
vcfcall.o: vcfcall.c call.h mcall.c prob1.h $(HTSDIR)/htslib/kfunc.h $(HTSDIR)/htslib/vcf.h
mcall.o ccall.o: call.h vcmp.h
vcffilter.o: filter.h
vcfsubset.o: filter.h
vcfnorm.o: rbuf.h
vcffilter.o: rbuf.h
vcfroh.o: rbuf.h
bcftools: $(HTSLIB) $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(HTSLIB) -lpthread -lz -lm
install: $(PROG)
mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
$(INSTALL_PROGRAM) $(PROG) plot-vcfstats $(DESTDIR)$(bindir)
$(INSTALL_DATA) bcftools.1 $(DESTDIR)$(man1dir)
cleanlocal:
rm -fr gmon.out *.o a.out *.dSYM *~ $(PROG) version.h
clean:cleanlocal clean-htslib