ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/Makefile
Revision: 207
Committed: Mon Mar 12 21:39:30 2012 UTC (12 years, 5 months ago) by gpertea
File size: 3652 byte(s)
Log Message:
wip 

Line User Rev File contents
1 gpertea 29 # Directories to search for header files
2 gpertea 200 SEQAN = ./SeqAn-1.3
3 gpertea 135 SEARCHDIRS := -I. -I${SEQAN} -I.. -I/opt/geo/include
4 gpertea 29
5     SYSTYPE := $(shell uname)
6    
7     # C compiler
8    
9     MACHTYPE := $(shell uname -m)
10     ifeq ($(MACHTYPE), i686)
11     MARCH = -march=i686
12     else
13     MARCH =
14     endif
15    
16     CC := g++
17 gpertea 154 BASEFLAGS = -Wall -pthread ${SEARCHDIRS} $(MARCH) -DHAVE_CONFIG_H \
18 gpertea 29 -fno-strict-aliasing -D_REENTRANT
19    
20    
21 gpertea 163 ifeq ($(findstring nodebug,$(MAKECMDGOALS)),)
22     CFLAGS = -g -DMEM_DEBUG -DDEBUG $(BASEFLAGS)
23     LDFLAGS = -g -L/opt/geo/lib
24     else
25 gpertea 29 CFLAGS = -O2 -DNDEBUG $(BASEFLAGS)
26     LDFLAGS = -L/opt/geo/lib
27     endif
28    
29     %.o : %.c
30     ${CC} ${CFLAGS} -c $< -o $@
31    
32     %.o : %.cc
33     ${CC} ${CFLAGS} -c $< -o $@
34    
35     %.o : %.C
36     ${CC} ${CFLAGS} -c $< -o $@
37    
38     %.o : %.cpp
39     ${CC} ${CFLAGS} -c $< -o $@
40    
41     %.o : %.cxx
42     ${CC} ${CFLAGS} -c $< -o $@
43    
44     # C/C++ linker
45    
46     LINKER := g++
47 gpertea 167 LIBS = -lz -lbam
48     BLIBS = ${LIBS} -lpthread -lboost_thread
49 gpertea 29
50 gpertea 154 COM_OBJS = common.o reads.o tokenize.o utils.o
51 gpertea 29 PREP_OBJS = ${COM_OBJS} qual.o
52     GFF_OBJS = GBase.o GStr.o codons.o gdna.o GFaSeqGet.o gff.o
53 gpertea 200 SEG_OBJS = ${COM_OBJS} bwt_map.o junctions.o insertions.o coverage.o \
54     fragments.o align_status.o deletions.o fusions.o
55 gpertea 29
56 gpertea 135 ALL_EXE = fix_map_ordering map2gtf gtf_to_fasta bam_merge bam2fastx \
57 gpertea 167 prep_reads extract_reads juncs_db long_spanning_reads gtf_juncs segment_juncs \
58 gpertea 135 tophat_reports
59 gpertea 29
60     .PHONY : all
61 gpertea 167 #all: fix_map_ordering
62 gpertea 207 all: prep_reads
63 gpertea 163 #.PHONY : nodebug
64     nodebug : all
65 gpertea 135 #all: prep_reads
66     #debug: prep_reads
67    
68 gpertea 157 all_exe: $(ALL_EXE)
69 gpertea 135 #all: $(ALL_EXE)
70     #debug: $(ALL_EXE)
71     #all: segment_juncs
72     #debug: segment_juncs
73 gpertea 29 #all: bam_dump
74     #all: sam2bam
75     #debug: sam2bam
76     #all: prep_reads
77     #debug: prep_reads
78     sam2bam: ./sam2bam.o
79     ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
80     bam_dump: ./bam_dump.o
81     ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
82     #all: prep_reads
83     #debug: prep_reads
84     all_bin: ${ALL_EXE}
85     bwt2sam: ${COM_OBJS} bwt_map.o bwt2sam.o
86     ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
87     bam2bed: ./bam2bed.o
88     ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
89     bam2fastx: ./bam2fastx.o
90     ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
91 gpertea 157 bam_merge: ./common.o ./GBase.o ./bam_merge.o
92 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
93     bwt_map.o: bwt_map.h
94 gpertea 200 fix_map_ordering: ${COM_OBJS} bwt_map.o fix_map_ordering.o
95 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
96 gpertea 154 long_spanning_reads: ${SEG_OBJS} fusions.o long_spanning_reads.o
97 gpertea 167 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${BLIBS}
98 gpertea 200 prep_reads: ${PREP_OBJS} prep_reads.o
99 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
100 gpertea 200 extract_reads: ${COM_OBJS} extract_reads.o
101 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
102 gpertea 200 gtf_to_fasta: ${COM_OBJS} bwt_map.o ${GFF_OBJS} FastaTools.o GTFToFasta.o
103 gpertea 135 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
104 gpertea 200 map2gtf: ${COM_OBJS} bwt_map.o ${GFF_OBJS} map2gtf.o
105 gpertea 135 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
106 gpertea 200 gtf_juncs: ${COM_OBJS} bwt_map.o ${GFF_OBJS} gtf_juncs.o
107 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
108 gpertea 200 segment_juncs: ${SEG_OBJS} segment_juncs.o
109 gpertea 167 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${BLIBS}
110 gpertea 200 juncs_db: ${SEG_OBJS} juncs_db.o
111 gpertea 29 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LIBS}
112 gpertea 200 tophat_reports: ${SEG_OBJS} inserts.o tophat_reports.o
113 gpertea 167 ${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${BLIBS}
114 gpertea 200 tophat_reports.o prep_reads.o fix_map_ordering.o map2gtf.o bam_merge.o bam2fastx.o bwt_map.o common.o: common.h
115     bwt_map.o: common.h bwt_map.h
116 gpertea 29
117     # target for removing all object files
118    
119     .PHONY : clean
120 gpertea 135 clean::
121     ${RM} *.o sam2bam core core.* ${ALL_EXE}