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