File: Makefile-Windows

package info (click to toggle)
mothur 1.41.21-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 12,892 kB
  • sloc: cpp: 163,600; makefile: 84; sh: 29
file content (80 lines) | stat: -rw-r--r-- 2,368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
###################################################
#
# Makefile for mothur
#
###################################################

#
# Macros
#
# 64BIT_VERSION - set to no if you are using a 32bit arch.
# OPTIMIZE - yes will increase speed of executable.
# USEREADLINE - link with readline libraries.  Must have readline installed. Windows set to no.
# USEBOOST - link with boost libraries. Must install boost. Allows the make.contigs command to read .gz files.
# BOOST_LIBRARY_DIR - location of boost libraries
# BOOST_INCLUDE_DIR - location of boost include files
# MOTHUR_FILES - default location for mothur to look for input files at runtime. Most often used for reference files.

64BIT_VERSION ?= yes
USEREADLINE ?= no
USEBOOST ?= no
RELEASE_DATE = "\"09/01/2017\""
VERSION = "\"1.40.0\""

# Optimize to level 3:
		CXXFLAGS += -O3

#CPP_11
	CXXFLAGS += -std=c++11

ifeq  ($(strip $(64BIT_VERSION)),yes)
		#if you using cygwin to build Windows the following line
		CXX = x86_64-w64-mingw32-g++
		CC = x86_64-w64-mingw32-g++
		TARGET_ARCH += -m64 -static
		CXXFLAGS += -DBIT_VERSION
endif

CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}

# INCLUDE directories for mothur
		VPATH=source/calculators:source/chimera:source/classifier:source/clearcut:source/commands:source/communitytype:source/datastructures:source/metastats:source/randomforest:source/read:source/svm
		skipUchime := source/uchime_src/
		subdirs :=  $(sort $(dir $(filter-out  $(skipUchime), $(wildcard source/*/))))
		subDirIncludes = $(patsubst %, -I %, $(subdirs))
		subDirLinking =  $(patsubst %, -L%, $(subdirs))
		CXXFLAGS += -I. $(subDirIncludes)
		LDFLAGS += $(subDirLinking)

#
# Get the list of all .cpp files, rename to .o files
#
		OBJECTS=$(patsubst %.cpp,%.o,$(wildcard $(addsuffix *.cpp,$(subdirs))))
		OBJECTS+=$(patsubst %.c,%.o,$(wildcard $(addsuffix *.c,$(subdirs))))
		OBJECTS+=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
		OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))

mothur : $(OBJECTS) uchime
		$(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
		strip mothur


uchime:
		cd source/uchime_src && ./mk && mv uchime ../../ && cd ..


install : mothur


%.o : %.c %.h
		$(COMPILE.c) $(OUTPUT_OPTION) $<
%.o : %.cpp %.h
		$(COMPILE.cpp) $(OUTPUT_OPTION) $<
%.o : %.cpp %.hpp
		$(COMPILE.cpp) $(OUTPUT_OPTION) $<



clean :
		@rm -f $(OBJECTS)
		@rm -f uchime