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 standard-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- |
---|
23 | |
---|
24 | ## targets called by "upsteam makefile": |
---|
25 | |
---|
26 | all: install |
---|
27 | |
---|
28 | |
---|
29 | clean: |
---|
30 | rm -rf builddir.* |
---|
31 | rm -f $(RAXML_BIN)* |
---|
32 | rm -f unpack.*.stamp |
---|
33 | |
---|
34 | wantNoWindowsExecutables: |
---|
35 | find . -name "WindowsExecutables*" -type d -exec rm -r {} \; || true |
---|
36 | |
---|
37 | ## internal targets |
---|
38 | |
---|
39 | OBSOLETE_MENU=$(ARBHOME)/lib/gde/raxml8.menu |
---|
40 | |
---|
41 | install: build |
---|
42 | cp arb_raxml8.sh $(ARBHOME)/bin |
---|
43 | chmod a+x $(ARBHOME)/bin/arb_raxml8.sh |
---|
44 | test ! -e $(OBSOLETE_MENU) || rm $(OBSOLETE_MENU) |
---|
45 | |
---|
46 | build: require_tarball $(VERSIONS:%=$(RAXML_BIN)%) |
---|
47 | $(MAKE) wantNoWindowsExecutables |
---|
48 | |
---|
49 | require_tarball: |
---|
50 | ifeq ($(TARFILE),) |
---|
51 | $(error Failed to detect RAxML tarball) |
---|
52 | endif |
---|
53 | |
---|
54 | # (MAKEFLAGS need to be unset as ARB sets "-r", suppressing built-in rules, |
---|
55 | # which are needed by RAxML) |
---|
56 | |
---|
57 | $(RAXML_BIN)%: unpack.%.stamp |
---|
58 | MAKEFLAGS= $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX) |
---|
59 | cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@ |
---|
60 | |
---|
61 | unpack.%.stamp: require_tarball $(TARFILE) |
---|
62 | (DIR=$(@:unpack.%.stamp=builddir.%); \ |
---|
63 | rm -rf $$DIR &&\ |
---|
64 | mkdir $$DIR &&\ |
---|
65 | tar -C $$DIR --strip-components=1 -xzf $(TARFILE) &&\ |
---|
66 | arb_sed -i 's/-march=native//' $$DIR/Makefile*) |
---|
67 | touch $@ -r $(TARFILE) |
---|
68 | |
---|
69 | %.stamp: |
---|
70 | echo $@ |
---|
71 | |
---|
72 | # prevent make from deleting intermediate targets: |
---|
73 | .SECONDARY: |
---|
74 | |
---|
75 | .PHONY: clean all |
---|