1 | # Wrapper to build RAxML versions |
---|
2 | |
---|
3 | # _PORTABLE_PTHREADS in axml.c to get pthread pinning on linux |
---|
4 | # use approx 1 thread per 500bp |
---|
5 | |
---|
6 | # Versions of RAxML to build |
---|
7 | VERSIONS:=SSE3.PTHREADS PTHREADS |
---|
8 | |
---|
9 | # AVX needs gcc >= 4.6.0 |
---|
10 | ifeq ("$(USE_GCC_46_OR_HIGHER)", "yes") |
---|
11 | VERSIONS+=AVX.PTHREADS |
---|
12 | endif |
---|
13 | |
---|
14 | TARFILE=$(wildcard sativa-RAxML-8.*.*gz) |
---|
15 | |
---|
16 | ifeq ($(DARWIN),1) |
---|
17 | MAKE_SUFFIX=mac |
---|
18 | else |
---|
19 | MAKE_SUFFIX=gcc |
---|
20 | endif |
---|
21 | |
---|
22 | RAXML_BIN=$(ARBHOME)/bin/raxmlHPC8-sativa- |
---|
23 | |
---|
24 | ## targets called by "upsteam makefile": |
---|
25 | |
---|
26 | all: install |
---|
27 | |
---|
28 | clean_local: |
---|
29 | rm -rf builddir.* |
---|
30 | rm -f $(RAXML_BIN)* |
---|
31 | rm -f unpack.*.stamp |
---|
32 | |
---|
33 | ## internal targets |
---|
34 | |
---|
35 | install: build |
---|
36 | cp arb_sativa.pl $(ARBHOME)/bin |
---|
37 | chmod a+x $(ARBHOME)/bin/arb_sativa.pl |
---|
38 | cp arb_raxml8_sativa.sh $(ARBHOME)/bin |
---|
39 | chmod a+x $(ARBHOME)/bin/arb_raxml8_sativa.sh |
---|
40 | cp sativa.menu $(ARBHOME)/lib/gde |
---|
41 | find sativa -path "*.svn" -prune -o -type d -exec mkdir -p $(ARBHOME)/lib/{} \; |
---|
42 | find sativa -path "*.svn" -prune -o -type f -exec cp -p {} $(ARBHOME)/lib/{} \; |
---|
43 | # ln -s $(ARBHOME)/bin $(ARBHOME)/bin/sativa/epac/bin |
---|
44 | |
---|
45 | uninstall: |
---|
46 | rm -f $(ARBHOME)/bin/arb_sativa.pl |
---|
47 | rm -f $(ARBHOME)/bin/arb_raxml8_sativa.sh |
---|
48 | rm -rf $(ARBHOME)/lib/sativa |
---|
49 | rm -f $(ARBHOME)/lib/gde/sativa.menu |
---|
50 | |
---|
51 | clean: clean_local uninstall |
---|
52 | |
---|
53 | build: $(VERSIONS:%=$(RAXML_BIN)%) |
---|
54 | |
---|
55 | # (MAKEFLAGS need to be unset as ARB sets "-r", suppressing built-in rules, |
---|
56 | # which are needed by RAxML) |
---|
57 | |
---|
58 | $(RAXML_BIN)%: unpack.%.stamp Makefile |
---|
59 | ( MAKEFLAGS= $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX) ) 2>&1 | grep -vi ' warning: ' |
---|
60 | cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@ |
---|
61 | |
---|
62 | unpack.%.stamp: $(TARFILE) |
---|
63 | (DIR=$(@:unpack.%.stamp=builddir.%); \ |
---|
64 | rm -rf $$DIR &&\ |
---|
65 | mkdir $$DIR &&\ |
---|
66 | tar -C $$DIR --strip-components=1 -xzf $(TARFILE) &&\ |
---|
67 | arb_sed -i 's/-march=native//' $$DIR/Makefile*) |
---|
68 | touch $@ -r $(TARFILE) |
---|
69 | |
---|
70 | %.stamp: |
---|
71 | echo $@ |
---|
72 | |
---|
73 | # prevent make from deleting intermediate targets: |
---|
74 | .SECONDARY: |
---|
75 | |
---|
76 | .PHONY: clean all install build uninstall clean_local |
---|