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=sativa-RAxML-8.2.3-patched.tar.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 | OBSOLETE_MENU=$(ARBHOME)/lib/gde/sativa.menu |
---|
36 | |
---|
37 | install: build |
---|
38 | cp arb_sativa.pl $(ARBHOME)/bin |
---|
39 | chmod a+x $(ARBHOME)/bin/arb_sativa.pl |
---|
40 | cp arb_raxml8_sativa.sh $(ARBHOME)/bin |
---|
41 | chmod a+x $(ARBHOME)/bin/arb_raxml8_sativa.sh |
---|
42 | test ! -e $(OBSOLETE_MENU) || rm $(OBSOLETE_MENU) |
---|
43 | find sativa -path "*.svn" -prune -o -type d -exec mkdir -p $(ARBHOME)/lib/{} \; |
---|
44 | find sativa -path "*.svn" -prune -o -type f -exec cp -p {} $(ARBHOME)/lib/{} \; |
---|
45 | # ln -s $(ARBHOME)/bin $(ARBHOME)/bin/sativa/epac/bin |
---|
46 | |
---|
47 | uninstall: |
---|
48 | rm -f $(ARBHOME)/bin/arb_sativa.pl |
---|
49 | rm -f $(ARBHOME)/bin/arb_raxml8_sativa.sh |
---|
50 | rm -rf $(ARBHOME)/lib/sativa |
---|
51 | rm -f $(ARBHOME)/lib/gde/sativa.menu |
---|
52 | |
---|
53 | clean: clean_local uninstall |
---|
54 | |
---|
55 | build: $(VERSIONS:%=$(RAXML_BIN)%) |
---|
56 | |
---|
57 | # (MAKEFLAGS need to be unset as ARB sets "-r", suppressing built-in rules, |
---|
58 | # which are needed by RAxML) |
---|
59 | |
---|
60 | $(RAXML_BIN)%: unpack.%.stamp Makefile |
---|
61 | ( MAKEFLAGS= $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX) ) 2>&1 | grep -vi ' warning: ' |
---|
62 | cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@ |
---|
63 | |
---|
64 | unpack.%.stamp: $(TARFILE) |
---|
65 | (DIR=$(@:unpack.%.stamp=builddir.%); \ |
---|
66 | rm -rf $$DIR &&\ |
---|
67 | mkdir $$DIR &&\ |
---|
68 | tar -C $$DIR --strip-components=1 -xzf $(TARFILE) &&\ |
---|
69 | arb_sed -i 's/-march=native//' $$DIR/Makefile*) |
---|
70 | touch $@ -r $(TARFILE) |
---|
71 | |
---|
72 | %.stamp: |
---|
73 | echo $@ |
---|
74 | |
---|
75 | # prevent make from deleting intermediate targets: |
---|
76 | .SECONDARY: |
---|
77 | |
---|
78 | .PHONY: clean all install build uninstall clean_local |
---|