]> git.donarmstrong.com Git - mothur.git/blob - makefile
added qvalues to metastats. fixed bug with chimera.uchime location. fixed windows...
[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 CYGWIN_BUILD ?= no
16 USECOMPRESSION ?= no
17 MOTHUR_FILES="\"Enter_your_default_path_here\""
18 RELEASE_DATE = "\"12/7/2011\""
19 VERSION = "\"1.22.0\""
20 FORTAN_COMPILER = gfortran
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         #TARGET_ARCH += -m64 -static
36
37         #if you are a linux user use the following line
38         #CXXFLAGS += -mtune=native -march=native -m64
39         
40          CXXFLAGS += -DBIT_VERSION
41 endif
42
43
44 CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}
45
46 ifeq  ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
47 else
48         CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
49 endif
50
51 ifeq  ($(strip $(CYGWIN_BUILD)),yes)
52     CXXFLAGS += -mno-cygwin
53     LDFLAGS += -mno-cygwin 
54 endif
55
56 # if you do not want to use the readline library, set this to no.
57 # make sure you have the library installed
58
59
60 ifeq  ($(strip $(USEREADLINE)),yes)
61     CXXFLAGS += -DUSE_READLINE
62     LIBS = \
63       -lreadline\
64       -lncurses
65 endif
66
67
68 ifeq  ($(strip $(USEMPI)),yes)
69     CXX = mpic++
70     CXXFLAGS += -DUSE_MPI
71 endif
72
73 # if you want to enable reading and writing of compressed files, set to yes.
74 # The default is no.  this may only work on unix-like systems, not for windows.
75
76
77 ifeq  ($(strip $(USECOMPRESSION)),yes)
78   CXXFLAGS += -DUSE_COMPRESSION
79 endif
80
81 #
82 # INCLUDE directories for mothur
83 #
84
85      CXXFLAGS += -I.
86
87 #
88 # Get the list of all .cpp files, rename to .o files
89 #
90
91 OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
92 OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))
93 OBJECTS+=$(patsubst %.f,%.o,$(wildcard *.f))
94
95 mothur : fortranSource $(OBJECTS) uchime
96         $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
97         
98         strip mothur
99
100 uchime:
101         cd uchime_src && ./mk && mv uchime .. && cd ..
102         
103 fortranSource:
104         ${FORTAN_COMPILER} -c *.f
105
106 install : mothur
107 #       cp mothur ../Release/mothur
108         
109 %.o : %.c %.h
110         $(COMPILE.c) $(OUTPUT_OPTION) $<
111 %.o : %.cpp %.h
112         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
113 %.o : %.cpp %.hpp
114         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
115
116
117 clean :
118         @rm -f $(OBJECTS)
119         @rm -f uchime
120