]> git.donarmstrong.com Git - samtools.git/blob - Makefile
* update Makefile
[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=           razip bgzip samtools
12 INCLUDES=       -Izlib
13 LIBS=           -lm -Lzlib -lz
14 SUBDIRS=        zlib . misc
15
16 .SUFFIXES:.c .o
17
18 .c.o:
19                 $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
20
21 all-recur lib-recur clean-recur cleanlocal-recur install-recur:
22                 @target=`echo $@ | sed s/-recur//`; \
23                 wdir=`pwd`; \
24                 list='$(SUBDIRS)'; for subdir in $$list; do \
25                         cd $$subdir; \
26                         $(MAKE) -f Makefile CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
27                                 INCLUDES="$(INCLUDES)" LIBS="$(LIBS)" $$target || exit 1; \
28                         cd $$wdir; \
29                 done;
30
31 all:$(PROG)
32
33 lib:libbam.a
34
35 libbam.a:$(OBJS)
36                 $(AR) -cru $@ $(OBJS)
37
38 ### For ncurses: comment out `-lcurses' if you do not have ncurses installed
39 samtools:lib bamtk.o
40                 $(CC) $(CFLAGS) -o $@ bamtk.o $(LIBS) -L. -lbam -lcurses
41
42 razip:razip.o razf.o
43                 $(CC) $(CFLAGS) -o $@ razf.o razip.o $(LIBS)
44
45 bgzip:bgzip.o bgzf.o
46                 $(CC) $(CFLAGS) -o $@ bgzf.o bgzip.o $(LIBS)
47
48 razip.o:razf.h
49 bam.o:bam.h razf.h bam_endian.h kstring.h
50 sam.o:sam.h bam.h
51 bam_import.o:bam.h kseq.h khash.h razf.h
52 bam_pileup.o:bam.h razf.h ksort.h
53 bam_plcmd.o:bam.h faidx.h bam_maqcns.h glf.h
54 bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h
55 bam_lpileup.o:bam.h ksort.h
56 bam_tview.o:bam.h faidx.h bam_maqcns.h
57 bam_maqcns.o:bam.h ksort.h bam_maqcns.h
58 bam_sort.o:bam.h ksort.h razf.h
59 bam_md.o:bam.h faidx.h
60 razf.o:razf.h
61 glf.o:glf.h
62
63 faidx.o:faidx.h razf.h khash.h
64 faidx_main.o:faidx.h razf.h
65
66 cleanlocal:
67                 rm -fr gmon.out *.o a.out *.dSYM $(PROG) *~ *.a
68
69 clean:cleanlocal-recur