modified: makefile
[GalaxyCodeBases.git] / BGI / SOAPdenovo2 / standardPregraph / Makefile
blob971639145d407a0299c7597c6ff8490cf8ef0d0a
1 ####################################
3 # Use "make 127mer=1" to make 127mer version
4 # Use "make 63mer=1" to make 63mer version(default)
6 ###################################
8 CC= gcc
9 GCCVERSIONMAJOR := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
10 GCCVERSIONMINOR := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 4)
11 ifdef debug
12 CFLAGS= -O0 -g -fomit-frame-pointer #-static #-mcrc32 -march=core2 -msse4.1 -msse4.2
13 else
14 CFLAGS= -O4 -fomit-frame-pointer #-static #-mcrc32 -march=core2 -msse4.1 -msse4.2
15 endif
16 DFLAGS=
17 OBJS= arc.o attachPEinfo.o bubble.o check.o compactEdge.o \
18 concatenateEdge.o connect.o contig.o cutTipPreGraph.o cutTip_graph.o \
19 darray.o dfib.o dfibHeap.o fib.o fibHeap.o \
20 hashFunction.o kmer.o lib.o loadGraph.o loadPath.o \
21 loadPreGraph.o localAsm.o main.o map.o mem_manager.o \
22 newhash.o node2edge.o orderContig.o output_contig.o output_pregraph.o \
23 output_scaffold.o pregraph.o prlHashCtg.o prlHashReads.o prlRead2Ctg.o \
24 prlRead2path.o prlReadFillGap.o read2scaf.o readInterval.o stack.o\
25 readseq1by1.o scaffold.o searchPath.o seq.o splitReps.o \
26 cutTip_graph2.o linearEdge.o kmerhash.o read2edge.o iterate.o
27 PROG= SOAPdenovo-63mer
28 INCLUDES= -Iinc
29 SUBDIRS= .
30 LIBPATH= -L/lib64 -L/usr/lib64 -L./inc
31 LIBS= -pthread -lz -lm
32 EXTRA_FLAGS=
34 BIT_ERR = 0
35 ifeq (,$(findstring $(shell uname -m), x86_64 ppc64 ia64))
36 BIT_ERR = 1
37 endif
39 ifdef 127mer
40 CFLAGS += -DMER127
41 PROG = SOAPdenovo-127mer
42 else
43 CFLAGS += -DMER63
44 PROG = SOAPdenovo-63mer
45 endif
47 ifneq (,$(findstring Linux,$(shell uname)))
48 EXTRA_FLAGS += -Wl,--hash-style=both
49 LIBS += -lbam -lrt
50 endif
52 ifneq (,$(findstring Unix,$(shell uname)))
53 EXTRA_FLAGS += -Wl,--hash-style=both
54 LIBS += -lbam -lrt
55 endif
57 ifneq (,$(findstring Darwin,$(shell uname)))
58 LIBS += -lbammac
59 endif
61 ifneq (,$(findstring $(shell uname -m), x86_64))
62 CFLAGS += -m64
63 endif
65 ifneq (,$(findstring $(shell uname -m), ia64))
66 CFLAGS +=
67 endif
69 ifneq (,$(findstring $(shell uname -m), ppc64))
70 CFLAGS += -mpowerpc64
71 endif
73 .SUFFIXES:.c .o
75 .c.o:
76 @printf "Compiling $<... \r"; \
77 $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< || echo "Error in command: $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $<"
79 all: clean $(OBJS)
81 #SOAPdenovo
83 .PHONY:all clean install
85 envTest:
86 @test $(BIT_ERR) != 1 || sh -c 'echo "Fatal: 64bit CPU and Operating System required!";false;'
87 @test $(GCCVERSIONMAJOR) == 1 || sh -c 'echo "GCC version lower than 4.4.0";false;'
88 @test $(GCCVERSIONMINOR) == 1 || sh -c 'echo "GCC version lower than 4.4.0";false;'
90 SOAPdenovo: envTest $(OBJS)
91 @printf "Linking... \r"
92 @$(CC) $(CFLAGS) -o $(PROG) $(OBJS) $(LIBPATH) $(LIBS) $(ENTRAFLAGS)
93 @printf "$(PROG) compilation done.\n";
95 clean:
96 @rm -fr gmon.out *.o a.out *.exe *.dSYM $(PROG) *~ *.a *.so.* *.so *.dylib
97 @printf "$(PROG) cleaning done.\n";
99 install:
100 @cp $(PROG) ../bin/
101 @printf "$(PROG) installed at ../bin/$(PROG)\n"