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