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