source: trunk/GDE/SATIVA/Makefile

Last change on this file was 19457, checked in by westram, 16 months ago
  • pass down onlyC_flags.
  • use onlyC_flags in all Makefiles (inject using seq).
  • patch SATIVA raxml code in tarball (one missing prototype).
File size: 2.1 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=sativa-RAxML-8.2.3-patched.tar.gz
15
16ifeq ($(DARWIN),1)
17  MAKE_SUFFIX=mac
18else
19  MAKE_SUFFIX=gcc
20endif
21
22RAXML_BIN=$(ARBHOME)/bin/raxmlHPC8-sativa-
23
24## targets called by "upsteam makefile":
25
26all: install
27
28clean_local:
29        rm -rf builddir.*
30        rm -f $(RAXML_BIN)*
31        rm -f unpack.*.stamp
32
33## internal targets
34
35OBSOLETE_MENU=$(ARBHOME)/lib/gde/sativa.menu
36
37install: 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
47uninstall:
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
53clean: clean_local uninstall
54
55build:  $(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= onlyC_flags="$(onlyC_flags)" $(MAKE) -C $(<:unpack.%.stamp=builddir.%) -f Makefile.$(@:$(RAXML_BIN)%=%).$(MAKE_SUFFIX) ) 2>&1 | grep -vi ' warning: '
62        cp $(<:unpack.%.stamp=builddir.%)/raxmlHPC-* $@
63
64unpack.%.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 --in-place 's/-march=native//' $$DIR/Makefile* &&\
70                arb_sed --in-place 's/\(CFLAGS.*\)#/\1 $$(onlyC_flags) #/' $$DIR/Makefile* )
71        touch $@ -r $(TARFILE)
72
73%.stamp:
74        echo $@
75
76# prevent make from deleting intermediate targets:
77.SECONDARY:
78
79.PHONY: clean all install build uninstall clean_local
Note: See TracBrowser for help on using the repository browser.