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