]> git.donarmstrong.com Git - samtools.git/blob - Makefile
* samtools-0.1.4-9 (r340)
[samtools.git] / Makefile
1 CC=                     gcc
2 CXX=            g++
3 CFLAGS=         -g -Wall -O2 #-m64 #-arch ppc
4 CXXFLAGS=       $(CFLAGS)
5 DFLAGS=         -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 #-D_NO_CURSES
6 OBJS=           bam.o bam_import.o bam_pileup.o bam_lpileup.o bam_sort.o bam_index.o \
7                         razf.o bgzf.o faidx.o bam_tview.o bam_maqcns.o bam_aux.o bam_plcmd.o \
8                         bam_mate.o bam_rmdup.o glf.o bam_stat.o kstring.o bam_md.o sam.o sam_view.o \
9                         bam_rmdupse.o
10 PROG=           bgzip samtools
11 INCLUDES=       
12 SUBDIRS=        . misc
13
14 .SUFFIXES:.c .o
15
16 .c.o:
17                 $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
18
19 all-recur lib-recur clean-recur cleanlocal-recur install-recur:
20                 @target=`echo $@ | sed s/-recur//`; \
21                 wdir=`pwd`; \
22                 list='$(SUBDIRS)'; for subdir in $$list; do \
23                         cd $$subdir; \
24                         $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
25                                 INCLUDES="$(INCLUDES)" $$target || exit 1; \
26                         cd $$wdir; \
27                 done;
28
29 all:$(PROG)
30
31 lib:libbam.a
32
33 libbam.a:$(OBJS)
34                 $(AR) -cru $@ $(OBJS)
35
36 ### For the curses library: comment out `-lcurses' if you do not have curses installed
37 samtools:lib bamtk.o
38                 $(CC) $(CFLAGS) -o $@ bamtk.o -lm -L. -lbam -lcurses -lz
39
40 razip:razip.o razf.o
41                 $(CC) $(CFLAGS) -o $@ razf.o razip.o -lz
42
43 bgzip:bgzip.o bgzf.o
44                 $(CC) $(CFLAGS) -o $@ bgzf.o bgzip.o -lz
45
46 razip.o:razf.h
47 bam.o:bam.h razf.h bam_endian.h kstring.h
48 sam.o:sam.h bam.h
49 bam_import.o:bam.h kseq.h khash.h razf.h
50 bam_pileup.o:bam.h razf.h ksort.h
51 bam_plcmd.o:bam.h faidx.h bam_maqcns.h glf.h
52 bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h
53 bam_lpileup.o:bam.h ksort.h
54 bam_tview.o:bam.h faidx.h bam_maqcns.h
55 bam_maqcns.o:bam.h ksort.h bam_maqcns.h
56 bam_sort.o:bam.h ksort.h razf.h
57 bam_md.o:bam.h faidx.h
58 glf.o:glf.h
59
60 faidx.o:faidx.h razf.h khash.h
61 faidx_main.o:faidx.h razf.h
62
63 cleanlocal:
64                 rm -fr gmon.out *.o a.out *.dSYM razip $(PROG) *~ *.a
65
66 clean:cleanlocal-recur