]> git.donarmstrong.com Git - mothur.git/blob - makefile
update .gitignore
[mothur.git] / makefile
1 ###################################################
2 #
3 # Makefile for mothur
4 # Created: June 29, 2010
5 #
6 ###################################################
7
8 #
9 # Macros
10 #
11
12 USEMPI ?= no
13 64BIT_VERSION ?= yes
14 USEREADLINE ?= yes
15 USECOMPRESSION ?= no
16 MOTHUR_FILES="\"Enter_your_default_path_here\""
17 RELEASE_DATE = "\"2/12/2014\""
18 VERSION = "\"1.33.0\""
19 FORTAN_COMPILER = gfortran
20 FORTRAN_FLAGS = 
21
22 # Optimize to level 3:
23 CXXFLAGS += -O3 
24
25 ifeq  ($(strip $(64BIT_VERSION)),yes)
26         #if you are using centos uncomment the following lines
27         #CXX = g++44
28         
29         #if you are a mac user use the following line
30         TARGET_ARCH += -arch x86_64
31         
32         #if you using cygwin to build Windows the following line
33         #CXX = x86_64-w64-mingw32-g++
34         #CC = x86_64-w64-mingw32-g++
35         #FORTAN_COMPILER = x86_64-w64-mingw32-gfortran
36         #TARGET_ARCH += -m64 -static
37
38         #if you are a linux user use the following line
39         #CXXFLAGS += -mtune=native -march=native 
40         
41         CXXFLAGS += -DBIT_VERSION 
42 endif
43
44
45 CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}
46
47 ifeq  ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
48 else
49         CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
50 endif
51
52
53 # if you do not want to use the readline library, set this to no.
54 # make sure you have the library installed
55
56
57 ifeq  ($(strip $(USEREADLINE)),yes)
58     CXXFLAGS += -DUSE_READLINE
59     LIBS = \
60       -lreadline\
61       -lncurses
62 endif
63
64
65 ifeq  ($(strip $(USEMPI)),yes)
66     CXX = mpic++
67     CXXFLAGS += -DUSE_MPI
68 endif
69
70 # if you want to enable reading and writing of compressed files, set to yes.
71 # The default is no.  this may only work on unix-like systems, not for windows.
72
73
74 ifeq  ($(strip $(USECOMPRESSION)),yes)
75   CXXFLAGS += -DUSE_COMPRESSION
76 endif
77
78 #
79 # INCLUDE directories for mothur
80 #
81
82      CXXFLAGS += -I.
83
84 #
85 # Get the list of all .cpp files, rename to .o files
86 #
87
88 OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
89 OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))
90 OBJECTS+=$(patsubst %.f,%.o,$(wildcard *.f))
91
92 mothur : fortranSource $(OBJECTS) uchime
93         $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
94         
95         strip mothur
96  
97 uchime:
98         cd uchime_src && ./mk && mv uchime .. && cd ..
99         
100 fortranSource:
101         ${FORTAN_COMPILER} -c $(FORTRAN_FLAGS) *.f
102
103 install : mothur
104 #       cp mothur ../Release/mothur
105         
106 %.o : %.c %.h
107         $(COMPILE.c) $(OUTPUT_OPTION) $<
108 %.o : %.cpp %.h
109         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
110 %.o : %.cpp %.hpp
111         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
112
113
114 clean :
115         @rm -f $(OBJECTS)
116         @rm -f uchime
117