source: trunk/GDE/RAxML8/Makefile

Last change on this file was 19480, checked in by westram, 17 months ago
File size: 1.8 KB
Line 
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
7VERSIONS:=SSE3.PTHREADS PTHREADS
8
9# AVX needs gcc >= 4.6.0
10ifeq ("$(USE_GCC_46_OR_HIGHER)", "yes")
11  VERSIONS+=AVX.PTHREADS
12endif
13
14TARFILE=$(wildcard standard-RAxML-8.*.*gz)
15
16ifeq ($(DARWIN),1)
17  MAKE_SUFFIX=mac
18else
19  MAKE_SUFFIX=gcc
20endif
21
22RAXML_BIN=$(ARBHOME)/bin/raxmlHPC8-
23
24## targets called by "upsteam makefile":
25
26all: install
27
28
29clean:
30        rm -rf builddir.*
31        rm -f $(RAXML_BIN)*
32        rm -f unpack.*.stamp
33
34wantNoWindowsExecutables:
35        find . -name "WindowsExecutables*" -type d -exec rm -r {} \; || true
36
37## internal targets
38
39OBSOLETE_MENU=$(ARBHOME)/lib/gde/raxml8.menu
40
41install: 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
46build:  require_tarball $(VERSIONS:%=$(RAXML_BIN)%)
47        $(MAKE) wantNoWindowsExecutables
48
49require_tarball:
50ifeq ($(TARFILE),)
51        $(error Failed to detect RAxML tarball)
52endif
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= onlyC_flags="$(onlyC_flags)" $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX)
59        cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@
60
61unpack.%.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 --in-place 's/-march=native//' $$DIR/Makefile* &&\
67                arb_sed --in-place 's/\(CFLAGS.*\)#/\1 $$(onlyC_flags) #/' $$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
Note: See TracBrowser for help on using the repository browser.