forked from richarddurbin/pbwt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 1.07 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
CFLAGS= -g -O3
CPPFLAGS=-I$(HTSDIR)
HTSDIR=../htslib
HTSLIB=$(HTSDIR)/libhts.a
LDLIBS=-lpthread -lz -lm $(HTSLIB)
all: pbwt
PBWT_COMMIT_HASH = ""
ifneq "$(wildcard .git)" ""
PBWT_COMMIT_HASH = $(shell git describe --always --long --dirty)
version.h: $(if $(wildcard version.h),$(if $(findstring "$(PBWT_COMMIT_HASH)",$(shell cat version.h)),,force))
endif
version.h:
echo '#define PBWT_COMMIT_HASH "$(PBWT_COMMIT_HASH)"' > $@
force:
test: all
./test/test.pl
PBWT_OBJS=pbwtMain.o pbwtCore.o pbwtSample.o pbwtIO.o pbwtMatch.o pbwtImpute.o pbwtPaint.o pbwtLikelihood.o pbwtMerge.o pbwtGeneticMap.o pbwtHtslib.o
UTILS_OBJS=hash.o dict.o array.o utils.o
UTILS_HEADERS=utils.h array.h dict.h hash.h
AUTOZYG_OBJS=autozygExtract.o
pbwt: $(PBWT_OBJS) $(UTILS_OBJS)
$(LINK.c) $^ $(LDLIBS) -o $@
pbwtMain.o: version.h
$(PBWT_OBJS): pbwt.h $(UTILS_HEADERS)
$(UTILS_OBJS): utils.h $(UTILS_HEADERS)
autozygExtract: $(AUTOZYG_OBJS)
$(LINK.c) $^ $(LDLIBS) -o $@
install: all
install -d $(PREFIX)
install pbwt $(PREFIX)
clean:
$(RM) *.o pbwt *~ version.h
.PHONY: all test clean force install