-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (49 loc) · 2.04 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
MSDIR := msdir
DSFMT_VERSION := 2.2.5
DSFMT_SRC := dSFMT-${DSFMT_VERSION}
DESTDIR := ${HOME}/local/bin
CFLAGS := -O3 -Wall -Wno-implicit-function-declaration
CPPFLAGS := -DNDEBUG -fno-strict-aliasing
CXXFLAGS := -O3 -std=c++11 -Wall
LIBSEQUENCE := $(shell brew --prefix 2>/dev/null)
LDFLAGS_LIBSEQ := -L${LIBSEQUENCE}/lib -Wl,-rpath,${LIBSEQUENCE}/lib
LDLIBS := -lm
TARGET_ARCH := -m64 -msse -msse2 -msse3 -mfpmath=sse
INSTALL := install
.DEFAULT_GOAL := all
.PHONY: all clean install
all: ms ms_rand1 ms_rand2 sample_stats
@:
clean:
${RM} ms sample_stats ms_rand* msdir/*.o sample_stats++ summstats
install:
${INSTALL} -d ${DESTDIR}
${INSTALL} ms ${DESTDIR}
${INSTALL} sample_stats ${DESTDIR}
libseq: sample_stats++ summstats
@:
install-libseq: libseq
${INSTALL} sample_stats++ ${DESTDIR}
${INSTALL} summstats ${DESTDIR}
${MSDIR}/ms.c:
@echo "Download ms.tar.gz from http://home.uchicago.edu/rhudson1/source/mksamples.html"
@echo "Expand it here: tar xzf ~/Downloads/ms.tar.gz"
@exit 1
${DSFMT_SRC}/dSFMT.c:
curl -L https://github.com/MersenneTwister-Lab/dSFMT/archive/refs/tags/v${DSFMT_VERSION}.tar.gz | tar xzf -
ms: ${MSDIR}/ms.o ${MSDIR}/streec.o randdSFMT.c ${DSFMT_SRC}/dSFMT.c
${LINK.c} -I${DSFMT_SRC} -DDSFMT_MEXP=19937 -DSFMT_DO_NOT_USE_OLD_NAMES -Wno-return-type $^ ${LDLIBS} ${OUTPUT_OPTION}
sample_stats: ${MSDIR}/sample_stats.o ${MSDIR}/tajd.o
${LINK.c} $^ ${LDLIBS} ${OUTPUT_OPTION}
ms_rand1: ${MSDIR}/ms.o ${MSDIR}/streec.o ${MSDIR}/rand1.o
${LINK.c} $^ ${LDLIBS} ${OUTPUT_OPTION}
ms_rand1t: ${MSDIR}/ms.o ${MSDIR}/streec.o ${MSDIR}/rand1t.o
${LINK.c} $^ ${LDLIBS} ${OUTPUT_OPTION}
ms_rand2: ${MSDIR}/ms.o ${MSDIR}/streec.o ${MSDIR}/rand2.o
${LINK.c} $^ ${LDLIBS} ${OUTPUT_OPTION}
ms_rand2t: ${MSDIR}/ms.o ${MSDIR}/streec.o ${MSDIR}/rand2t.o
${LINK.c} $^ ${LDLIBS} ${OUTPUT_OPTION}
sample_stats++: sample_stats.cpp fst.hpp
${LINK.cpp} $< -I${LIBSEQUENCE}/include ${LDFLAGS_LIBSEQ} -lsequence ${LDLIBS} ${OUTPUT_OPTION}
summstats: summstats.cpp
${LINK.cpp} $< -I${LIBSEQUENCE}/include ${LDFLAGS_LIBSEQ} -lsequence ${LDLIBS} ${OUTPUT_OPTION}