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