From ceff94a59e7ae16948c2d175c8b165c9889d61df Mon Sep 17 00:00:00 2001 From: On behalf of John Marshall Date: Tue, 28 Dec 2010 13:06:49 +0000 Subject: [PATCH] System libraries go *after* user libraries in link commands, because the user libraries may themselves have dependencies that are satisfied by the system libraries. It's not rocket science! This makes a difference with some linkers; or with -static or --as-needed. The examples/Makefile fix is from Charles Plessy. See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606004 --- Makefile | 2 +- bcftools/Makefile | 2 +- examples/Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 13d4a76..e28822e 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ libbam.a:$(LOBJS) $(AR) -cru $@ $(LOBJS) samtools:lib-recur $(AOBJS) - $(CC) $(CFLAGS) -o $@ $(AOBJS) libbam.a -lm $(LIBPATH) $(LIBCURSES) -lz -Lbcftools -lbcf + $(CC) $(CFLAGS) -o $@ $(AOBJS) -Lbcftools $(LIBPATH) libbam.a -lbcf $(LIBCURSES) -lm -lz razip:razip.o razf.o $(KNETFILE_O) $(CC) $(CFLAGS) -o $@ razf.o razip.o $(KNETFILE_O) -lz diff --git a/bcftools/Makefile b/bcftools/Makefile index 8b890ba..e579a9e 100644 --- a/bcftools/Makefile +++ b/bcftools/Makefile @@ -31,7 +31,7 @@ libbcf.a:$(LOBJS) $(AR) -cru $@ $(LOBJS) bcftools:lib $(AOBJS) - $(CC) $(CFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) -lz -L. -lbcf + $(CC) $(CFLAGS) -o $@ $(AOBJS) -L. $(LIBPATH) -lbcf -lm -lz bcf.o:bcf.h vcf.o:bcf.h diff --git a/examples/Makefile b/examples/Makefile index ec976ae..309399f 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -40,11 +40,11 @@ ex1.bcf:ex1.bam ex1.fa.fai (cd ..; make libbam.a) calDepth:../libbam.a calDepth.c - gcc -g -Wall -O2 -I.. calDepth.c -o $@ -lm -lz -L.. -lbam + gcc -g -Wall -O2 -I.. calDepth.c -o $@ -L.. -lbam -lm -lz clean: rm -fr *.bam *.bai *.glf* *.fai *.pileup* *~ calDepth *.dSYM ex1*.rg ex1.bcf # ../samtools pileup ex1.bam|perl -ape '$_=$F[4];s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Z//,tr/a-z//);$_=join("\t",@F[0,1],@_)."\n"' -# ../samtools pileup -cf ex1.fa ex1.bam|perl -ape '$_=$F[8];s/\^.//g;s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Za-z//,tr/,.//);$_=join("\t",@F[0,1],@_)."\n"' \ No newline at end of file +# ../samtools pileup -cf ex1.fa ex1.bam|perl -ape '$_=$F[8];s/\^.//g;s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Za-z//,tr/,.//);$_=join("\t",@F[0,1],@_)."\n"' -- 2.39.2