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 | clean: |
---|
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_raxml8.sh $(ARBHOME)/bin |
---|
37 | chmod a+x $(ARBHOME)/bin/arb_raxml8.sh |
---|
38 | cp raxml8.menu $(ARBHOME)/lib/gde |
---|
39 | |
---|
40 | build: $(VERSIONS:%=$(RAXML_BIN)%) |
---|
41 | |
---|
42 | # (MAKEFLAGS need to be unset as ARB sets "-r", suppressing built-in rules, |
---|
43 | # which are needed by RAxML) |
---|
44 | |
---|
45 | $(RAXML_BIN)%: unpack.%.stamp |
---|
46 | MAKEFLAGS= $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX) |
---|
47 | cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@ |
---|
48 | |
---|
49 | unpack.%.stamp: $(TARFILE) |
---|
50 | (DIR=$(@:unpack.%.stamp=builddir.%); \ |
---|
51 | rm -rf $$DIR &&\ |
---|
52 | mkdir $$DIR &&\ |
---|
53 | tar -C $$DIR --strip-components=1 -xzf $(TARFILE) &&\ |
---|
54 | arb_sed -i 's/-march=native//' $$DIR/Makefile*) |
---|
55 | touch $@ -r $(TARFILE) |
---|
56 | |
---|
57 | %.stamp: |
---|
58 | echo $@ |
---|
59 | |
---|
60 | # prevent make from deleting intermediate targets: |
---|
61 | .SECONDARY: |
---|
62 | |
---|
63 | .PHONY: clean all |
---|