]> git.donarmstrong.com Git - samtools.git/commitdiff
System libraries go *after* user libraries in link commands, because
authorOn behalf of John Marshall <lh3@sanger.ac.uk>
Tue, 28 Dec 2010 13:06:49 +0000 (13:06 +0000)
committerOn behalf of John Marshall <lh3@sanger.ac.uk>
Tue, 28 Dec 2010 13:06:49 +0000 (13:06 +0000)
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
bcftools/Makefile
examples/Makefile

index 13d4a7698e1ded63520b3c8c7a117a45d91af1a1..e28822eabfa7499e5cb8d5a1a5198360e73630ee 100644 (file)
--- 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
index 8b890ba67e7ca5146bfc05e533884f52bc8d371a..e579a9e2404a4a4359802f91cbdad1b0a1cbf09e 100644 (file)
@@ -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
index ec976aedecf120c62a997580832e39c40d9748ac..309399f3affae42e494903604243d36a11c16f3d 100644 (file)
@@ -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"'