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