]> git.donarmstrong.com Git - mothur.git/blob - makefile
bug fixes
[mothur.git] / makefile
1 ###################################################
2 #
3 # Makefile for mothur
4 # Created: June 29, 2010
5 #
6 ###################################################
7
8 #
9 # Macros
10 #
11
12 # Optimize to level 3:
13
14 CXXFLAGS += -O3
15
16 MOTHUR_FILES = "\"../Release\""
17
18 RELEASE_DATE = "\"9/17/2010\""
19 VERSION = "\"1.13.0\""
20
21 CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}
22
23 ifeq  ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
24 else
25         CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
26 endif
27
28 CYGWIN_BUILD ?= no
29 ifeq  ($(strip $(CYGWIN_BUILD)),yes)
30     CXXFLAGS += -mno-cygwin
31     LDFLAGS += -mno-cygwin 
32 endif
33
34 64BIT_VERSION ?= yes
35
36 ifeq  ($(strip $(64BIT_VERSION)),yes)
37     TARGET_ARCH += -arch x86_64
38          CXXFLAGS += -DBIT_VERSION
39         
40         #if you are using centos uncomment the following lines
41         #CXX = g++44
42         #CXXFLAGS += -mtune=native -march=native -m64
43 endif
44
45 # if you do not want to use the readline library, set this to no.
46 # make sure you have the library installed
47
48 USEREADLINE ?= yes
49
50 ifeq  ($(strip $(USEREADLINE)),yes)
51     CXXFLAGS += -DUSE_READLINE
52     LDFLAGS += \
53       -lreadline\
54       -lncurses
55 endif
56
57 USEMPI ?= no
58
59 ifeq  ($(strip $(USEMPI)),yes)
60     CXX = mpic++
61     CXXFLAGS += -DUSE_MPI
62 endif
63
64 # if you want to enable reading and writing of compressed files, set to yes.
65 # The default is no.  this may only work on unix-like systems.
66
67 USECOMPRESSION ?= no
68
69 ifeq  ($(strip $(USECOMPRESSION)),yes)
70   CXXFLAGS += -DUSE_COMPRESSION
71 endif
72
73 #
74 # INCLUDE directories for mothur
75 #
76
77      CXXFLAGS += -I.
78
79 #
80 # Get the list of all .cpp files, rename to .o files
81 #
82
83 OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
84 OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))
85
86 mothur : $(OBJECTS)
87         $(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS)
88
89 install : mothur
90         cp mothur ../Release/mothur
91         
92 %.o : %.c %.h
93         $(COMPILE.c) $(OUTPUT_OPTION) $<
94 %.o : %.cpp %.h
95         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
96 %.o : %.cpp %.hpp
97         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
98
99
100 clean :
101         @rm -f $(OBJECTS)
102